Explanation of a convex quadratic programMinimize a complex quadratic subject to two convex quadratic constraintsMaximize Trace as standard semidefinite optimizationLinear programming with non-convex quadratic constraintQuadratic Program ReformulationHow to determine the optimal step size in a quadratic function optimizationComputational complexity of the following quadratic program (QP)quadratic programming positive semidefinite matrix proofConvex matrix optimization with a linear constraint on the inverseQuadratic program reformulation maximum to minimumDoes this special case of convex quadratic programming have a partially-unique solution?

Does the attack bonus from a Masterwork weapon stack with the attack bonus from Masterwork ammunition?

Brake pads destroying wheels

Matrix using tikz package

What is the significance behind "40 days" that often appears in the Bible?

I got the following comment from a reputed math journal. What does it mean?

Why is indicated airspeed rather than ground speed used during the takeoff roll?

How to get the n-th line after a grepped one?

What is the term when voters “dishonestly” choose something that they do not want to choose?

Should I use acronyms in dialogues before telling the readers what it stands for in fiction?

Wrapping homogeneous Python objects

Probably overheated black color SMD pads

What does Deadpool mean by "left the house in that shirt"?

Recruiter wants very extensive technical details about all of my previous work

Do I need to be arrogant to get ahead?

If "dar" means "to give", what does "daros" mean?

Are dual Irish/British citizens bound by the 90/180 day rule when travelling in the EU after Brexit?

Variable completely messes up echoed string

Why didn't Héctor fade away after this character died in the movie Coco?

Is there a hypothetical scenario that would make Earth uninhabitable for humans, but not for (the majority of) other animals?

What (if any) is the reason to buy in small local stores?

My friend is being a hypocrite

Turning a hard to access nut?

How does 取材で訪れた integrate into this sentence?

Deletion of copy-ctor & copy-assignment - public, private or protected?



Explanation of a convex quadratic program


Minimize a complex quadratic subject to two convex quadratic constraintsMaximize Trace as standard semidefinite optimizationLinear programming with non-convex quadratic constraintQuadratic Program ReformulationHow to determine the optimal step size in a quadratic function optimizationComputational complexity of the following quadratic program (QP)quadratic programming positive semidefinite matrix proofConvex matrix optimization with a linear constraint on the inverseQuadratic program reformulation maximum to minimumDoes this special case of convex quadratic programming have a partially-unique solution?













1












$begingroup$


I want to find the minimum of the following optimization problem but don't even understand the problem in the first place.



$$minlimits_AX=bfrac12X^TQX+C^TX+alpha$$



where $Q, A in M_n times n (BbbR)$, $X, b, C in BbbR^n$ and $alpha in BbbR$. Also, matrix $Q$ is symmetric and positive definite.



This is all I have about the problem. So, can anyone please, explain the problem to me? Thanks for your time.










share|cite|improve this question











$endgroup$







  • 1




    $begingroup$
    This kind of optimization problem is called a quadratic program.
    $endgroup$
    – David M.
    Mar 9 at 7:07










  • $begingroup$
    Do you know anything about the matrix Q? Is it positive semidefinite, or is it something else?
    $endgroup$
    – Alex Shtof
    Mar 9 at 11:10










  • $begingroup$
    @Alex Shtof: Yes, it is positive definite and symmetric.
    $endgroup$
    – Omojola Micheal
    Mar 9 at 12:29















1












$begingroup$


I want to find the minimum of the following optimization problem but don't even understand the problem in the first place.



$$minlimits_AX=bfrac12X^TQX+C^TX+alpha$$



where $Q, A in M_n times n (BbbR)$, $X, b, C in BbbR^n$ and $alpha in BbbR$. Also, matrix $Q$ is symmetric and positive definite.



This is all I have about the problem. So, can anyone please, explain the problem to me? Thanks for your time.










share|cite|improve this question











$endgroup$







  • 1




    $begingroup$
    This kind of optimization problem is called a quadratic program.
    $endgroup$
    – David M.
    Mar 9 at 7:07










  • $begingroup$
    Do you know anything about the matrix Q? Is it positive semidefinite, or is it something else?
    $endgroup$
    – Alex Shtof
    Mar 9 at 11:10










  • $begingroup$
    @Alex Shtof: Yes, it is positive definite and symmetric.
    $endgroup$
    – Omojola Micheal
    Mar 9 at 12:29













1












1








