# How to solve the following equality-constrained quadratic program?

$$\label \arg\min\limits_{\mathbf{c}} \mathbf{c}^TA\mathbf{c}-\mathbf{b}^T\mathbf{c}\\ s.t. \quad c_i = k_i, \quad i\in I$$

where $A\in R^{M\times M}$ is a large sparse semi-positive matrix, $\mathbf{c} \in R^{M \times 1}$, and $k_i$ are given constants, $I\subseteq \{1,2,\ldots,M\}$.

How to solve this quadratic constrained problem using MATLAB or CVX software effectively?

• Matlab has QuadProg. If the problem is really large you may want to consider a high-performance commercial solver such as Cplex, Gurobi or Mosek. I think they all have Matlab bindings of some sort. – Erwin Kalvelagen Oct 4 '16 at 10:29

If you simply fix the variables which you now have written as equality constraints, you can reduce the objective in the remaining free variables $\tilde{c}$ to $\tilde{c}^T\tilde{A}\tilde{c} + \tilde{b}^T\tilde{c} + f$, and the optimal solution is given by the solution to the stationarity condition $2\tilde{A}\tilde{c} + \tilde{b} = 0$, i.e., a linear system of equations. No reason to use a general solver here.
• The $\tilde{c}$ is missing in your stationarity condition: $2\tilde{A}\tilde{c}+\tilde{b} = 0$ – LinAlg Oct 4 '16 at 14:53