linearization of objective functionHow to linearize the product of a binary and a non-negative continuous...

Is Illustrator accurate for business card sizes?

Backpacking with incontinence

Could flaps be raised upward to serve as spoilers / lift dumpers?

Misrepresentation on DS-160

Can an alphabet for a Turing machine contain subsets of other alphabets?

How do people drown while wearing a life jacket?

Why did the United States not resort to nuclear weapons in Vietnam?

Why are sugars in whole fruits not digested the same way sugars in juice are?

Overprovisioning SSD on ubuntu. How? Ubuntu 19.04 Samsung SSD 860

Export economy of Mars

linearization of objective function

In Haskell, when using the XStrict language extension, is if short-circuiting?

speaker impedence

What is the most 'environmentally friendly' way to learn to fly?

Word for pulling a punch in karate

Applying for mortgage when living together but only one will be on the mortgage

Ernie and the Superconducting Boxes

Map vs. Table for index-specific operations on 2D arrays

Should I take up a Creative Writing online course?

Who's behind community AMIs on Amazon EC2?

Went to a big 4 but got fired for underperformance in a year recently - Now every one thinks I'm pro - How to balance expectations?

Why are prop blades not shaped like household fan blades?

Why interlaced CRT scanning wasn't done back and forth?

How is Sword Coast North governed?



linearization of objective function


How to linearize the product of a binary and a non-negative continuous variable?Simplest way to eliminate redundant constraints due to a new cutVariable bounds in column generationHow to formulate maximum function in a constraint?Is my approach to my internship project good? Optimal allocation of product across stores, constrained optimizationQA techniques for optimization problem codingFormulation of a constraint in a MIP for an element in different SetsHow to formulate this scheduling problem efficiently?How to reformulate (linearize/convexify) a budgeted assignment problem?Linearize or approximate a square root constraintFinding minimum time for vehicle to reach to its destination













4












$begingroup$


$src_{h,s}$, $dst_{h,s}$, $ch_{h,s}$ are constants.



$a_{h,s}$, $x_{i,j,s}$ are binary variables.



$wt_{h,s}$ are continuous variables.



$mini.$
$$
sum_{h in H} sum_{s in S} (src_{h,s} + ch_{h,s} + dst_{h,s} + wt_{h,s}) times a_{h,s}
$$



$s.t.$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm} forall s in S hspace{0.3cm}
$$

$$
wt_{j,s} geq ((src_{i,s} + ch_{i,s}+wt_{i,s}) - src_{j,s}) times x_{i,j,s}
$$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm}
x_{ij} + x_{ji} leq 1
$$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm} forall s in S hspace{0.3cm}
$$

$$
x_{ij} + x_{ji} geq a_{i,s} + a_{j,s} + 1
$$



$$
forall h in H sum_{s in S} b_{h,s} leq 1
$$



I want to use a LP solver on this problem but there are continuous variable $wt_{h,s}$ and Boolean variable $a_{h,s}$ together in objective function, how to separate them.



I have found a link for linearization in constraints, (https://www.leandro-coelho.com/linearization-product-variables/) but how to linearize in objective function.



Also in first constraint there are two continuous variable $wt_{j,s}$ and $wt_{i,s}$, is it possible to linearize it.










share|improve this question











$endgroup$










  • 1




    $begingroup$
    Linearize the objective function the same way you would a constraint. Having two continuous variables in the first constraint doesn't add any complications because one of these variable appears "by itself", i.e., not multiplied by another variable, and therefore that variable already appears linearly.
    $endgroup$
    – Mark L. Stone
    8 hours ago






  • 1




    $begingroup$
    Maybe take a look at this question: How to linearize the product of a binary and a non-negative continuous variable?
    $endgroup$
    – EhsanK
    6 hours ago










  • $begingroup$
    Is this $$ sum_{h in H} sum_{s in S} (src_{h,s} + ch_{h,s} + dst_{h,s} ) times a_{h,s} + ( wt_{h,s} - (1 - a_{h,s}) times infty ) $$ correct linearization of objective function, but what about the bounds.
    $endgroup$
    – anoop yadav
    6 hours ago


















4












$begingroup$


$src_{h,s}$, $dst_{h,s}$, $ch_{h,s}$ are constants.



$a_{h,s}$, $x_{i,j,s}$ are binary variables.



$wt_{h,s}$ are continuous variables.



$mini.$
$$
sum_{h in H} sum_{s in S} (src_{h,s} + ch_{h,s} + dst_{h,s} + wt_{h,s}) times a_{h,s}
$$



$s.t.$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm} forall s in S hspace{0.3cm}
$$