1


1



$begingroup$


I want to find the minimum of the following optimization problem but don't even understand the problem in the first place.



$$minlimits_AX=bfrac12X^TQX+C^TX+alpha$$



where $Q, A in M_n times n (BbbR)$, $X, b, C in BbbR^n$ and $alpha in BbbR$. Also, matrix $Q$ is symmetric and positive definite.



This is all I have about the problem. So, can anyone please, explain the problem to me? Thanks for your time.










share|cite|improve this question











$endgroup$




I want to find the minimum of the following optimization problem but don't even understand the problem in the first place.



$$minlimits_AX=bfrac12X^TQX+C^TX+alpha$$



where $Q, A in M_n times n (BbbR)$, $X, b, C in BbbR^n$ and $alpha in BbbR$. Also, matrix $Q$ is symmetric and positive definite.



This is all I have about the problem. So, can anyone please, explain the problem to me? Thanks for your time.







optimization definition convex-optimization quadratic-programming






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 12 at 19:19









David M.

2,003418




2,003418










asked Mar 9 at 7:04









Omojola MichealOmojola Micheal

1,971324




1,971324







  • 1




    $begingroup$
    This kind of optimization problem is called a quadratic program.
    $endgroup$
    – David M.
    Mar 9 at 7:07










  • $begingroup$
    Do you know anything about the matrix Q? Is it positive semidefinite, or is it something else?
    $endgroup$
    – Alex Shtof
    Mar 9 at 11:10










  • $begingroup$
    @Alex Shtof: Yes, it is positive definite and symmetric.
    $endgroup$
    – Omojola Micheal
    Mar 9 at 12:29












  • 1




    $begingroup$
    This kind of optimization problem is called a quadratic program.
    $endgroup$
    – David M.
    Mar 9 at 7:07










  • $begingroup$
    Do you know anything about the matrix Q? Is it positive semidefinite, or is it something else?
    $endgroup$
    – Alex Shtof
    Mar 9 at 11:10










  • $begingroup$
    @Alex Shtof: Yes, it is positive definite and symmetric.
    $endgroup$
    – Omojola Micheal
    Mar 9 at 12:29







1




1




$begingroup$
This kind of optimization problem is called a quadratic program.
$endgroup$
– David M.
Mar 9 at 7:07




$begingroup$
This kind of optimization problem is called a quadratic program.
$endgroup$
– David M.
Mar 9 at 7:07












$begingroup$
Do you know anything about the matrix Q? Is it positive semidefinite, or is it something else?
$endgroup$
– Alex Shtof
Mar 9 at 11:10




$begingroup$
Do you know anything about the matrix Q? Is it positive semidefinite, or is it something else?
$endgroup$
– Alex Shtof
Mar 9 at 11:10












$begingroup$
@Alex Shtof: Yes, it is positive definite and symmetric.
$endgroup$
– Omojola Micheal
Mar 9 at 12:29




$begingroup$
@Alex Shtof: Yes, it is positive definite and symmetric.
$endgroup$
– Omojola Micheal
Mar 9 at 12:29










2 Answers
2






active

oldest

votes


















2












$begingroup$

You are given two fixed $n times n$ matrices $Q$ and $A$, two fixed n-dimensional vectors $B$ and $C$, and a fixed real number $alpha$. You are supposed to miminimize the value of the objective function $f(X)=tfrac12 X^T Q X + B^T X + alpha$ by varying $X$, subject to the constraint $AX=B$.



So, if we define $S = X in mathbbR^n : AX=B$, then you need to find $bar X in S$ Such that $f(bar X) le f(X)$ for all $X in S$.



So, this is a quadratic programming problem with a set of linear equality constraints.






share|cite|improve this answer











$endgroup$












  • $begingroup$
    +1. Thanks for the answer. So, is there a natural way I can solve this problem?
    $endgroup$
    – Omojola Micheal
    Mar 9 at 7:41






  • 1




    $begingroup$
    Look up Lagrange multipliers. Or, presumably your course material tells you how to solve such problems, otherwise it's an inappropriate homework problem.
    $endgroup$
    – bubba
    Mar 9 at 7:49










  • $begingroup$
    Thanks, I now know what Theorem to apply. However, how do I show that $S$ is bounded? I have shown it is closed.
    $endgroup$
    – Omojola Micheal
    Mar 9 at 8:05











  • $begingroup$
    I don't think that $S$ is bounded, in general.
    $endgroup$
    – bubba
    Mar 9 at 11:47


















