5

I want to solve the following optimization problem with respect to $\mathsf{x} = (x_1, \ldots, x_n)^\top$ $$ \min_{\mathbf{x}} \,\, \mathbf{x}^\top A \mathbf{x} \qquad\qquad\text{such that }\,\, x_i \geq 0 \,\, \forall \, i=1, \ldots, n \text{ and } \sum_{i=1}^n x_i = 1. $$ Minimizing a quadratic form subject to the conditions that all entries of $x$ are non-negative and they sum up to one.

I am interested both in analytical or numerical solutions.

  1. Are there analytical solutions?
  2. If not, how could I solve this in Python? I tried using cvxpy.quad_over_lin but unsuccessfully

Note: I am also happy with a numerical method that does not guarantee convergence, but somehow guarantees to find a better solution than guessing.

Royi
  • 10,050
Euler_Salter
  • 5,547
  • Are there any constraints on A? If it's positive semidefinite, then you can use cvx quad_form (minimize(quad_form(x,A)). I'm not sure it's convex otherwise, but I haven't looked into it – Leo Apr 10 '24 at 00:44

1 Answers1

0

One easy way is to use the Projected Gradient Descent:

  • The Gradient: $\nabla f \left( \boldsymbol{x} \right) = \boldsymbol{A} \boldsymbol{x} + \boldsymbol{A}^{T} \boldsymbol{x}$.
  • The Projection: ${P}_{\mathcal{C}} \left( \boldsymbol{x} \right)$. See Projection onto the Unit Simplex Ball.

The iteration is given by:

$$ \boldsymbol{x}^{k + 1} \leftarrow {P}_{\mathcal{C}} \left( \boldsymbol{x}^{k} - \mu \nabla f \left( \boldsymbol{x}^{k} \right) \right) $$

Where $\mu$ is the step size.

In case $\boldsymbol{A} \in \mathcal{S}_{+}^{n}$ (Symmetric Positive Semi Definite) the problem is Convex and the method will converge to a global minimum. Otherwise it will only converge onto a local minimum.

I am pretty sure that it can be also solved geometrically for the case the matrix is SPSD.

Royi
  • 10,050