Linear Programming with additional “if-then”/“Default to zero” constraints?Convex Maximization with Linear ConstraintsApplication of complex numbers in Linear Programming?Mixed-Integer Linear Programming (Capacity Planning)Generating all extreme raysLinear and Integer programming materialsState-of-the-art algorithms for solving linear programsShould I factor in time as a parameter or a variable in a scheduling problem with MILP?Graphical method in linear programmingLinear Programming: Objective function goodness if variable holds value above a given constant value

Which cohomology classes are detected by tori?

Sent technical test that was impossible, other candidates completed it

How to fight an army of skeletons?

Authenticate users based on both user role, and requested operation

How can I swallow pills more easily?

What type of interpreter were most 8-bit BASIC implementations?

Large products with glass doors

What is the contemporary meaning of primary storage?

C - wrapping globals in a struct?

Vertex Size for more than one vertex

How to handle a colleague who appears helpful in front of manager but doesn't help in private?

If a photon truly goes through both slits (at the same time), then why can't we detect it at both slits (at the same time)?

Can I use toggle bolts to mount a tv on a barnwood wall?

Should I present forged documents in a Penetration Test/Red team engagement?

What are these color strips for?

How do the different seasons work for Eladrin?

If I fill a field through a dropdown menu in QGIS, will the content still be there in after importing the shapefile into a different GIS programme?

Is there a reason to have 2 or more witnesses at the same time during the current impeachment hearings

Starting a sentence instantly with a noun

How can you determine the hostname associated with an IP on the network?

Will Curiosity and the Mars 2020 rover be able to communicate with each other via a Mars orbiter?

How to explain to traditional people why they should upgrade their old Windows XP device?

Translate the French quote "Il n’y a pas d'amour, il n’y a que des preuves d’amour" to English?

Short story from the 70s(?) about aliens/angels destroying humankind, from the point of view of a priest/pastor



Linear Programming with additional “if-then”/“Default to zero” constraints?


Convex Maximization with Linear ConstraintsApplication of complex numbers in Linear Programming?Mixed-Integer Linear Programming (Capacity Planning)Generating all extreme raysLinear and Integer programming materialsState-of-the-art algorithms for solving linear programsShould I factor in time as a parameter or a variable in a scheduling problem with MILP?Graphical method in linear programmingLinear Programming: Objective function goodness if variable holds value above a given constant value













15















$begingroup$


What approaches can I use for a Linear Programming problem with the additional constraint that if a decision variable falls below a certain threshold, then it should just be forced to 0.