$$
wt_{j,s} geq ((src_{i,s} + ch_{i,s}+wt_{i,s}) - src_{j,s}) times x_{i,j,s}
$$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm}
x_{ij} + x_{ji} leq 1
$$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm} forall s in S hspace{0.3cm}
$$

$$
x_{ij} + x_{ji} geq a_{i,s} + a_{j,s} + 1
$$



$$
forall h in H sum_{s in S} b_{h,s} leq 1
$$



I want to use a LP solver on this problem but there are continuous variable $wt_{h,s}$ and Boolean variable $a_{h,s}$ together in objective function, how to separate them.



I have found a link for linearization in constraints, (https://www.leandro-coelho.com/linearization-product-variables/) but how to linearize in objective function.



Also in first constraint there are two continuous variable $wt_{j,s}$ and $wt_{i,s}$, is it possible to linearize it.










share|improve this question











$endgroup$










  • 1




    $begingroup$
    Linearize the objective function the same way you would a constraint. Having two continuous variables in the first constraint doesn't add any complications because one of these variable appears "by itself", i.e., not multiplied by another variable, and therefore that variable already appears linearly.
    $endgroup$
    – Mark L. Stone
    8 hours ago






  • 1




    $begingroup$
    Maybe take a look at this question: How to linearize the product of a binary and a non-negative continuous variable?
    $endgroup$
    – EhsanK
    6 hours ago










  • $begingroup$
    Is this $$ sum_{h in H} sum_{s in S} (src_{h,s} + ch_{h,s} + dst_{h,s} ) times a_{h,s} + ( wt_{h,s} - (1 - a_{h,s}) times infty ) $$ correct linearization of objective function, but what about the bounds.
    $endgroup$
    – anoop yadav
    6 hours ago
















4












4








4





$begingroup$


$src_{h,s}$, $dst_{h,s}$, $ch_{h,s}$ are constants.



$a_{h,s}$, $x_{i,j,s}$ are binary variables.



$wt_{h,s}$ are continuous variables.



$mini.$
$$
sum_{h in H} sum_{s in S} (src_{h,s} + ch_{h,s} + dst_{h,s} + wt_{h,s}) times a_{h,s}
$$



$s.t.$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm} forall s in S hspace{0.3cm}
$$

$$
wt_{j,s} geq ((src_{i,s} + ch_{i,s}+wt_{i,s}) - src_{j,s}) times x_{i,j,s}
$$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm}
x_{ij} + x_{ji} leq 1
$$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm} forall s in S hspace{0.3cm}
$$

$$
x_{ij} + x_{ji} geq a_{i,s} + a_{j,s} + 1
$$



$$
forall h in H sum_{s in S} b_{h,s} leq 1
$$



I want to use a LP solver on this problem but there are continuous variable $wt_{h,s}$ and Boolean variable $a_{h,s}$ together in objective function, how to separate them.



I have found a link for linearization in constraints, (https://www.leandro-coelho.com/linearization-product-variables/) but how to linearize in objective function.



Also in first constraint there are two continuous variable $wt_{j,s}$ and $wt_{i,s}$, is it possible to linearize it.










share|improve this question











$endgroup$




$src_{h,s}$, $dst_{h,s}$, $ch_{h,s}$ are constants.



$a_{h,s}$, $x_{i,j,s}$ are binary variables.



$wt_{h,s}$ are continuous variables.



$mini.$
$$
sum_{h in H} sum_{s in S} (src_{h,s} + ch_{h,s} + dst_{h,s} + wt_{h,s}) times a_{h,s}
$$



$s.t.$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm} forall s in S hspace{0.3cm}
$$

$$
wt_{j,s} geq ((src_{i,s} + ch_{i,s}+wt_{i,s}) - src_{j,s}) times x_{i,j,s}
$$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm}
x_{ij} + x_{ji} leq 1
$$



$$
forall i in H hspace{0.3cm} forall j in H hspace{0.3cm} forall s in S hspace{0.3cm}
$$