2












$begingroup$

You were already provided an accepted answer, but I will still attempt to provide more information. I assume that $A in mathbbR^m times n$ where $m < n$, that is, the set $S = X in mathbbR^n : A X = B $ is infinite (otherwise, the problem is trivial). Note, that the set $S$ is affine, and therefore convex.



First, observe that since $Q$ is positive definite, the quadratic objective function is coercive, and therefore a minimizer exists. Since it is strictly convex (the Hessian is $2Q$, which is positive definite), the minimizer is unique.



Now, you have several strategies. The first one, is feeding your problem into any Quadratic Programming solver software like the first answer suggests, and it will give you the (unique) solution. The major drawback of this approach is that such solvers are not always fast. But if it is good enough for you, you do not need to do anything else. Below are two other strategies.



Via KKT conditions



The convex programming problem you seek to solve trivially satisfies Slater's condition, since there are no inequality constraints. Thus, any point is optimal if and only if it satisfies the KKT conditions.



In your case, the Lagrangian is
$$L(X; lambda) = X^T Q X + C^T X + alpha + lambda^T (A X - B),$$
and therefore the KKT conditions are
$$
2 Q X + C + A^T lambda = 0, quad A X = B,
$$

or equivalently written
$$
beginbmatrix 2 Q & A^T \ A & 0 endbmatrix beginbmatrix X \ lambda endbmatrix = beginbmatrix -C \ B endbmatrix.
$$

This is a linear system of equations. Any solution of this system using your favorite linear solver gives you an optimal solution of your desired optimization problem. If you can exploit the special structure of $Q$ or $A$ to solve it quickly, you can solve the optimization problem quickly.



By constraint elimination



Recall, that any rectangular matrix $V$ with more rows than columns admists a QR decomposition into $V = Q R$, where $Q$ is orthogonal and $R$ is upper-triangular. There are also plenty of numerical libraries which can compute it. Since you already used the name $Q$, I will rename your $Q$ matrix into $P$.



By computing the decomposition of $A^T$, you have $A^T = Q R$, and the problem becomes
$$
min_X X^T P X + C^T X + alpha quad texts.t. quad R^T Q^T X = B
$$

Substituting $Q^T X = Y$, or $X = Q Y$ (since $Q$ is orthogonal), we obtain
$$
min_Y Y^T (Q^T P Q) Y + (Q^T C) Y + alpha quad texts.t. quad R^T X = B
$$

Finally, $R$ is upper triangular. Meaning that it has the following structure
$$
R = beginbmatrix tildeR \ 0 endbmatrix,
$$

where $tildeR$ is upper triangular and invertible, which is followed by rows full of zeros. Therefore, by decomposing $Y = beginbmatrixY_1 \ Y_2 endbmatrix$, where $Y_1$ are the components which correspond to the columns of $tildeR$, the constraint $R^T Y = B$ can be written as $tildeR^T Y_1 = B$. You can solve this system, find the value of $Y_1$, substitute it into the objective, and obtain an unconstrained problem with $Y_1$, which can be solved any off-the-shelf least-squares solver.



This approach is useful if you need to solve many problems which various matrices $P$, but all share the same matrix $A$. Moreover, it is useful if the dimension of the remaining variable $Y_2$ is much smaller than the dimension of $X$. Constraint elimination allows you to reduce the dimension of the given problem substantially in that case.






share|cite|improve this answer