I'm thinking about the following business scenario: My decision variables are shipment/ordering quantities for a set products, and I want to say that if an order quantity falls below a certain threshold, then I shouldn't bother ordering it as all and just set the value for that product to zero (i.e a supplier won't ship less than x amount of units).



Does this still count as a linear programming problem? Is it still convex? Does this increase the computational difficulty of the problem?










share|improve this question











$endgroup$










  • 5




    $begingroup$
    You’ll need binary variables in this case.
    $endgroup$
    – LarrySnyder610
    Sep 10 at 21:49















15















$begingroup$


What approaches can I use for a Linear Programming problem with the additional constraint that if a decision variable falls below a certain threshold, then it should just be forced to 0.



I'm thinking about the following business scenario: My decision variables are shipment/ordering quantities for a set products, and I want to say that if an order quantity falls below a certain threshold, then I shouldn't bother ordering it as all and just set the value for that product to zero (i.e a supplier won't ship less than x amount of units).



Does this still count as a linear programming problem? Is it still convex? Does this increase the computational difficulty of the problem?










share|improve this question











$endgroup$










  • 5




    $begingroup$
    You’ll need binary variables in this case.
    $endgroup$
    – LarrySnyder610
    Sep 10 at 21:49













15













15









15





$begingroup$


What approaches can I use for a Linear Programming problem with the additional constraint that if a decision variable falls below a certain threshold, then it should just be forced to 0.



I'm thinking about the following business scenario: My decision variables are shipment/ordering quantities for a set products, and I want to say that if an order quantity falls below a certain threshold, then I shouldn't bother ordering it as all and just set the value for that product to zero (i.e a supplier won't ship less than x amount of units).



Does this still count as a linear programming problem? Is it still convex? Does this increase the computational difficulty of the problem?










share|improve this question











$endgroup$




What approaches can I use for a Linear Programming problem with the additional constraint that if a decision variable falls below a certain threshold, then it should just be forced to 0.



I'm thinking about the following business scenario: My decision variables are shipment/ordering quantities for a set products, and I want to say that if an order quantity falls below a certain threshold, then I shouldn't bother ordering it as all and just set the value for that product to zero (i.e a supplier won't ship less than x amount of units).



Does this still count as a linear programming problem? Is it still convex? Does this increase the computational difficulty of the problem?







linear-programming convexity






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 10 at 22:19







Alex Kinman

















asked Sep 10 at 21:47









Alex KinmanAlex Kinman

1,53914 bronze badges




1,53914 bronze badges










  • 5




    $begingroup$
    You’ll need binary variables in this case.
    $endgroup$
    – LarrySnyder610
    Sep 10 at 21:49












  • 5




    $begingroup$
    You’ll need binary variables in this case.
    $endgroup$
    – LarrySnyder610
    Sep 10 at 21:49







5




5




$begingroup$
You’ll need binary variables in this case.
$endgroup$
– LarrySnyder610
Sep 10 at 21:49




$begingroup$
You’ll need binary variables in this case.
$endgroup$
– LarrySnyder610
Sep 10 at 21:49










5 Answers
5






active

oldest

votes


















9

















$begingroup$

You asked several questions at once but these should be answered all at once too. The problem that you describe is no longer convex. An easy way of seeing this is that the linear combination of the following two feasible solutions:



  1. Value of the product at its minimum feasible value (Ordering quantity at its given threshold).

  2. Value of the product at zero (Ordering quality below threshold)

is not feasible (say the value of the product being between these two numbers is ruled out by your logic constraints). This violates the definition of convexity.



Even if your constraints are all linear, only using linear constraints is not enough to model nonconvexities. One of the most versatile tools that we have nowadays to model non-convexities is through integer variables. In the case of only linear constraints, this yields a (Mixed-)Integer Linear Programming problem.



Finally, since finding the optimal solutions over a nonconvex feasible region cannot rely solely on the algorithms that assume convexity (Simplex or traditional interior point methods for LP), by removing the convexity assumption, the algorithms to solve these more complicated problems are more computationally demanding. For example, in the case of having discrete variables, you might be forced to evaluate at least some of the discrete choices by fixing them separately (branching).






share|improve this answer










$endgroup$






















    8

















    $begingroup$

    An alternative to using binary variables is to use semicontinuous variables, supported by some solvers. You still wind up with a discrete optimization problem (integer program), but the binary "buy/don't buy" variables and the related bounds are order sizes are handled internally by the solver rather than explicitly in your model. Some citations (shamelessly starting with one of my own):




    • Semicontinuous Variables (my blog; I refuse to waste hyphens where not needed)


    • Semi-continuous variables (Erwin Kalvelagen's blog)


    • semi-continuous variables (lp_solve documentation)





    share|improve this answer










    $endgroup$










    • 1




      $begingroup$
      You missed a great opportunity to use a hyphen after "(my blog"
      $endgroup$
      – JollyJoker
      Sep 13 at 7:08


















    5

















    $begingroup$

    FICO document (part 2.10 page 8) explain this situation as follow:



    • Lets $x_j$ has the situation that you explained. Define a binary variable for each of those variables like $x_j$ and call them $y_j$.

    • for each variable that you already defined in the original model consider the lower bound and upper bound(defined $l_j$ and $u_j$). Lower bounds are simply your thresholds for each variable and upper bounds, if you don’t have maximum available ordering amounts, can be a defined big M.


    • finally add the following constraints to your model:



      $\forall j in textoriginal variables$:



      • $x_j geq l_j . y_j$

      • $x_j leq u_j . y_j$






    share|improve this answer












    $endgroup$






















      5

















      $begingroup$

      One way to approach this in an integer linear programming formulation is using Big-M.



      Let $x in mathbbZ$ with $x geq 0$ be your quantity variable for a product.
      You now introduce a variable $y in 0, 1$ that will be assigned zero when you shouldn't be bother ordering, and one otherwise. Let's use this constraint:



      • $x leq M y$

      Here $M$ is a sufficiently large integer, an upper bound for the maximum quantity you will encounter in an order. So if $y = 1$, $x$ will be your quantity, if $y = 0$, $x$ will be limited to $0$.



      Let $T$ be your threshold. We now need some "logic" to set $y$ to $1$ if $x geq T$ and to $0$ otherwise:



      • $y leq x/T$

      The case $x < T$ yields $y < 1$, i.e., $y = 0$, and the case $x geq T$ allows $y$ to be $1$.



      So, we get, as Oguz Toragay already cited from the FICO document:



      • $x geq T y$

      • $x leq M y$

      EDIT: A slightly different approach would be as follows: You could use a variable $z in mathbbZ, z geq 0,$ for quantities that are added on top of your threshold, and $y$ as described above. So replace all occurrences of $x$ by $z + T y$ and only use the constraint $z leq M y$. I guess it's not much of a difference for most MIP solvers, but it's worth trying.




      Does this increase the computational difficulty of the problem?




      Yes, in two ways:



      1) The formulation is an integer formulation, that is, you cannot simply use simplex or barrier methods to solve it, you need to solve the LP relaxation and branch over the fractional variables.



      2) The LP relaxation is bad (i.e. there will be a lot of branching, which is expensive). That's usually the issue with Big-M formulations.






      share|improve this answer












      $endgroup$






















        2

















        $begingroup$

        As previous posts mentioned, you will need to use binary variables to deal with it. Might, this example be useful to you.






        share|improve this answer










        $endgroup$










        • 4




          $begingroup$
          Typically, please provide a description of what happens at the 'this' link, as someday it may be broken / disappear, etc.
          $endgroup$
          – JosephDoggie
          Sep 11 at 13:08












        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/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: 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%2f1512%2flinear-programming-with-additional-if-then-default-to-zero-constraints%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown


























        5 Answers
        5






        active

        oldest

        votes








        5 Answers
        5






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        9

















        $begingroup$

        You asked several questions at once but these should be answered all at once too. The problem that you describe is no longer convex. An easy way of seeing this is that the linear combination of the following two feasible solutions:



        1. Value of the product at its minimum feasible value (Ordering quantity at its given threshold).

        2. Value of the product at zero (Ordering quality below threshold)

        is not feasible (say the value of the product being between these two numbers is ruled out by your logic constraints). This violates the definition of convexity.



        Even if your constraints are all linear, only using linear constraints is not enough to model nonconvexities. One of the most versatile tools that we have nowadays to model non-convexities is through integer variables. In the case of only linear constraints, this yields a (Mixed-)Integer Linear Programming problem.



        Finally, since finding the optimal solutions over a nonconvex feasible region cannot rely solely on the algorithms that assume convexity (Simplex or traditional interior point methods for LP), by removing the convexity assumption, the algorithms to solve these more complicated problems are more computationally demanding. For example, in the case of having discrete variables, you might be forced to evaluate at least some of the discrete choices by fixing them separately (branching).






        share|improve this answer










        $endgroup$



















          9

















          $begingroup$

          You asked several questions at once but these should be answered all at once too. The problem that you describe is no longer convex. An easy way of seeing this is that the linear combination of the following two feasible solutions:



          1. Value of the product at its minimum feasible value (Ordering quantity at its given threshold).

          2. Value of the product at zero (Ordering quality below threshold)

          is not feasible (say the value of the product being between these two numbers is ruled out by your logic constraints). This violates the definition of convexity.



          Even if your constraints are all linear, only using linear constraints is not enough to model nonconvexities. One of the most versatile tools that we have nowadays to model non-convexities is through integer variables. In the case of only linear constraints, this yields a (Mixed-)Integer Linear Programming problem.



          Finally, since finding the optimal solutions over a nonconvex feasible region cannot rely solely on the algorithms that assume convexity (Simplex or traditional interior point methods for LP), by removing the convexity assumption, the algorithms to solve these more complicated problems are more computationally demanding. For example, in the case of having discrete variables, you might be forced to evaluate at least some of the discrete choices by fixing them separately (branching).






          share|improve this answer










          $endgroup$

















            9















            9











            9







            $begingroup$

            You asked several questions at once but these should be answered all at once too. The problem that you describe is no longer convex. An easy way of seeing this is that the linear combination of the following two feasible solutions:



            1. Value of the product at its minimum feasible value (Ordering quantity at its given threshold).

            2. Value of the product at zero (Ordering quality below threshold)

            is not feasible (say the value of the product being between these two numbers is ruled out by your logic constraints). This violates the definition of convexity.



            Even if your constraints are all linear, only using linear constraints is not enough to model nonconvexities. One of the most versatile tools that we have nowadays to model non-convexities is through integer variables. In the case of only linear constraints, this yields a (Mixed-)Integer Linear Programming problem.



            Finally, since finding the optimal solutions over a nonconvex feasible region cannot rely solely on the algorithms that assume convexity (Simplex or traditional interior point methods for LP), by removing the convexity assumption, the algorithms to solve these more complicated problems are more computationally demanding. For example, in the case of having discrete variables, you might be forced to evaluate at least some of the discrete choices by fixing them separately (branching).






            share|improve this answer










            $endgroup$



            You asked several questions at once but these should be answered all at once too. The problem that you describe is no longer convex. An easy way of seeing this is that the linear combination of the following two feasible solutions:



            1. Value of the product at its minimum feasible value (Ordering quantity at its given threshold).

            2. Value of the product at zero (Ordering quality below threshold)

            is not feasible (say the value of the product being between these two numbers is ruled out by your logic constraints). This violates the definition of convexity.



            Even if your constraints are all linear, only using linear constraints is not enough to model nonconvexities. One of the most versatile tools that we have nowadays to model non-convexities is through integer variables. In the case of only linear constraints, this yields a (Mixed-)Integer Linear Programming problem.



            Finally, since finding the optimal solutions over a nonconvex feasible region cannot rely solely on the algorithms that assume convexity (Simplex or traditional interior point methods for LP), by removing the convexity assumption, the algorithms to solve these more complicated problems are more computationally demanding. For example, in the case of having discrete variables, you might be forced to evaluate at least some of the discrete choices by fixing them separately (branching).







            share|improve this answer













            share|improve this answer




            share|improve this answer










            answered Sep 10 at 22:14









            David BernalDavid Bernal

            9951 silver badge15 bronze badges




            9951 silver badge15 bronze badges
























                8

















                $begingroup$

                An alternative to using binary variables is to use semicontinuous variables, supported by some solvers. You still wind up with a discrete optimization problem (integer program), but the binary "buy/don't buy" variables and the related bounds are order sizes are handled internally by the solver rather than explicitly in your model. Some citations (shamelessly starting with one of my own):




                • Semicontinuous Variables (my blog; I refuse to waste hyphens where not needed)


                • Semi-continuous variables (Erwin Kalvelagen's blog)


                • semi-continuous variables (lp_solve documentation)





                share|improve this answer










                $endgroup$










                • 1




                  $begingroup$
                  You missed a great opportunity to use a hyphen after "(my blog"
                  $endgroup$
                  – JollyJoker
                  Sep 13 at 7:08















                8

















                $begingroup$

                An alternative to using binary variables is to use semicontinuous variables, supported by some solvers. You still wind up with a discrete optimization problem (integer program), but the binary "buy/don't buy" variables and the related bounds are order sizes are handled internally by the solver rather than explicitly in your model. Some citations (shamelessly starting with one of my own):




                • Semicontinuous Variables (my blog; I refuse to waste hyphens where not needed)


                • Semi-continuous variables (Erwin Kalvelagen's blog)


                • semi-continuous variables (lp_solve documentation)





                share|improve this answer










                $endgroup$










                • 1




                  $begingroup$
                  You missed a great opportunity to use a hyphen after "(my blog"
                  $endgroup$
                  – JollyJoker
                  Sep 13 at 7:08













                8















                8











                8







                $begingroup$

                An alternative to using binary variables is to use semicontinuous variables, supported by some solvers. You still wind up with a discrete optimization problem (integer program), but the binary "buy/don't buy" variables and the related bounds are order sizes are handled internally by the solver rather than explicitly in your model. Some citations (shamelessly starting with one of my own):




                • Semicontinuous Variables (my blog; I refuse to waste hyphens where not needed)


                • Semi-continuous variables (Erwin Kalvelagen's blog)


                • semi-continuous variables (lp_solve documentation)





                share|improve this answer










                $endgroup$



                An alternative to using binary variables is to use semicontinuous variables, supported by some solvers. You still wind up with a discrete optimization problem (integer program), but the binary "buy/don't buy" variables and the related bounds are order sizes are handled internally by the solver rather than explicitly in your model. Some citations (shamelessly starting with one of my own):




                • Semicontinuous Variables (my blog; I refuse to waste hyphens where not needed)


                • Semi-continuous variables (Erwin Kalvelagen's blog)


                • semi-continuous variables (lp_solve documentation)






                share|improve this answer













                share|improve this answer




                share|improve this answer










                answered Sep 11 at 18:17









                prubinprubin

                6,7319 silver badges38 bronze badges




                6,7319 silver badges38 bronze badges










                • 1




                  $begingroup$
                  You missed a great opportunity to use a hyphen after "(my blog"
                  $endgroup$
                  – JollyJoker
                  Sep 13 at 7:08












                • 1




                  $begingroup$
                  You missed a great opportunity to use a hyphen after "(my blog"
                  $endgroup$
                  – JollyJoker
                  Sep 13 at 7:08







                1




                1




                $begingroup$
                You missed a great opportunity to use a hyphen after "(my blog"
                $endgroup$
                – JollyJoker
                Sep 13 at 7:08




                $begingroup$
                You missed a great opportunity to use a hyphen after "(my blog"
                $endgroup$
                – JollyJoker
                Sep 13 at 7:08











                5

















                $begingroup$

                FICO document (part 2.10 page 8) explain this situation as follow:



                • Lets $x_j$ has the situation that you explained. Define a binary variable for each of those variables like $x_j$ and call them $y_j$.

                • for each variable that you already defined in the original model consider the lower bound and upper bound(defined $l_j$ and $u_j$). Lower bounds are simply your thresholds for each variable and upper bounds, if you don’t have maximum available ordering amounts, can be a defined big M.


                • finally add the following constraints to your model:



                  $\forall j in textoriginal variables$:



                  • $x_j geq l_j . y_j$

                  • $x_j leq u_j . y_j$






                share|improve this answer












                $endgroup$



















                  5

















                  $begingroup$

                  FICO document (part 2.10 page 8) explain this situation as follow:



                  • Lets $x_j$ has the situation that you explained. Define a binary variable for each of those variables like $x_j$ and call them $y_j$.

                  • for each variable that you already defined in the original model consider the lower bound and upper bound(defined $l_j$ and $u_j$). Lower bounds are simply your thresholds for each variable and upper bounds, if you don’t have maximum available ordering amounts, can be a defined big M.


                  • finally add the following constraints to your model:



                    $\forall j in textoriginal variables$:



                    • $x_j geq l_j . y_j$

                    • $x_j leq u_j . y_j$






                  share|improve this answer












                  $endgroup$

















                    5















                    5











                    5







                    $begingroup$

                    FICO document (part 2.10 page 8) explain this situation as follow:



                    • Lets $x_j$ has the situation that you explained. Define a binary variable for each of those variables like $x_j$ and call them $y_j$.

                    • for each variable that you already defined in the original model consider the lower bound and upper bound(defined $l_j$ and $u_j$). Lower bounds are simply your thresholds for each variable and upper bounds, if you don’t have maximum available ordering amounts, can be a defined big M.


                    • finally add the following constraints to your model:



                      $\forall j in textoriginal variables$:



                      • $x_j geq l_j . y_j$

                      • $x_j leq u_j . y_j$






                    share|improve this answer












                    $endgroup$



                    FICO document (part 2.10 page 8) explain this situation as follow:



                    • Lets $x_j$ has the situation that you explained. Define a binary variable for each of those variables like $x_j$ and call them $y_j$.

                    • for each variable that you already defined in the original model consider the lower bound and upper bound(defined $l_j$ and $u_j$). Lower bounds are simply your thresholds for each variable and upper bounds, if you don’t have maximum available ordering amounts, can be a defined big M.


                    • finally add the following constraints to your model:



                      $\forall j in textoriginal variables$:



                      • $x_j geq l_j . y_j$

                      • $x_j leq u_j . y_j$







                    share|improve this answer















                    share|improve this answer




                    share|improve this answer








                    edited Sep 11 at 1:01

























                    answered Sep 10 at 22:57









                    Oguz ToragayOguz Toragay

                    5,5401 gold badge3 silver badges30 bronze badges




                    5,5401 gold badge3 silver badges30 bronze badges
























                        5

















                        $begingroup$

                        One way to approach this in an integer linear programming formulation is using Big-M.



                        Let $x in mathbbZ$ with $x geq 0$ be your quantity variable for a product.
                        You now introduce a variable $y in 0, 1$ that will be assigned zero when you shouldn't be bother ordering, and one otherwise. Let's use this constraint:



                        • $x leq M y$

                        Here $M$ is a sufficiently large integer, an upper bound for the maximum quantity you will encounter in an order. So if $y = 1$, $x$ will be your quantity, if $y = 0$, $x$ will be limited to $0$.



                        Let $T$ be your threshold. We now need some "logic" to set $y$ to $1$ if $x geq T$ and to $0$ otherwise:



                        • $y leq x/T$

                        The case $x < T$ yields $y < 1$, i.e., $y = 0$, and the case $x geq T$ allows $y$ to be $1$.



                        So, we get, as Oguz Toragay already cited from the FICO document:



                        • $x geq T y$

                        • $x leq M y$

                        EDIT: A slightly different approach would be as follows: You could use a variable $z in mathbbZ, z geq 0,$ for quantities that are added on top of your threshold, and $y$ as described above. So replace all occurrences of $x$ by $z + T y$ and only use the constraint $z leq M y$. I guess it's not much of a difference for most MIP solvers, but it's worth trying.




                        Does this increase the computational difficulty of the problem?




                        Yes, in two ways:



                        1) The formulation is an integer formulation, that is, you cannot simply use simplex or barrier methods to solve it, you need to solve the LP relaxation and branch over the fractional variables.



                        2) The LP relaxation is bad (i.e. there will be a lot of branching, which is expensive). That's usually the issue with Big-M formulations.






                        share|improve this answer












                        $endgroup$



















                          5

















                          $begingroup$

                          One way to approach this in an integer linear programming formulation is using Big-M.



                          Let $x in mathbbZ$ with $x geq 0$ be your quantity variable for a product.
                          You now introduce a variable $y in 0, 1$ that will be assigned zero when you shouldn't be bother ordering, and one otherwise. Let's use this constraint:



                          • $x leq M y$

                          Here $M$ is a sufficiently large integer, an upper bound for the maximum quantity you will encounter in an order. So if $y = 1$, $x$ will be your quantity, if $y = 0$, $x$ will be limited to $0$.



                          Let $T$ be your threshold. We now need some "logic" to set $y$ to $1$ if $x geq T$ and to $0$ otherwise:



                          • $y leq x/T$

                          The case $x < T$ yields $y < 1$, i.e., $y = 0$, and the case $x geq T$ allows $y$ to be $1$.



                          So, we get, as Oguz Toragay already cited from the FICO document:



                          • $x geq T y$

                          • $x leq M y$

                          EDIT: A slightly different approach would be as follows: You could use a variable $z in mathbbZ, z geq 0,$ for quantities that are added on top of your threshold, and $y$ as described above. So replace all occurrences of $x$ by $z + T y$ and only use the constraint $z leq M y$. I guess it's not much of a difference for most MIP solvers, but it's worth trying.




                          Does this increase the computational difficulty of the problem?




                          Yes, in two ways:



                          1) The formulation is an integer formulation, that is, you cannot simply use simplex or barrier methods to solve it, you need to solve the LP relaxation and branch over the fractional variables.



                          2) The LP relaxation is bad (i.e. there will be a lot of branching, which is expensive). That's usually the issue with Big-M formulations.






                          share|improve this answer












                          $endgroup$

















                            5















                            5











                            5







                            $begingroup$

                            One way to approach this in an integer linear programming formulation is using Big-M.



                            Let $x in mathbbZ$ with $x geq 0$ be your quantity variable for a product.
                            You now introduce a variable $y in 0, 1$ that will be assigned zero when you shouldn't be bother ordering, and one otherwise. Let's use this constraint:



                            • $x leq M y$

                            Here $M$ is a sufficiently large integer, an upper bound for the maximum quantity you will encounter in an order. So if $y = 1$, $x$ will be your quantity, if $y = 0$, $x$ will be limited to $0$.



                            Let $T$ be your threshold. We now need some "logic" to set $y$ to $1$ if $x geq T$ and to $0$ otherwise:



                            • $y leq x/T$

                            The case $x < T$ yields $y < 1$, i.e., $y = 0$, and the case $x geq T$ allows $y$ to be $1$.



                            So, we get, as Oguz Toragay already cited from the FICO document:



                            • $x geq T y$

                            • $x leq M y$

                            EDIT: A slightly different approach would be as follows: You could use a variable $z in mathbbZ, z geq 0,$ for quantities that are added on top of your threshold, and $y$ as described above. So replace all occurrences of $x$ by $z + T y$ and only use the constraint $z leq M y$. I guess it's not much of a difference for most MIP solvers, but it's worth trying.




                            Does this increase the computational difficulty of the problem?




                            Yes, in two ways:



                            1) The formulation is an integer formulation, that is, you cannot simply use simplex or barrier methods to solve it, you need to solve the LP relaxation and branch over the fractional variables.



                            2) The LP relaxation is bad (i.e. there will be a lot of branching, which is expensive). That's usually the issue with Big-M formulations.






                            share|improve this answer












                            $endgroup$



                            One way to approach this in an integer linear programming formulation is using Big-M.



                            Let $x in mathbbZ$ with $x geq 0$ be your quantity variable for a product.
                            You now introduce a variable $y in 0, 1$ that will be assigned zero when you shouldn't be bother ordering, and one otherwise. Let's use this constraint:



                            • $x leq M y$

                            Here $M$ is a sufficiently large integer, an upper bound for the maximum quantity you will encounter in an order. So if $y = 1$, $x$ will be your quantity, if $y = 0$, $x$ will be limited to $0$.



                            Let $T$ be your threshold. We now need some "logic" to set $y$ to $1$ if $x geq T$ and to $0$ otherwise:



                            • $y leq x/T$

                            The case $x < T$ yields $y < 1$, i.e., $y = 0$, and the case $x geq T$ allows $y$ to be $1$.



                            So, we get, as Oguz Toragay already cited from the FICO document:



                            • $x geq T y$

                            • $x leq M y$

                            EDIT: A slightly different approach would be as follows: You could use a variable $z in mathbbZ, z geq 0,$ for quantities that are added on top of your threshold, and $y$ as described above. So replace all occurrences of $x$ by $z + T y$ and only use the constraint $z leq M y$. I guess it's not much of a difference for most MIP solvers, but it's worth trying.




                            Does this increase the computational difficulty of the problem?




                            Yes, in two ways:



                            1) The formulation is an integer formulation, that is, you cannot simply use simplex or barrier methods to solve it, you need to solve the LP relaxation and branch over the fractional variables.



                            2) The LP relaxation is bad (i.e. there will be a lot of branching, which is expensive). That's usually the issue with Big-M formulations.







                            share|improve this answer















                            share|improve this answer




                            share|improve this answer








                            edited Sep 11 at 19:03

























                            answered Sep 11 at 9:18









                            Stephan BeyerStephan Beyer

                            514 bronze badges




                            514 bronze badges
























                                2

















                                $begingroup$

                                As previous posts mentioned, you will need to use binary variables to deal with it. Might, this example be useful to you.






                                share|improve this answer










                                $endgroup$










                                • 4




                                  $begingroup$
                                  Typically, please provide a description of what happens at the 'this' link, as someday it may be broken / disappear, etc.
                                  $endgroup$
                                  – JosephDoggie
                                  Sep 11 at 13:08















                                2

















                                $begingroup$

                                As previous posts mentioned, you will need to use binary variables to deal with it. Might, this example be useful to you.






                                share|improve this answer










                                $endgroup$










                                • 4




                                  $begingroup$
                                  Typically, please provide a description of what happens at the 'this' link, as someday it may be broken / disappear, etc.
                                  $endgroup$
                                  – JosephDoggie
                                  Sep 11 at 13:08













                                2















                                2











                                2







                                $begingroup$

                                As previous posts mentioned, you will need to use binary variables to deal with it. Might, this example be useful to you.






                                share|improve this answer










                                $endgroup$



                                As previous posts mentioned, you will need to use binary variables to deal with it. Might, this example be useful to you.







                                share|improve this answer













                                share|improve this answer




                                share|improve this answer










                                answered Sep 11 at 11:12









                                A.OmidiA.Omidi

                                2,6621 silver badge20 bronze badges




                                2,6621 silver badge20 bronze badges










                                • 4




                                  $begingroup$
                                  Typically, please provide a description of what happens at the 'this' link, as someday it may be broken / disappear, etc.
                                  $endgroup$
                                  – JosephDoggie
                                  Sep 11 at 13:08












                                • 4




                                  $begingroup$
                                  Typically, please provide a description of what happens at the 'this' link, as someday it may be broken / disappear, etc.
                                  $endgroup$
                                  – JosephDoggie
                                  Sep 11 at 13:08







                                4




                                4




                                $begingroup$
                                Typically, please provide a description of what happens at the 'this' link, as someday it may be broken / disappear, etc.
                                $endgroup$
                                – JosephDoggie
                                Sep 11 at 13:08




                                $begingroup$
                                Typically, please provide a description of what happens at the 'this' link, as someday it may be broken / disappear, etc.
                                $endgroup$
                                – JosephDoggie
                                Sep 11 at 13:08


















                                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%2f1512%2flinear-programming-with-additional-if-then-default-to-zero-constraints%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

                                Tamil (spriik) Luke uk diar | Nawigatjuun

                                Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                                Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?