Linearize or approximate a square root constraintHow to linearize the product of two binary variables?How to linearize the product of a binary and a non-negative continuous variable?How to linearize a constraint with a maximum or minimum in the right-hand-side?How to linearize the product of two continuous variables?How to decide to write an objective function?Prove that these linear programming problems are bounded by $O(k^1/2)$How to formulate maximum function in a constraint?Pricing of blends/mixtures across multiple timestepsFormulation of a constraint in a MIP for an element in different SetsHow to reformulate (linearize/convexify) a budgeted assignment problem?

What are these bugs on my milkweed?

Applications of pure mathematics in operations research

How close to the Sun would you have to be to hear it?

Should I put my name first, or last in the team members list

Is it possible for a particle to decay via gravity?

Narset, Parter of Veils interaction with Matter Reshaper

What would the United Kingdom's "optimal" Brexit deal look like?

Efficiently finding furthest two nodes in a graph

How to find parallel tangent lines

How did astronauts using rovers tell direction without compasses on the Moon?

What is this kind of symbol meant to be?

Using Python in a Bash Script

How to prevent a single-element caster from being useless against immune foes?

If the Moon were impacted by a suitably sized meteor, how long would it take to impact the Earth?

Is Ear Protection Necessary For General Aviation Airplanes?

Why don't short runways use ramps for takeoff?

Why put copper in between battery contacts and clamps?

Move arrows along a contour

Why didn't Stark and Nebula use jump points with their ship to go back to Earth?

Word for giving preference to the oldest child

How to choose using Collection<Id> rather than Collection<String>, or the opposite?

Reading electrical clamp tester higher voltage/amp 400A

How do discovery writers hibernate?

Would it take any sort of amendment to make DC a state?



Linearize or approximate a square root constraint


How to linearize the product of two binary variables?How to linearize the product of a binary and a non-negative continuous variable?How to linearize a constraint with a maximum or minimum in the right-hand-side?How to linearize the product of two continuous variables?How to decide to write an objective function?Prove that these linear programming problems are bounded by $O(k^1/2)$How to formulate maximum function in a constraint?Pricing of blends/mixtures across multiple timestepsFormulation of a constraint in a MIP for an element in different SetsHow to reformulate (linearize/convexify) a budgeted assignment problem?













16












$begingroup$


I encounter a nonlinear constraint that contains the square root of a sum of integer variables. Of course one could use nonlinear solvers and techniques; but I like linear programming. Are there any standard results on linearizing or approximating a square root of the sum of integer variables?



For example, the constraints look like this:



$sqrtsum_i in mathcalI a_ijx_ij leq theta_j, quad quad forall j in mathcalJ$,



here $x_ij in 0,1$ are binary variables, $theta_j in mathbbR$ are continuous variables, and $a_ij geq 0$ are parameters. $mathcalI$ and $mathcalJ$ are any given sets of polynomial size.



Of course, this constraint is part of a larger MIP, but as I am curious to general methods and results regarding this constraint I believe it not to be of interest to post it here.










share|improve this question











$endgroup$









  • 3




    $begingroup$
    Could you add some additional information about the constraint (maybe a simplified version)? Is the constraint convex?
    $endgroup$
    – Kevin Dalmeijer
    Jul 21 at 9:25















16












$begingroup$


I encounter a nonlinear constraint that contains the square root of a sum of integer variables. Of course one could use nonlinear solvers and techniques; but I like linear programming. Are there any standard results on linearizing or approximating a square root of the sum of integer variables?



For example, the constraints look like this:



$sqrtsum_i in mathcalI a_ijx_ij leq theta_j, quad quad forall j in mathcalJ$,



here $x_ij in 0,1$ are binary variables, $theta_j in mathbbR$ are continuous variables, and $a_ij geq 0$ are parameters. $mathcalI$ and $mathcalJ$ are any given sets of polynomial size.



Of course, this constraint is part of a larger MIP, but as I am curious to general methods and results regarding this constraint I believe it not to be of interest to post it here.










share|improve this question











$endgroup$









  • 3




    $begingroup$
    Could you add some additional information about the constraint (maybe a simplified version)? Is the constraint convex?
    $endgroup$
    – Kevin Dalmeijer
    Jul 21 at 9:25













16












16








16





$begingroup$


I encounter a nonlinear constraint that contains the square root of a sum of integer variables. Of course one could use nonlinear solvers and techniques; but I like linear programming. Are there any standard results on linearizing or approximating a square root of the sum of integer variables?



For example, the constraints look like this:



$sqrtsum_i in mathcalI a_ijx_ij leq theta_j, quad quad forall j in mathcalJ$,