$endgroup$












    Your Answer





    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3140869%2fexplanation-of-a-convex-quadratic-program%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2












    $begingroup$

    You are given two fixed $n times n$ matrices $Q$ and $A$, two fixed n-dimensional vectors $B$ and $C$, and a fixed real number $alpha$. You are supposed to miminimize the value of the objective function $f(X)=tfrac12 X^T Q X + B^T X + alpha$ by varying $X$, subject to the constraint $AX=B$.



    So, if we define $S = X in mathbbR^n : AX=B$, then you need to find $bar X in S$ Such that $f(bar X) le f(X)$ for all $X in S$.



    So, this is a quadratic programming problem with a set of linear equality constraints.






    share|cite|improve this answer











    $endgroup$












    • $begingroup$
      +1. Thanks for the answer. So, is there a natural way I can solve this problem?
      $endgroup$
      – Omojola Micheal
      Mar 9 at 7:41






    • 1




      $begingroup$
      Look up Lagrange multipliers. Or, presumably your course material tells you how to solve such problems, otherwise it's an inappropriate homework problem.
      $endgroup$
      – bubba
      Mar 9 at 7:49










    • $begingroup$
      Thanks, I now know what Theorem to apply. However, how do I show that $S$ is bounded? I have shown it is closed.
      $endgroup$
      – Omojola Micheal
      Mar 9 at 8:05











    • $begingroup$
      I don't think that $S$ is bounded, in general.
      $endgroup$
      – bubba
      Mar 9 at 11:47















    2












    $begingroup$

    You are given two fixed $n times n$ matrices $Q$ and $A$, two fixed n-dimensional vectors $B$ and $C$, and a fixed real number $alpha$. You are supposed to miminimize the value of the objective function $f(X)=tfrac12 X^T Q X + B^T X + alpha$ by varying $X$, subject to the constraint $AX=B$.



    So, if we define $S = X in mathbbR^n : AX=B$, then you need to find $bar X in S$ Such that $f(bar X) le f(X)$ for all $X in S$.



    So, this is a quadratic programming problem with a set of linear equality constraints.






    share|cite|improve this answer











    $endgroup$












    • $begingroup$
      +1. Thanks for the answer. So, is there a natural way I can solve this problem?
      $endgroup$
      – Omojola Micheal
      Mar 9 at 7:41






    • 1




      $begingroup$
      Look up Lagrange multipliers. Or, presumably your course material tells you how to solve such problems, otherwise it's an inappropriate homework problem.
      $endgroup$
      – bubba
      Mar 9 at 7:49










    • $begingroup$
      Thanks, I now know what Theorem to apply. However, how do I show that $S$ is bounded? I have shown it is closed.
      $endgroup$
      – Omojola Micheal
      Mar 9 at 8:05











    • $begingroup$
      I don't think that $S$ is bounded, in general.
      $endgroup$
      – bubba
      Mar 9 at 11:47













    2












    2








    2





    $begingroup$

    You are given two fixed $n times n$ matrices $Q$ and $A$, two fixed n-dimensional vectors $B$ and $C$, and a fixed real number $alpha$. You are supposed to miminimize the value of the objective function $f(X)=tfrac12 X^T Q X + B^T X + alpha$ by varying $X$, subject to the constraint $AX=B$.



    So, if we define $S = X in mathbbR^n : AX=B$, then you need to find $bar X in S$ Such that $f(bar X) le f(X)$ for all $X in S$.



    So, this is a quadratic programming problem with a set of linear equality constraints.






    share|cite|improve this answer











    $endgroup$



    You are given two fixed $n times n$ matrices $Q$ and $A$, two fixed n-dimensional vectors $B$ and $C$, and a fixed real number $alpha$. You are supposed to miminimize the value of the objective function $f(X)=tfrac12 X^T Q X + B^T X + alpha$ by varying $X$, subject to the constraint $AX=B$.



    So, if we define $S = X in mathbbR^n : AX=B$, then you need to find $bar X in S$ Such that $f(bar X) le f(X)$ for all $X in S$.



    So, this is a quadratic programming problem with a set of linear equality constraints.







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Mar 9 at 7:47

























    answered Mar 9 at 7:39









    bubbabubba

    30.7k33188




    30.7k33188











    • $begingroup$
      +1. Thanks for the answer. So, is there a natural way I can solve this problem?
      $endgroup$
      – Omojola Micheal
      Mar 9 at 7:41






    • 1




      $begingroup$
      Look up Lagrange multipliers. Or, presumably your course material tells you how to solve such problems, otherwise it's an inappropriate homework problem.
      $endgroup$
      – bubba
      Mar 9 at 7:49










    • $begingroup$
      Thanks, I now know what Theorem to apply. However, how do I show that $S$ is bounded? I have shown it is closed.
      $endgroup$
      – Omojola Micheal
      Mar 9 at 8:05











    • $begingroup$
      I don't think that $S$ is bounded, in general.
      $endgroup$
      – bubba
      Mar 9 at 11:47
















    • $begingroup$
      +1. Thanks for the answer. So, is there a natural way I can solve this problem?
      $endgroup$
      – Omojola Micheal
      Mar 9 at 7:41






    • 1




      $begingroup$
      Look up Lagrange multipliers. Or, presumably your course material tells you how to solve such problems, otherwise it's an inappropriate homework problem.
      $endgroup$
      – bubba
      Mar 9 at 7:49










    • $begingroup$
      Thanks, I now know what Theorem to apply. However, how do I show that $S$ is bounded? I have shown it is closed.
      $endgroup$
      – Omojola Micheal
      Mar 9 at 8:05











    • $begingroup$
      I don't think that $S$ is bounded, in general.
      $endgroup$
      – bubba
      Mar 9 at 11:47















    $begingroup$
    +1. Thanks for the answer. So, is there a natural way I can solve this problem?
    $endgroup$
    – Omojola Micheal
    Mar 9 at 7:41




    $begingroup$
    +1. Thanks for the answer. So, is there a natural way I can solve this problem?
    $endgroup$
    – Omojola Micheal
    Mar 9 at 7:41




    1




    1




    $begingroup$
    Look up Lagrange multipliers. Or, presumably your course material tells you how to solve such problems, otherwise it's an inappropriate homework problem.
    $endgroup$
    – bubba
    Mar 9 at 7:49




    $begingroup$
    Look up Lagrange multipliers. Or, presumably your course material tells you how to solve such problems, otherwise it's an inappropriate homework problem.
    $endgroup$
    – bubba
    Mar 9 at 7:49












    $begingroup$
    Thanks, I now know what Theorem to apply. However, how do I show that $S$ is bounded? I have shown it is closed.
    $endgroup$
    – Omojola Micheal
    Mar 9 at 8:05





    $begingroup$
    Thanks, I now know what Theorem to apply. However, how do I show that $S$ is bounded? I have shown it is closed.
    $endgroup$
    – Omojola Micheal
    Mar 9 at 8:05













    $begingroup$
    I don't think that $S$ is bounded, in general.
    $endgroup$
    – bubba
    Mar 9 at 11:47




    $begingroup$
    I don't think that $S$ is bounded, in general.
    $endgroup$
    – bubba
    Mar 9 at 11:47











    2












    $begingroup$

    You were already provided an accepted answer, but I will still attempt to provide more information. I assume that $A in mathbbR^m times n$ where $m < n$, that is, the set $S = X in mathbbR^n : A X = B $ is infinite (otherwise, the problem is trivial). Note, that the set $S$ is affine, and therefore convex.



    First, observe that since $Q$ is positive definite, the quadratic objective function is coercive, and therefore a minimizer exists. Since it is strictly convex (the Hessian is $2Q$, which is positive definite), the minimizer is unique.



    Now, you have several strategies. The first one, is feeding your problem into any Quadratic Programming solver software like the first answer suggests, and it will give you the (unique) solution. The major drawback of this approach is that such solvers are not always fast. But if it is good enough for you, you do not need to do anything else. Below are two other strategies.



    Via KKT conditions



    The convex programming problem you seek to solve trivially satisfies Slater's condition, since there are no inequality constraints. Thus, any point is optimal if and only if it satisfies the KKT conditions.



    In your case, the Lagrangian is
    $$L(X; lambda) = X^T Q X + C^T X + alpha + lambda^T (A X - B),$$
    and therefore the KKT conditions are
    $$
    2 Q X + C + A^T lambda = 0, quad A X = B,
    $$

    or equivalently written
    $$
    beginbmatrix 2 Q & A^T \ A & 0 endbmatrix beginbmatrix X \ lambda endbmatrix = beginbmatrix -C \ B endbmatrix.
    $$

    This is a linear system of equations. Any solution of this system using your favorite linear solver gives you an optimal solution of your desired optimization problem. If you can exploit the special structure of $Q$ or $A$ to solve it quickly, you can solve the optimization problem quickly.



    By constraint elimination



    Recall, that any rectangular matrix $V$ with more rows than columns admists a QR decomposition into $V = Q R$, where $Q$ is orthogonal and $R$ is upper-triangular. There are also plenty of numerical libraries which can compute it. Since you already used the name $Q$, I will rename your $Q$ matrix into $P$.



    By computing the decomposition of $A^T$, you have $A^T = Q R$, and the problem becomes
    $$
    min_X X^T P X + C^T X + alpha quad texts.t. quad R^T Q^T X = B
    $$

    Substituting $Q^T X = Y$, or $X = Q Y$ (since $Q$ is orthogonal), we obtain
    $$
    min_Y Y^T (Q^T P Q) Y + (Q^T C) Y + alpha quad texts.t. quad R^T X = B
    $$

    Finally, $R$ is upper triangular. Meaning that it has the following structure
    $$
    R = beginbmatrix tildeR \ 0 endbmatrix,
    $$

    where $tildeR$ is upper triangular and invertible, which is followed by rows full of zeros. Therefore, by decomposing $Y = beginbmatrixY_1 \ Y_2 endbmatrix$, where $Y_1$ are the components which correspond to the columns of $tildeR$, the constraint $R^T Y = B$ can be written as $tildeR^T Y_1 = B$. You can solve this system, find the value of $Y_1$, substitute it into the objective, and obtain an unconstrained problem with $Y_1$, which can be solved any off-the-shelf least-squares solver.



    This approach is useful if you need to solve many problems which various matrices $P$, but all share the same matrix $A$. Moreover, it is useful if the dimension of the remaining variable $Y_2$ is much smaller than the dimension of $X$. Constraint elimination allows you to reduce the dimension of the given problem substantially in that case.






    share|cite|improve this answer











    $endgroup$

















      2












      $begingroup$

      You were already provided an accepted answer, but I will still attempt to provide more information. I assume that $A in mathbbR^m times n$ where $m < n$, that is, the set $S = X in mathbbR^n : A X = B $ is infinite (otherwise, the problem is trivial). Note, that the set $S$ is affine, and therefore convex.



      First, observe that since $Q$ is positive definite, the quadratic objective function is coercive, and therefore a minimizer exists. Since it is strictly convex (the Hessian is $2Q$, which is positive definite), the minimizer is unique.



      Now, you have several strategies. The first one, is feeding your problem into any Quadratic Programming solver software like the first answer suggests, and it will give you the (unique) solution. The major drawback of this approach is that such solvers are not always fast. But if it is good enough for you, you do not need to do anything else. Below are two other strategies.



      Via KKT conditions



      The convex programming problem you seek to solve trivially satisfies Slater's condition, since there are no inequality constraints. Thus, any point is optimal if and only if it satisfies the KKT conditions.



      In your case, the Lagrangian is
      $$L(X; lambda) = X^T Q X + C^T X + alpha + lambda^T (A X - B),$$
      and therefore the KKT conditions are
      $$
      2 Q X + C + A^T lambda = 0, quad A X = B,
      $$

      or equivalently written
      $$
      beginbmatrix 2 Q & A^T \ A & 0 endbmatrix beginbmatrix X \ lambda endbmatrix = beginbmatrix -C \ B endbmatrix.
      $$

      This is a linear system of equations. Any solution of this system using your favorite linear solver gives you an optimal solution of your desired optimization problem. If you can exploit the special structure of $Q$ or $A$ to solve it quickly, you can solve the optimization problem quickly.



      By constraint elimination



      Recall, that any rectangular matrix $V$ with more rows than columns admists a QR decomposition into $V = Q R$, where $Q$ is orthogonal and $R$ is upper-triangular. There are also plenty of numerical libraries which can compute it. Since you already used the name $Q$, I will rename your $Q$ matrix into $P$.



      By computing the decomposition of $A^T$, you have $A^T = Q R$, and the problem becomes
      $$
      min_X X^T P X + C^T X + alpha quad texts.t. quad R^T Q^T X = B
      $$

      Substituting $Q^T X = Y$, or $X = Q Y$ (since $Q$ is orthogonal), we obtain
      $$
      min_Y Y^T (Q^T P Q) Y + (Q^T C) Y + alpha quad texts.t. quad R^T X = B
      $$

      Finally, $R$ is upper triangular. Meaning that it has the following structure
      $$
      R = beginbmatrix tildeR \ 0 endbmatrix,
      $$

      where $tildeR$ is upper triangular and invertible, which is followed by rows full of zeros. Therefore, by decomposing $Y = beginbmatrixY_1 \ Y_2 endbmatrix$, where $Y_1$ are the components which correspond to the columns of $tildeR$, the constraint $R^T Y = B$ can be written as $tildeR^T Y_1 = B$. You can solve this system, find the value of $Y_1$, substitute it into the objective, and obtain an unconstrained problem with $Y_1$, which can be solved any off-the-shelf least-squares solver.



      This approach is useful if you need to solve many problems which various matrices $P$, but all share the same matrix $A$. Moreover, it is useful if the dimension of the remaining variable $Y_2$ is much smaller than the dimension of $X$. Constraint elimination allows you to reduce the dimension of the given problem substantially in that case.






      share|cite|improve this answer











      $endgroup$















        2












        2








        2





        $begingroup$

        You were already provided an accepted answer, but I will still attempt to provide more information. I assume that $A in mathbbR^m times n$ where $m < n$, that is, the set $S = X in mathbbR^n : A X = B $ is infinite (otherwise, the problem is trivial). Note, that the set $S$ is affine, and therefore convex.



        First, observe that since $Q$ is positive definite, the quadratic objective function is coercive, and therefore a minimizer exists. Since it is strictly convex (the Hessian is $2Q$, which is positive definite), the minimizer is unique.



        Now, you have several strategies. The first one, is feeding your problem into any Quadratic Programming solver software like the first answer suggests, and it will give you the (unique) solution. The major drawback of this approach is that such solvers are not always fast. But if it is good enough for you, you do not need to do anything else. Below are two other strategies.



        Via KKT conditions



        The convex programming problem you seek to solve trivially satisfies Slater's condition, since there are no inequality constraints. Thus, any point is optimal if and only if it satisfies the KKT conditions.



        In your case, the Lagrangian is
        $$L(X; lambda) = X^T Q X + C^T X + alpha + lambda^T (A X - B),$$
        and therefore the KKT conditions are
        $$
        2 Q X + C + A^T lambda = 0, quad A X = B,
        $$

        or equivalently written
        $$
        beginbmatrix 2 Q & A^T \ A & 0 endbmatrix beginbmatrix X \ lambda endbmatrix = beginbmatrix -C \ B endbmatrix.
        $$

        This is a linear system of equations. Any solution of this system using your favorite linear solver gives you an optimal solution of your desired optimization problem. If you can exploit the special structure of $Q$ or $A$ to solve it quickly, you can solve the optimization problem quickly.



        By constraint elimination



        Recall, that any rectangular matrix $V$ with more rows than columns admists a QR decomposition into $V = Q R$, where $Q$ is orthogonal and $R$ is upper-triangular. There are also plenty of numerical libraries which can compute it. Since you already used the name $Q$, I will rename your $Q$ matrix into $P$.



        By computing the decomposition of $A^T$, you have $A^T = Q R$, and the problem becomes
        $$
        min_X X^T P X + C^T X + alpha quad texts.t. quad R^T Q^T X = B
        $$

        Substituting $Q^T X = Y$, or $X = Q Y$ (since $Q$ is orthogonal), we obtain
        $$
        min_Y Y^T (Q^T P Q) Y + (Q^T C) Y + alpha quad texts.t. quad R^T X = B
        $$

        Finally, $R$ is upper triangular. Meaning that it has the following structure
        $$
        R = beginbmatrix tildeR \ 0 endbmatrix,
        $$

        where $tildeR$ is upper triangular and invertible, which is followed by rows full of zeros. Therefore, by decomposing $Y = beginbmatrixY_1 \ Y_2 endbmatrix$, where $Y_1$ are the components which correspond to the columns of $tildeR$, the constraint $R^T Y = B$ can be written as $tildeR^T Y_1 = B$. You can solve this system, find the value of $Y_1$, substitute it into the objective, and obtain an unconstrained problem with $Y_1$, which can be solved any off-the-shelf least-squares solver.



        This approach is useful if you need to solve many problems which various matrices $P$, but all share the same matrix $A$. Moreover, it is useful if the dimension of the remaining variable $Y_2$ is much smaller than the dimension of $X$. Constraint elimination allows you to reduce the dimension of the given problem substantially in that case.






        share|cite|improve this answer











        $endgroup$



        You were already provided an accepted answer, but I will still attempt to provide more information. I assume that $A in mathbbR^m times n$ where $m < n$, that is, the set $S = X in mathbbR^n : A X = B $ is infinite (otherwise, the problem is trivial). Note, that the set $S$ is affine, and therefore convex.



        First, observe that since $Q$ is positive definite, the quadratic objective function is coercive, and therefore a minimizer exists. Since it is strictly convex (the Hessian is $2Q$, which is positive definite), the minimizer is unique.



        Now, you have several strategies. The first one, is feeding your problem into any Quadratic Programming solver software like the first answer suggests, and it will give you the (unique) solution. The major drawback of this approach is that such solvers are not always fast. But if it is good enough for you, you do not need to do anything else. Below are two other strategies.



        Via KKT conditions



        The convex programming problem you seek to solve trivially satisfies Slater's condition, since there are no inequality constraints. Thus, any point is optimal if and only if it satisfies the KKT conditions.



        In your case, the Lagrangian is
        $$L(X; lambda) = X^T Q X + C^T X + alpha + lambda^T (A X - B),$$
        and therefore the KKT conditions are
        $$
        2 Q X + C + A^T lambda = 0, quad A X = B,
        $$

        or equivalently written
        $$
        beginbmatrix 2 Q & A^T \ A & 0 endbmatrix beginbmatrix X \ lambda endbmatrix = beginbmatrix -C \ B endbmatrix.
        $$

        This is a linear system of equations. Any solution of this system using your favorite linear solver gives you an optimal solution of your desired optimization problem. If you can exploit the special structure of $Q$ or $A$ to solve it quickly, you can solve the optimization problem quickly.



        By constraint elimination



        Recall, that any rectangular matrix $V$ with more rows than columns admists a QR decomposition into $V = Q R$, where $Q$ is orthogonal and $R$ is upper-triangular. There are also plenty of numerical libraries which can compute it. Since you already used the name $Q$, I will rename your $Q$ matrix into $P$.



        By computing the decomposition of $A^T$, you have $A^T = Q R$, and the problem becomes
        $$
        min_X X^T P X + C^T X + alpha quad texts.t. quad R^T Q^T X = B
        $$

        Substituting $Q^T X = Y$, or $X = Q Y$ (since $Q$ is orthogonal), we obtain
        $$
        min_Y Y^T (Q^T P Q) Y + (Q^T C) Y + alpha quad texts.t. quad R^T X = B
        $$

        Finally, $R$ is upper triangular. Meaning that it has the following structure
        $$
        R = beginbmatrix tildeR \ 0 endbmatrix,
        $$

        where $tildeR$ is upper triangular and invertible, which is followed by rows full of zeros. Therefore, by decomposing $Y = beginbmatrixY_1 \ Y_2 endbmatrix$, where $Y_1$ are the components which correspond to the columns of $tildeR$, the constraint $R^T Y = B$ can be written as $tildeR^T Y_1 = B$. You can solve this system, find the value of $Y_1$, substitute it into the objective, and obtain an unconstrained problem with $Y_1$, which can be solved any off-the-shelf least-squares solver.



        This approach is useful if you need to solve many problems which various matrices $P$, but all share the same matrix $A$. Moreover, it is useful if the dimension of the remaining variable $Y_2$ is much smaller than the dimension of $X$. Constraint elimination allows you to reduce the dimension of the given problem substantially in that case.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Mar 13 at 11:16

























        answered Mar 10 at 11:52









        Alex ShtofAlex Shtof

        604516




        604516



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3140869%2fexplanation-of-a-convex-quadratic-program%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Lowndes Grove History Architecture References Navigation menu32°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661132°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661178002500"National Register Information System"Historic houses of South Carolina"Lowndes Grove""+32° 48' 6.00", −79° 57' 58.00""Lowndes Grove, Charleston County (260 St. Margaret St., Charleston)""Lowndes Grove"The Charleston ExpositionIt Happened in South Carolina"Lowndes Grove (House), Saint Margaret Street & Sixth Avenue, Charleston, Charleston County, SC(Photographs)"Plantations of the Carolina Low Countrye

            random experiment with two different functions on unit interval Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Random variable and probability space notionsRandom Walk with EdgesFinding functions where the increase over a random interval is Poisson distributedNumber of days until dayCan an observed event in fact be of zero probability?Unit random processmodels of coins and uniform distributionHow to get the number of successes given $n$ trials , probability $P$ and a random variable $X$Absorbing Markov chain in a computer. Is “almost every” turned into always convergence in computer executions?Stopped random walk is not uniformly integrable

            How should I support this large drywall patch? Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How do I cover large gaps in drywall?How do I keep drywall around a patch from crumbling?Can I glue a second layer of drywall?How to patch long strip on drywall?Large drywall patch: how to avoid bulging seams?Drywall Mesh Patch vs. Bulge? To remove or not to remove?How to fix this drywall job?Prep drywall before backsplashWhat's the best way to fix this horrible drywall patch job?Drywall patching using 3M Patch Plus Primer