Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  How can I make logical constraints more efficient?

    Posted Sun March 19, 2017 01:15 PM

    Originally posted by: nlp7


    Hi,

     

    I have some logical constraints in my formualation, specifically if some binary is zero, then a specific continuous must be zero too.

    I modeled it both with a bigM that I calculated by myself, and with the CPLEX API that allows for direct modeling of logical constraints ( IloIfThen() ). Both of the approaches yield the same result, however the second one (IloIfThen), is 3 times slower!

    Is there any way that we can provide to CPLEX some insight about a reasonable BigM so that we can accelerate things up? I would like to use the native logical description of the problem, because it makes it so much more readable, but really I cannot sacrifice that much of the performance.

    Were we supposed to use the IloIfThen only when we have no clue about a reasonable BigM?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How can I make logical constraints more efficient?

    Posted Sun March 19, 2017 07:42 PM

    Out of curiosity, in the version using IloIfThen did you specify an upper bound for the continuous variable in each if-then constraint? Presumably this would be the same value used as M in the big M version.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How can I make logical constraints more efficient?

    Posted Sun March 19, 2017 09:25 PM

    Originally posted by: nlp7


    My bigM constraint is like -Mb<=c<=Mb where b is {0,1}, and c belongs to [-1,000, 1,000]. The M is lets say 10,000.

    The same bounds are also given to the b,c variable when I am writing the IloIfthen(env, b=0, c=0)


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: How can I make logical constraints more efficient?

    Posted Sun March 19, 2017 10:12 PM

    If the domain of c is [-1,000, +1,000] then you might as well use M = 1,000 rather than M = 10,000 in the big M approach. With the same bounds specified for c in the if-then approach, I'm surprised that performance is worse. If anything, it should be faster, since internally CPLEX should be treating IloIfThen(env, b = 0, c = 0) as -1000b <= c <= 1000b, which is tighter than -10,000b <= c <= 10,000b.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: How can I make logical constraints more efficient?

    Posted Sun March 19, 2017 10:20 PM

    Originally posted by: nlp7


    This was my expectation as well. As you pointed out my big-M is not even the tightest possible, yet CPLEX seems to work much better with the big-M's. From the lp file, I see that it reformulates the Iloifthen as SOS constraints, introducing extra 0,1 variables, but I have no clue what it does with this internally during the solution.


    #CPLEXOptimizers
    #DecisionOptimization