here $x_ij in 0,1$ are binary variables, $theta_j in mathbbR$ are continuous variables, and $a_ij geq 0$ are parameters. $mathcalI$ and $mathcalJ$ are any given sets of polynomial size.



Of course, this constraint is part of a larger MIP, but as I am curious to general methods and results regarding this constraint I believe it not to be of interest to post it here.










share|improve this question











$endgroup$




I encounter a nonlinear constraint that contains the square root of a sum of integer variables. Of course one could use nonlinear solvers and techniques; but I like linear programming. Are there any standard results on linearizing or approximating a square root of the sum of integer variables?



For example, the constraints look like this:



$sqrtsum_i in mathcalI a_ijx_ij leq theta_j, quad quad forall j in mathcalJ$,



here $x_ij in 0,1$ are binary variables, $theta_j in mathbbR$ are continuous variables, and $a_ij geq 0$ are parameters. $mathcalI$ and $mathcalJ$ are any given sets of polynomial size.



Of course, this constraint is part of a larger MIP, but as I am curious to general methods and results regarding this constraint I believe it not to be of interest to post it here.







linear-programming nonlinear-programming






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 21 at 9:40







Albert Schrotenboer

















asked Jul 21 at 7:01









Albert SchrotenboerAlbert Schrotenboer

8922 silver badges21 bronze badges




8922 silver badges21 bronze badges










  • 3




    $begingroup$
    Could you add some additional information about the constraint (maybe a simplified version)? Is the constraint convex?
    $endgroup$
    – Kevin Dalmeijer
    Jul 21 at 9:25












  • 3




    $begingroup$
    Could you add some additional information about the constraint (maybe a simplified version)? Is the constraint convex?
    $endgroup$
    – Kevin Dalmeijer
    Jul 21 at 9:25







3




3




$begingroup$
Could you add some additional information about the constraint (maybe a simplified version)? Is the constraint convex?
$endgroup$
– Kevin Dalmeijer
Jul 21 at 9:25




$begingroup$
Could you add some additional information about the constraint (maybe a simplified version)? Is the constraint convex?
$endgroup$
– Kevin Dalmeijer
Jul 21 at 9:25










3 Answers
3






active

oldest

votes


















14












$begingroup$

This can be handled as an MISOCP, Mixed-Integer Second Order Cone problem. The leading commercial MILP solvers can also handle MISOCP.



Specifically, due to $x_ij$ being binary, $x_ij^2 = x_ij$. Therefore, the left-hand side is the two-norm of the vector over $i in I$ having elements $sqrta_ij x_ij$.



I don't know whether this is the best way to handle this constraint, but it is a way, and it is "exact".






share|improve this answer











$endgroup$










  • 3




    $begingroup$
    I agree with this answer. To add to this: if you really want to solve an LP rather than an SOCP, you can approximate the SOCP constraint with a polynomial number of LP constraints, as discussed here. AFAIK it's generally understood that solving the problem as one SOCP is faster.
    $endgroup$
    – Ryan Cory-Wright
    Jul 21 at 21:22










  • $begingroup$
    I like this answer a lot. To add: for a good reference on modeling SOCP, see this paper.
    $endgroup$
    – Kevin Dalmeijer
    Jul 21 at 22:06











  • $begingroup$
    Could you expand on where the term $x_i,j^2$ comes from. If taking squares in both sides, aren't we missing the cross terms $x_ijx_k,j$?
    $endgroup$
    – Daniel Duque
    Jul 22 at 2:31






  • 3




    $begingroup$
    @Daniel Duque If $x in 0,1$ then you can simply replace $x$ by $x^2$. This is due to the fact that $0^2 = 0$ and $1^2 = 1$ and thus $x^2 = x$ for all permitted values.
    $endgroup$
    – Kevin Dalmeijer
    Jul 22 at 9:26






  • 1




    $begingroup$
    I see now, thanks.
    $endgroup$
    – Daniel Duque
    Jul 22 at 12:04


















2












$begingroup$

Please also have a look at the very similar question in math.stackexchange. As @Mark L. Stone mentioned in his answer, all you need is a second-order cone model to solve your problem.






share|improve this answer