$$
x_{ij} + x_{ji} geq a_{i,s} + a_{j,s} + 1
$$



$$
forall h in H sum_{s in S} b_{h,s} leq 1
$$



I want to use a LP solver on this problem but there are continuous variable $wt_{h,s}$ and Boolean variable $a_{h,s}$ together in objective function, how to separate them.



I have found a link for linearization in constraints, (https://www.leandro-coelho.com/linearization-product-variables/) but how to linearize in objective function.



Also in first constraint there are two continuous variable $wt_{j,s}$ and $wt_{i,s}$, is it possible to linearize it.







linear-programming optimization linearization






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 6 hours ago









Simon

4471 silver badge12 bronze badges




4471 silver badge12 bronze badges










asked 8 hours ago









anoop yadavanoop yadav

1084 bronze badges




1084 bronze badges











  • 1




    $begingroup$
    Linearize the objective function the same way you would a constraint. Having two continuous variables in the first constraint doesn't add any complications because one of these variable appears "by itself", i.e., not multiplied by another variable, and therefore that variable already appears linearly.
    $endgroup$
    – Mark L. Stone
    8 hours ago






  • 1




    $begingroup$
    Maybe take a look at this question: How to linearize the product of a binary and a non-negative continuous variable?
    $endgroup$
    – EhsanK
    6 hours ago










  • $begingroup$
    Is this $$ sum_{h in H} sum_{s in S} (src_{h,s} + ch_{h,s} + dst_{h,s} ) times a_{h,s} + ( wt_{h,s} - (1 - a_{h,s}) times infty ) $$ correct linearization of objective function, but what about the bounds.
    $endgroup$
    – anoop yadav
    6 hours ago
















  • 1




    $begingroup$
    Linearize the objective function the same way you would a constraint. Having two continuous variables in the first constraint doesn't add any complications because one of these variable appears "by itself", i.e., not multiplied by another variable, and therefore that variable already appears linearly.
    $endgroup$
    – Mark L. Stone
    8 hours ago






  • 1




    $begingroup$
    Maybe take a look at this question: How to linearize the product of a binary and a non-negative continuous variable?
    $endgroup$
    – EhsanK
    6 hours ago










  • $begingroup$
    Is this $$ sum_{h in H} sum_{s in S} (src_{h,s} + ch_{h,s} + dst_{h,s} ) times a_{h,s} + ( wt_{h,s} - (1 - a_{h,s}) times infty ) $$ correct linearization of objective function, but what about the bounds.
    $endgroup$
    – anoop yadav
    6 hours ago










1




1




$begingroup$
Linearize the objective function the same way you would a constraint. Having two continuous variables in the first constraint doesn't add any complications because one of these variable appears "by itself", i.e., not multiplied by another variable, and therefore that variable already appears linearly.
$endgroup$
– Mark L. Stone
8 hours ago




$begingroup$
Linearize the objective function the same way you would a constraint. Having two continuous variables in the first constraint doesn't add any complications because one of these variable appears "by itself", i.e., not multiplied by another variable, and therefore that variable already appears linearly.
$endgroup$
– Mark L. Stone
8 hours ago




1




1




$begingroup$
Maybe take a look at this question: How to linearize the product of a binary and a non-negative continuous variable?
$endgroup$
– EhsanK
6 hours ago




$begingroup$
Maybe take a look at this question: How to linearize the product of a binary and a non-negative continuous variable?
$endgroup$
– EhsanK
6 hours ago












$begingroup$
Is this $$ sum_{h in H} sum_{s in S} (src_{h,s} + ch_{h,s} + dst_{h,s} ) times a_{h,s} + ( wt_{h,s} - (1 - a_{h,s}) times infty ) $$ correct linearization of objective function, but what about the bounds.
$endgroup$
– anoop yadav
6 hours ago






$begingroup$
Is this $$ sum_{h in H} sum_{s in S} (src_{h,s} + ch_{h,s} + dst_{h,s} ) times a_{h,s} + ( wt_{h,s} - (1 - a_{h,s}) times infty ) $$ correct linearization of objective function, but what about the bounds.
$endgroup$
– anoop yadav
6 hours ago












2 Answers
2






active

oldest

votes


















5












$begingroup$

Piecewise linearization methods have been widely applied to convert a nonlinear programming problem into a linear programming problem or a mixed-integer convex programming problem for obtaining an approximated global optimal solution. In the transformation process, extra binary variables, continuous variables, and constraints are introduced to reformulate the original problem. These extra variables and constraints mainly determine the solution efficiency of the converted problem.[source]






share|improve this answer









$endgroup$























    2












    $begingroup$


    1. Add some additional continuous variables $s_{h,s}$ to your model and use those variables in the objective, instead of the products.



    2. Add the following constraints for each $s_{h,s}$:





      • This constraint ensures that $s_{h,s}$ is at most equal to the sum:



        $s_{h,s} leq src_{h,s}+ch_{h,s}+dst_{h,s}+wt_{h,s}$




      • This constraint ensures that $s_{h,s}$ will be at least the sum when $a_{h,s}=1$:



        $s_{h,s} geq src_{h,s}+ch_{h,s}+dst_{h,s}+wt_{h,s} - M times (1 - a_{h,s}) $




      • This constraints ensures that $s_{h,s}=0$ when $a_{h,s}=0$:



        $s_{h,s} leq M times a_{h,s} $






    Some notes about this:




    • I assumed that your constants and variables are all nonnegative.

    • You should pick small values for the constant $M$ to make it all work (e.g. $src_{h,s}+ch_{h,s}+dst_{h,s}+UB(wt_{h,s})$). Picking much larger values leads to lower performance and might even introduce numerical problems.

    • If your solver of choice supports indicator constraints, you could also formulate it using those.






    share|improve this answer









    $endgroup$


















      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%2f1146%2flinearization-of-objective-function%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









      5












      $begingroup$

      Piecewise linearization methods have been widely applied to convert a nonlinear programming problem into a linear programming problem or a mixed-integer convex programming problem for obtaining an approximated global optimal solution. In the transformation process, extra binary variables, continuous variables, and constraints are introduced to reformulate the original problem. These extra variables and constraints mainly determine the solution efficiency of the converted problem.[source]






      share|improve this answer









      $endgroup$




















        5












        $begingroup$

        Piecewise linearization methods have been widely applied to convert a nonlinear programming problem into a linear programming problem or a mixed-integer convex programming problem for obtaining an approximated global optimal solution. In the transformation process, extra binary variables, continuous variables, and constraints are introduced to reformulate the original problem. These extra variables and constraints mainly determine the solution efficiency of the converted problem.[source]






        share|improve this answer









        $endgroup$


















          5












          5








          5





          $begingroup$

          Piecewise linearization methods have been widely applied to convert a nonlinear programming problem into a linear programming problem or a mixed-integer convex programming problem for obtaining an approximated global optimal solution. In the transformation process, extra binary variables, continuous variables, and constraints are introduced to reformulate the original problem. These extra variables and constraints mainly determine the solution efficiency of the converted problem.[source]






          share|improve this answer









          $endgroup$



          Piecewise linearization methods have been widely applied to convert a nonlinear programming problem into a linear programming problem or a mixed-integer convex programming problem for obtaining an approximated global optimal solution. In the transformation process, extra binary variables, continuous variables, and constraints are introduced to reformulate the original problem. These extra variables and constraints mainly determine the solution efficiency of the converted problem.[source]







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 7 hours ago









          Oguz ToragayOguz Toragay

          1,5691 silver badge20 bronze badges




          1,5691 silver badge20 bronze badges


























              2












              $begingroup$


              1. Add some additional continuous variables $s_{h,s}$ to your model and use those variables in the objective, instead of the products.



              2. Add the following constraints for each $s_{h,s}$:





                • This constraint ensures that $s_{h,s}$ is at most equal to the sum:



                  $s_{h,s} leq src_{h,s}+ch_{h,s}+dst_{h,s}+wt_{h,s}$




                • This constraint ensures that $s_{h,s}$ will be at least the sum when $a_{h,s}=1$:



                  $s_{h,s} geq src_{h,s}+ch_{h,s}+dst_{h,s}+wt_{h,s} - M times (1 - a_{h,s}) $




                • This constraints ensures that $s_{h,s}=0$ when $a_{h,s}=0$:



                  $s_{h,s} leq M times a_{h,s} $






              Some notes about this:




              • I assumed that your constants and variables are all nonnegative.

              • You should pick small values for the constant $M$ to make it all work (e.g. $src_{h,s}+ch_{h,s}+dst_{h,s}+UB(wt_{h,s})$). Picking much larger values leads to lower performance and might even introduce numerical problems.

              • If your solver of choice supports indicator constraints, you could also formulate it using those.






              share|improve this answer









              $endgroup$




















                2












                $begingroup$


                1. Add some additional continuous variables $s_{h,s}$ to your model and use those variables in the objective, instead of the products.



                2. Add the following constraints for each $s_{h,s}$:





                  • This constraint ensures that $s_{h,s}$ is at most equal to the sum:



                    $s_{h,s} leq src_{h,s}+ch_{h,s}+dst_{h,s}+wt_{h,s}$




                  • This constraint ensures that $s_{h,s}$ will be at least the sum when $a_{h,s}=1$:



                    $s_{h,s} geq src_{h,s}+ch_{h,s}+dst_{h,s}+wt_{h,s} - M times (1 - a_{h,s}) $




                  • This constraints ensures that $s_{h,s}=0$ when $a_{h,s}=0$:



                    $s_{h,s} leq M times a_{h,s} $






                Some notes about this:




                • I assumed that your constants and variables are all nonnegative.

                • You should pick small values for the constant $M$ to make it all work (e.g. $src_{h,s}+ch_{h,s}+dst_{h,s}+UB(wt_{h,s})$). Picking much larger values leads to lower performance and might even introduce numerical problems.

                • If your solver of choice supports indicator constraints, you could also formulate it using those.






                share|improve this answer









                $endgroup$


















                  2












                  2








                  2





                  $begingroup$


                  1. Add some additional continuous variables $s_{h,s}$ to your model and use those variables in the objective, instead of the products.



                  2. Add the following constraints for each $s_{h,s}$:





                    • This constraint ensures that $s_{h,s}$ is at most equal to the sum:



                      $s_{h,s} leq src_{h,s}+ch_{h,s}+dst_{h,s}+wt_{h,s}$




                    • This constraint ensures that $s_{h,s}$ will be at least the sum when $a_{h,s}=1$:



                      $s_{h,s} geq src_{h,s}+ch_{h,s}+dst_{h,s}+wt_{h,s} - M times (1 - a_{h,s}) $




                    • This constraints ensures that $s_{h,s}=0$ when $a_{h,s}=0$:



                      $s_{h,s} leq M times a_{h,s} $






                  Some notes about this:




                  • I assumed that your constants and variables are all nonnegative.

                  • You should pick small values for the constant $M$ to make it all work (e.g. $src_{h,s}+ch_{h,s}+dst_{h,s}+UB(wt_{h,s})$). Picking much larger values leads to lower performance and might even introduce numerical problems.

                  • If your solver of choice supports indicator constraints, you could also formulate it using those.






                  share|improve this answer









                  $endgroup$




                  1. Add some additional continuous variables $s_{h,s}$ to your model and use those variables in the objective, instead of the products.



                  2. Add the following constraints for each $s_{h,s}$:





                    • This constraint ensures that $s_{h,s}$ is at most equal to the sum:



                      $s_{h,s} leq src_{h,s}+ch_{h,s}+dst_{h,s}+wt_{h,s}$




                    • This constraint ensures that $s_{h,s}$ will be at least the sum when $a_{h,s}=1$:



                      $s_{h,s} geq src_{h,s}+ch_{h,s}+dst_{h,s}+wt_{h,s} - M times (1 - a_{h,s}) $




                    • This constraints ensures that $s_{h,s}=0$ when $a_{h,s}=0$:



                      $s_{h,s} leq M times a_{h,s} $






                  Some notes about this:




                  • I assumed that your constants and variables are all nonnegative.

                  • You should pick small values for the constant $M$ to make it all work (e.g. $src_{h,s}+ch_{h,s}+dst_{h,s}+UB(wt_{h,s})$). Picking much larger values leads to lower performance and might even introduce numerical problems.

                  • If your solver of choice supports indicator constraints, you could also formulate it using those.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 4 hours ago









                  SimonSimon

                  4471 silver badge12 bronze badges




                  4471 silver badge12 bronze badges

































                      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%2f1146%2flinearization-of-objective-function%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

                      Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

                      The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

                      Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...