2
$\begingroup$

Suppose I have $n$-dimensional real vectors $\mathbf u$, $\mathbf v$, $\mathbf w$, with $\mathbf v>0$. I'd like to maximize the following function $f$:

$$ f(\mathbf x)=\sum_{i}(u_ix_i-v_ix_i^2)\quad\text{subject to}\quad g(\mathbf x)=\mathbf w^\top\mathbf x=0. $$

Normally I think this can be done with the method of Lagrange multipliers, that is, if $\mathbf z$ is the solution then there is $\lambda$ for which

$$ \nabla f(\mathbf z)=\lambda\nabla g(\mathbf z), $$

which gives the following system of $n+1$ variables in $n+1$ equations:

$$ \begin{align} u_1-2v_1z_1&=\lambda w_1\\ &\vdots\\ u_n-2v_nz_n&=\lambda w_n\\ w_1z_1+\dots+w_nz_n&=0. \end{align} $$

How do we solve this system if $n\gg0$? Say the vectors $\mathbf u,\mathbf v,\mathbf w$ can only be loaded in memory in chunks of length $N\ll n$.

Is it possible to "iteratively" compute and output the components of $\mathbf z$ without reading in the full contents of $\mathbf u,\mathbf v,\mathbf w$?

asked Sep 10, 2024 at 1:39
$\endgroup$

1 Answer 1

1
$\begingroup$

This is resolved - the solution was right in front of my eyes.

From the first $n$ equations we can express each $z_i$ in terms of the other variables. Then, applying the constraint $\mathbf w^\top\mathbf z=0$ and simplifying gives

$$ \sum\frac{w_iu_i}{2v_i}=\lambda\sum\frac{w_i^2}{2v_i}. $$

The denominators are fine since $\mathbf v>0$. Clearly both sums can be computed iteratively, which gives $\lambda$.

Then, for each $i$ we can simply compute

$$ z_i=\frac{u_i-\lambda w_i}{2v_i}. $$

answered Sep 11, 2024 at 8:11
$\endgroup$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.