$endgroup$






















    2












    $begingroup$

    To linearize that constraint as it is can be hard since it is non-convex. Assuming you still want to do that, you would need to introduce binary variables that allow you characterize the function. Focusing on a single $j$, let first define $w_j=sum_Iin Ia_i,j x_i,j$, with $w_jgeq 0$ and assume you have a bound on such that $w_jleq UB_j$. Now let $n$ be the number of pieces (linear inequalities) you want to use to describe $sqrtw_j$, and for each piece, let $m_k,j$ and $b_k,j$ be the slope and intercept of the $k$th piece of the $j$th constraint for $k=1,ldots,n$, which are tangent lines of $theta_j=sqrtw_j$ at (finite) points $w_k,jin[0,UB_j]$ (these are the breakpoints in the $w_j$ space), $k=1,ldots,n+1$. Since the constraint are not convex, only one piece can be "on" in an optimal solution, hence, let $lambda_k,jin0,1$ be a binary variable that is 1 if the pice is "on" for constraint $jin J$, 0 otherwise. Putting all together,



    $sum_k=1^nlambda_k,j=1 ~forall jin J$ #Choose only one piece for crt j



    $-M(1-lambda_k,j) + w_k,jle w_j le w_k+1,j + M(1-lambda_k,j) ~ forall j in J, k=1,ldots,n$ # $w_j$ need to be in the right interval if you choose piece $k$



    $w_j = sum_Iin Ia_i,j x_i,j forall j in J$ # Definition of $w_j$



    $theta_jge m_k,j w_j + b_k,j - M(1-lambda_k,j) forall jin J, k=1,ldots,n$ # This is the linearized constraint, where $theta_j$ is greater or equal to the piece that is selected.



    As a side note, you have to choose the breakpoints upfront. A plot of $theta_jge sqrt(w_j)$ (for a single j, this a 2d-plot) can help to clarify the linearization.



    If your constraints are convex (e.g., the inequality is $ge$ or you treat it as an SOCP as described in the answer above), then you could implement Kelley's cutting-plane method which is an outer approximation method. Those cuts are not cuts in the integer programming sense, so don't add them as cuts. Rather, in B&B add them as lazy constraints. Alternatively, if the MIP is easy to solve, generate a single (kelley's) cut at a time an re-optimize.






    share|improve this answer











    $endgroup$














    • $begingroup$
      Is all this really needed? The square root function is concave, so you could just use a series of cutting planes: linearisation of square root at $sum_i a_i x_i = sth$ <= $theta_j$; with enough cutting planes, you are drawing an approximation that is good enough. (Or you can use an iterative process to add new cutting planes, to reduce the total number of constraints.) I guess that's what pubsonline.informs.org/doi/abs/10.1287/moor.26.2.193.10561 does.
      $endgroup$
      – dourouc05
      Jul 22 at 1:59











    • $begingroup$
      It is necessary due to the sense of the inequality. In the way it’s written in the question, that constraint defines a non-convex feasible region. If the inequality is the other way around, then it would be much easier as it would be a convex feasible region (ignoring the integrality of x).
      $endgroup$
      – Daniel Duque
      Jul 22 at 2:09













    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "700"
    ;
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2for.stackexchange.com%2fquestions%2f1052%2flinearize-or-approximate-a-square-root-constraint%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    14












    $begingroup$

    This can be handled as an MISOCP, Mixed-Integer Second Order Cone problem. The leading commercial MILP solvers can also handle MISOCP.



    Specifically, due to $x_ij$ being binary, $x_ij^2 = x_ij$. Therefore, the left-hand side is the two-norm of the vector over $i in I$ having elements $sqrta_ij x_ij$.



    I don't know whether this is the best way to handle this constraint, but it is a way, and it is "exact".






    share|improve this answer











    $endgroup$










    • 3




      $begingroup$
      I agree with this answer. To add to this: if you really want to solve an LP rather than an SOCP, you can approximate the SOCP constraint with a polynomial number of LP constraints, as discussed here. AFAIK it's generally understood that solving the problem as one SOCP is faster.
      $endgroup$
      – Ryan Cory-Wright
      Jul 21 at 21:22










    • $begingroup$
      I like this answer a lot. To add: for a good reference on modeling SOCP, see this paper.
      $endgroup$
      – Kevin Dalmeijer
      Jul 21 at 22:06











    • $begingroup$
      Could you expand on where the term $x_i,j^2$ comes from. If taking squares in both sides, aren't we missing the cross terms $x_ijx_k,j$?
      $endgroup$
      – Daniel Duque
      Jul 22 at 2:31






    • 3




      $begingroup$
      @Daniel Duque If $x in 0,1$ then you can simply replace $x$ by $x^2$. This is due to the fact that $0^2 = 0$ and $1^2 = 1$ and thus $x^2 = x$ for all permitted values.
      $endgroup$
      – Kevin Dalmeijer
      Jul 22 at 9:26






    • 1




      $begingroup$
      I see now, thanks.
      $endgroup$
      – Daniel Duque
      Jul 22 at 12:04















    14












    $begingroup$

    This can be handled as an MISOCP, Mixed-Integer Second Order Cone problem. The leading commercial MILP solvers can also handle MISOCP.



    Specifically, due to $x_ij$ being binary, $x_ij^2 = x_ij$. Therefore, the left-hand side is the two-norm of the vector over $i in I$ having elements $sqrta_ij x_ij$.



    I don't know whether this is the best way to handle this constraint, but it is a way, and it is "exact".






    share|improve this answer











    $endgroup$










    • 3




      $begingroup$
      I agree with this answer. To add to this: if you really want to solve an LP rather than an SOCP, you can approximate the SOCP constraint with a polynomial number of LP constraints, as discussed here. AFAIK it's generally understood that solving the problem as one SOCP is faster.
      $endgroup$
      – Ryan Cory-Wright
      Jul 21 at 21:22










    • $begingroup$
      I like this answer a lot. To add: for a good reference on modeling SOCP, see this paper.
      $endgroup$
      – Kevin Dalmeijer
      Jul 21 at 22:06











    • $begingroup$
      Could you expand on where the term $x_i,j^2$ comes from. If taking squares in both sides, aren't we missing the cross terms $x_ijx_k,j$?
      $endgroup$
      – Daniel Duque
      Jul 22 at 2:31






    • 3




      $begingroup$
      @Daniel Duque If $x in 0,1$ then you can simply replace $x$ by $x^2$. This is due to the fact that $0^2 = 0$ and $1^2 = 1$ and thus $x^2 = x$ for all permitted values.
      $endgroup$
      – Kevin Dalmeijer
      Jul 22 at 9:26






    • 1




      $begingroup$
      I see now, thanks.
      $endgroup$
      – Daniel Duque
      Jul 22 at 12:04













    14












    14








    14





    $begingroup$

    This can be handled as an MISOCP, Mixed-Integer Second Order Cone problem. The leading commercial MILP solvers can also handle MISOCP.



    Specifically, due to $x_ij$ being binary, $x_ij^2 = x_ij$. Therefore, the left-hand side is the two-norm of the vector over $i in I$ having elements $sqrta_ij x_ij$.



    I don't know whether this is the best way to handle this constraint, but it is a way, and it is "exact".






    share|improve this answer











    $endgroup$



    This can be handled as an MISOCP, Mixed-Integer Second Order Cone problem. The leading commercial MILP solvers can also handle MISOCP.



    Specifically, due to $x_ij$ being binary, $x_ij^2 = x_ij$. Therefore, the left-hand side is the two-norm of the vector over $i in I$ having elements $sqrta_ij x_ij$.



    I don't know whether this is the best way to handle this constraint, but it is a way, and it is "exact".







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jul 21 at 15:21









    prubin

    2,2113 silver badges19 bronze badges




    2,2113 silver badges19 bronze badges










    answered Jul 21 at 10:44









    Mark L. StoneMark L. Stone

    2,7876 silver badges26 bronze badges




    2,7876 silver badges26 bronze badges










    • 3




      $begingroup$
      I agree with this answer. To add to this: if you really want to solve an LP rather than an SOCP, you can approximate the SOCP constraint with a polynomial number of LP constraints, as discussed here. AFAIK it's generally understood that solving the problem as one SOCP is faster.
      $endgroup$
      – Ryan Cory-Wright
      Jul 21 at 21:22










    • $begingroup$
      I like this answer a lot. To add: for a good reference on modeling SOCP, see this paper.
      $endgroup$
      – Kevin Dalmeijer
      Jul 21 at 22:06











    • $begingroup$
      Could you expand on where the term $x_i,j^2$ comes from. If taking squares in both sides, aren't we missing the cross terms $x_ijx_k,j$?
      $endgroup$
      – Daniel Duque
      Jul 22 at 2:31






    • 3




      $begingroup$
      @Daniel Duque If $x in 0,1$ then you can simply replace $x$ by $x^2$. This is due to the fact that $0^2 = 0$ and $1^2 = 1$ and thus $x^2 = x$ for all permitted values.
      $endgroup$
      – Kevin Dalmeijer
      Jul 22 at 9:26






    • 1




      $begingroup$
      I see now, thanks.
      $endgroup$
      – Daniel Duque
      Jul 22 at 12:04












    • 3




      $begingroup$
      I agree with this answer. To add to this: if you really want to solve an LP rather than an SOCP, you can approximate the SOCP constraint with a polynomial number of LP constraints, as discussed here. AFAIK it's generally understood that solving the problem as one SOCP is faster.
      $endgroup$
      – Ryan Cory-Wright
      Jul 21 at 21:22










    • $begingroup$
      I like this answer a lot. To add: for a good reference on modeling SOCP, see this paper.
      $endgroup$
      – Kevin Dalmeijer
      Jul 21 at 22:06











    • $begingroup$
      Could you expand on where the term $x_i,j^2$ comes from. If taking squares in both sides, aren't we missing the cross terms $x_ijx_k,j$?
      $endgroup$
      – Daniel Duque
      Jul 22 at 2:31






    • 3




      $begingroup$
      @Daniel Duque If $x in 0,1$ then you can simply replace $x$ by $x^2$. This is due to the fact that $0^2 = 0$ and $1^2 = 1$ and thus $x^2 = x$ for all permitted values.
      $endgroup$
      – Kevin Dalmeijer
      Jul 22 at 9:26






    • 1




      $begingroup$
      I see now, thanks.
      $endgroup$
      – Daniel Duque
      Jul 22 at 12:04







    3




    3




    $begingroup$
    I agree with this answer. To add to this: if you really want to solve an LP rather than an SOCP, you can approximate the SOCP constraint with a polynomial number of LP constraints, as discussed here. AFAIK it's generally understood that solving the problem as one SOCP is faster.
    $endgroup$
    – Ryan Cory-Wright
    Jul 21 at 21:22




    $begingroup$
    I agree with this answer. To add to this: if you really want to solve an LP rather than an SOCP, you can approximate the SOCP constraint with a polynomial number of LP constraints, as discussed here. AFAIK it's generally understood that solving the problem as one SOCP is faster.
    $endgroup$
    – Ryan Cory-Wright
    Jul 21 at 21:22












    $begingroup$
    I like this answer a lot. To add: for a good reference on modeling SOCP, see this paper.
    $endgroup$
    – Kevin Dalmeijer
    Jul 21 at 22:06





    $begingroup$
    I like this answer a lot. To add: for a good reference on modeling SOCP, see this paper.
    $endgroup$
    – Kevin Dalmeijer
    Jul 21 at 22:06













    $begingroup$
    Could you expand on where the term $x_i,j^2$ comes from. If taking squares in both sides, aren't we missing the cross terms $x_ijx_k,j$?
    $endgroup$
    – Daniel Duque
    Jul 22 at 2:31




    $begingroup$
    Could you expand on where the term $x_i,j^2$ comes from. If taking squares in both sides, aren't we missing the cross terms $x_ijx_k,j$?
    $endgroup$
    – Daniel Duque
    Jul 22 at 2:31




    3




    3




    $begingroup$
    @Daniel Duque If $x in 0,1$ then you can simply replace $x$ by $x^2$. This is due to the fact that $0^2 = 0$ and $1^2 = 1$ and thus $x^2 = x$ for all permitted values.
    $endgroup$
    – Kevin Dalmeijer
    Jul 22 at 9:26




    $begingroup$
    @Daniel Duque If $x in 0,1$ then you can simply replace $x$ by $x^2$. This is due to the fact that $0^2 = 0$ and $1^2 = 1$ and thus $x^2 = x$ for all permitted values.
    $endgroup$
    – Kevin Dalmeijer
    Jul 22 at 9:26




    1




    1




    $begingroup$
    I see now, thanks.
    $endgroup$
    – Daniel Duque
    Jul 22 at 12:04




    $begingroup$
    I see now, thanks.
    $endgroup$
    – Daniel Duque
    Jul 22 at 12:04











    2












    $begingroup$

    Please also have a look at the very similar question in math.stackexchange. As @Mark L. Stone mentioned in his answer, all you need is a second-order cone model to solve your problem.






    share|improve this answer









    $endgroup$



















      2












      $begingroup$

      Please also have a look at the very similar question in math.stackexchange. As @Mark L. Stone mentioned in his answer, all you need is a second-order cone model to solve your problem.






      share|improve this answer









      $endgroup$

















        2












        2








        2





        $begingroup$

        Please also have a look at the very similar question in math.stackexchange. As @Mark L. Stone mentioned in his answer, all you need is a second-order cone model to solve your problem.






        share|improve this answer









        $endgroup$



        Please also have a look at the very similar question in math.stackexchange. As @Mark L. Stone mentioned in his answer, all you need is a second-order cone model to solve your problem.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 21 at 16:19









        Oguz ToragayOguz Toragay

        1,3141 silver badge17 bronze badges




        1,3141 silver badge17 bronze badges
























            2












            $begingroup$

            To linearize that constraint as it is can be hard since it is non-convex. Assuming you still want to do that, you would need to introduce binary variables that allow you characterize the function. Focusing on a single $j$, let first define $w_j=sum_Iin Ia_i,j x_i,j$, with $w_jgeq 0$ and assume you have a bound on such that $w_jleq UB_j$. Now let $n$ be the number of pieces (linear inequalities) you want to use to describe $sqrtw_j$, and for each piece, let $m_k,j$ and $b_k,j$ be the slope and intercept of the $k$th piece of the $j$th constraint for $k=1,ldots,n$, which are tangent lines of $theta_j=sqrtw_j$ at (finite) points $w_k,jin[0,UB_j]$ (these are the breakpoints in the $w_j$ space), $k=1,ldots,n+1$. Since the constraint are not convex, only one piece can be "on" in an optimal solution, hence, let $lambda_k,jin0,1$ be a binary variable that is 1 if the pice is "on" for constraint $jin J$, 0 otherwise. Putting all together,



            $sum_k=1^nlambda_k,j=1 ~forall jin J$ #Choose only one piece for crt j



            $-M(1-lambda_k,j) + w_k,jle w_j le w_k+1,j + M(1-lambda_k,j) ~ forall j in J, k=1,ldots,n$ # $w_j$ need to be in the right interval if you choose piece $k$



            $w_j = sum_Iin Ia_i,j x_i,j forall j in J$ # Definition of $w_j$



            $theta_jge m_k,j w_j + b_k,j - M(1-lambda_k,j) forall jin J, k=1,ldots,n$ # This is the linearized constraint, where $theta_j$ is greater or equal to the piece that is selected.



            As a side note, you have to choose the breakpoints upfront. A plot of $theta_jge sqrt(w_j)$ (for a single j, this a 2d-plot) can help to clarify the linearization.



            If your constraints are convex (e.g., the inequality is $ge$ or you treat it as an SOCP as described in the answer above), then you could implement Kelley's cutting-plane method which is an outer approximation method. Those cuts are not cuts in the integer programming sense, so don't add them as cuts. Rather, in B&B add them as lazy constraints. Alternatively, if the MIP is easy to solve, generate a single (kelley's) cut at a time an re-optimize.






            share|improve this answer











            $endgroup$














            • $begingroup$
              Is all this really needed? The square root function is concave, so you could just use a series of cutting planes: linearisation of square root at $sum_i a_i x_i = sth$ <= $theta_j$; with enough cutting planes, you are drawing an approximation that is good enough. (Or you can use an iterative process to add new cutting planes, to reduce the total number of constraints.) I guess that's what pubsonline.informs.org/doi/abs/10.1287/moor.26.2.193.10561 does.
              $endgroup$
              – dourouc05
              Jul 22 at 1:59











            • $begingroup$
              It is necessary due to the sense of the inequality. In the way it’s written in the question, that constraint defines a non-convex feasible region. If the inequality is the other way around, then it would be much easier as it would be a convex feasible region (ignoring the integrality of x).
              $endgroup$
              – Daniel Duque
              Jul 22 at 2:09















            2












            $begingroup$

            To linearize that constraint as it is can be hard since it is non-convex. Assuming you still want to do that, you would need to introduce binary variables that allow you characterize the function. Focusing on a single $j$, let first define $w_j=sum_Iin Ia_i,j x_i,j$, with $w_jgeq 0$ and assume you have a bound on such that $w_jleq UB_j$. Now let $n$ be the number of pieces (linear inequalities) you want to use to describe $sqrtw_j$, and for each piece, let $m_k,j$ and $b_k,j$ be the slope and intercept of the $k$th piece of the $j$th constraint for $k=1,ldots,n$, which are tangent lines of $theta_j=sqrtw_j$ at (finite) points $w_k,jin[0,UB_j]$ (these are the breakpoints in the $w_j$ space), $k=1,ldots,n+1$. Since the constraint are not convex, only one piece can be "on" in an optimal solution, hence, let $lambda_k,jin0,1$ be a binary variable that is 1 if the pice is "on" for constraint $jin J$, 0 otherwise. Putting all together,



            $sum_k=1^nlambda_k,j=1 ~forall jin J$ #Choose only one piece for crt j



            $-M(1-lambda_k,j) + w_k,jle w_j le w_k+1,j + M(1-lambda_k,j) ~ forall j in J, k=1,ldots,n$ # $w_j$ need to be in the right interval if you choose piece $k$



            $w_j = sum_Iin Ia_i,j x_i,j forall j in J$ # Definition of $w_j$



            $theta_jge m_k,j w_j + b_k,j - M(1-lambda_k,j) forall jin J, k=1,ldots,n$ # This is the linearized constraint, where $theta_j$ is greater or equal to the piece that is selected.



            As a side note, you have to choose the breakpoints upfront. A plot of $theta_jge sqrt(w_j)$ (for a single j, this a 2d-plot) can help to clarify the linearization.



            If your constraints are convex (e.g., the inequality is $ge$ or you treat it as an SOCP as described in the answer above), then you could implement Kelley's cutting-plane method which is an outer approximation method. Those cuts are not cuts in the integer programming sense, so don't add them as cuts. Rather, in B&B add them as lazy constraints. Alternatively, if the MIP is easy to solve, generate a single (kelley's) cut at a time an re-optimize.






            share|improve this answer











            $endgroup$














            • $begingroup$
              Is all this really needed? The square root function is concave, so you could just use a series of cutting planes: linearisation of square root at $sum_i a_i x_i = sth$ <= $theta_j$; with enough cutting planes, you are drawing an approximation that is good enough. (Or you can use an iterative process to add new cutting planes, to reduce the total number of constraints.) I guess that's what pubsonline.informs.org/doi/abs/10.1287/moor.26.2.193.10561 does.
              $endgroup$
              – dourouc05
              Jul 22 at 1:59











            • $begingroup$
              It is necessary due to the sense of the inequality. In the way it’s written in the question, that constraint defines a non-convex feasible region. If the inequality is the other way around, then it would be much easier as it would be a convex feasible region (ignoring the integrality of x).
              $endgroup$
              – Daniel Duque
              Jul 22 at 2:09













            2












            2








            2





            $begingroup$

            To linearize that constraint as it is can be hard since it is non-convex. Assuming you still want to do that, you would need to introduce binary variables that allow you characterize the function. Focusing on a single $j$, let first define $w_j=sum_Iin Ia_i,j x_i,j$, with $w_jgeq 0$ and assume you have a bound on such that $w_jleq UB_j$. Now let $n$ be the number of pieces (linear inequalities) you want to use to describe $sqrtw_j$, and for each piece, let $m_k,j$ and $b_k,j$ be the slope and intercept of the $k$th piece of the $j$th constraint for $k=1,ldots,n$, which are tangent lines of $theta_j=sqrtw_j$ at (finite) points $w_k,jin[0,UB_j]$ (these are the breakpoints in the $w_j$ space), $k=1,ldots,n+1$. Since the constraint are not convex, only one piece can be "on" in an optimal solution, hence, let $lambda_k,jin0,1$ be a binary variable that is 1 if the pice is "on" for constraint $jin J$, 0 otherwise. Putting all together,



            $sum_k=1^nlambda_k,j=1 ~forall jin J$ #Choose only one piece for crt j



            $-M(1-lambda_k,j) + w_k,jle w_j le w_k+1,j + M(1-lambda_k,j) ~ forall j in J, k=1,ldots,n$ # $w_j$ need to be in the right interval if you choose piece $k$



            $w_j = sum_Iin Ia_i,j x_i,j forall j in J$ # Definition of $w_j$



            $theta_jge m_k,j w_j + b_k,j - M(1-lambda_k,j) forall jin J, k=1,ldots,n$ # This is the linearized constraint, where $theta_j$ is greater or equal to the piece that is selected.



            As a side note, you have to choose the breakpoints upfront. A plot of $theta_jge sqrt(w_j)$ (for a single j, this a 2d-plot) can help to clarify the linearization.



            If your constraints are convex (e.g., the inequality is $ge$ or you treat it as an SOCP as described in the answer above), then you could implement Kelley's cutting-plane method which is an outer approximation method. Those cuts are not cuts in the integer programming sense, so don't add them as cuts. Rather, in B&B add them as lazy constraints. Alternatively, if the MIP is easy to solve, generate a single (kelley's) cut at a time an re-optimize.






            share|improve this answer











            $endgroup$



            To linearize that constraint as it is can be hard since it is non-convex. Assuming you still want to do that, you would need to introduce binary variables that allow you characterize the function. Focusing on a single $j$, let first define $w_j=sum_Iin Ia_i,j x_i,j$, with $w_jgeq 0$ and assume you have a bound on such that $w_jleq UB_j$. Now let $n$ be the number of pieces (linear inequalities) you want to use to describe $sqrtw_j$, and for each piece, let $m_k,j$ and $b_k,j$ be the slope and intercept of the $k$th piece of the $j$th constraint for $k=1,ldots,n$, which are tangent lines of $theta_j=sqrtw_j$ at (finite) points $w_k,jin[0,UB_j]$ (these are the breakpoints in the $w_j$ space), $k=1,ldots,n+1$. Since the constraint are not convex, only one piece can be "on" in an optimal solution, hence, let $lambda_k,jin0,1$ be a binary variable that is 1 if the pice is "on" for constraint $jin J$, 0 otherwise. Putting all together,



            $sum_k=1^nlambda_k,j=1 ~forall jin J$ #Choose only one piece for crt j



            $-M(1-lambda_k,j) + w_k,jle w_j le w_k+1,j + M(1-lambda_k,j) ~ forall j in J, k=1,ldots,n$ # $w_j$ need to be in the right interval if you choose piece $k$



            $w_j = sum_Iin Ia_i,j x_i,j forall j in J$ # Definition of $w_j$



            $theta_jge m_k,j w_j + b_k,j - M(1-lambda_k,j) forall jin J, k=1,ldots,n$ # This is the linearized constraint, where $theta_j$ is greater or equal to the piece that is selected.



            As a side note, you have to choose the breakpoints upfront. A plot of $theta_jge sqrt(w_j)$ (for a single j, this a 2d-plot) can help to clarify the linearization.



            If your constraints are convex (e.g., the inequality is $ge$ or you treat it as an SOCP as described in the answer above), then you could implement Kelley's cutting-plane method which is an outer approximation method. Those cuts are not cuts in the integer programming sense, so don't add them as cuts. Rather, in B&B add them as lazy constraints. Alternatively, if the MIP is easy to solve, generate a single (kelley's) cut at a time an re-optimize.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jul 22 at 13:41

























            answered Jul 21 at 17:36









            Daniel DuqueDaniel Duque

            69511 bronze badges




            69511 bronze badges














            • $begingroup$
              Is all this really needed? The square root function is concave, so you could just use a series of cutting planes: linearisation of square root at $sum_i a_i x_i = sth$ <= $theta_j$; with enough cutting planes, you are drawing an approximation that is good enough. (Or you can use an iterative process to add new cutting planes, to reduce the total number of constraints.) I guess that's what pubsonline.informs.org/doi/abs/10.1287/moor.26.2.193.10561 does.
              $endgroup$
              – dourouc05
              Jul 22 at 1:59











            • $begingroup$
              It is necessary due to the sense of the inequality. In the way it’s written in the question, that constraint defines a non-convex feasible region. If the inequality is the other way around, then it would be much easier as it would be a convex feasible region (ignoring the integrality of x).
              $endgroup$
              – Daniel Duque
              Jul 22 at 2:09
















            • $begingroup$
              Is all this really needed? The square root function is concave, so you could just use a series of cutting planes: linearisation of square root at $sum_i a_i x_i = sth$ <= $theta_j$; with enough cutting planes, you are drawing an approximation that is good enough. (Or you can use an iterative process to add new cutting planes, to reduce the total number of constraints.) I guess that's what pubsonline.informs.org/doi/abs/10.1287/moor.26.2.193.10561 does.
              $endgroup$
              – dourouc05
              Jul 22 at 1:59











            • $begingroup$
              It is necessary due to the sense of the inequality. In the way it’s written in the question, that constraint defines a non-convex feasible region. If the inequality is the other way around, then it would be much easier as it would be a convex feasible region (ignoring the integrality of x).
              $endgroup$
              – Daniel Duque
              Jul 22 at 2:09















            $begingroup$
            Is all this really needed? The square root function is concave, so you could just use a series of cutting planes: linearisation of square root at $sum_i a_i x_i = sth$ <= $theta_j$; with enough cutting planes, you are drawing an approximation that is good enough. (Or you can use an iterative process to add new cutting planes, to reduce the total number of constraints.) I guess that's what pubsonline.informs.org/doi/abs/10.1287/moor.26.2.193.10561 does.
            $endgroup$
            – dourouc05
            Jul 22 at 1:59





            $begingroup$
            Is all this really needed? The square root function is concave, so you could just use a series of cutting planes: linearisation of square root at $sum_i a_i x_i = sth$ <= $theta_j$; with enough cutting planes, you are drawing an approximation that is good enough. (Or you can use an iterative process to add new cutting planes, to reduce the total number of constraints.) I guess that's what pubsonline.informs.org/doi/abs/10.1287/moor.26.2.193.10561 does.
            $endgroup$
            – dourouc05
            Jul 22 at 1:59













            $begingroup$
            It is necessary due to the sense of the inequality. In the way it’s written in the question, that constraint defines a non-convex feasible region. If the inequality is the other way around, then it would be much easier as it would be a convex feasible region (ignoring the integrality of x).
            $endgroup$
            – Daniel Duque
            Jul 22 at 2:09




            $begingroup$
            It is necessary due to the sense of the inequality. In the way it’s written in the question, that constraint defines a non-convex feasible region. If the inequality is the other way around, then it would be much easier as it would be a convex feasible region (ignoring the integrality of x).
            $endgroup$
            – Daniel Duque
            Jul 22 at 2:09

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Operations Research 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%2for.stackexchange.com%2fquestions%2f1052%2flinearize-or-approximate-a-square-root-constraint%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

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form