Optimization Problems with Matrix Multiplication