Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to achieve conditional constraints in CPLEX python?

    Posted 07/14/17 10:07 AM

    Originally posted by: derekxu11


    I have a constraint just like this:

    Tardiness = max(Completion - Duedate, 0)

    The tardiness and completion are variables, and the duedate is a constant.

    How can I achieve this constraint in Python?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How to achieve conditional constraints in CPLEX python?

    Posted 07/14/17 11:39 AM

    You can get split this into

    Tardiness >= Completion - Duedate
    Tardiness >= 0

    (or just place a lower bound of 0 on Tardiness and only state the first constraint). I guess your objective function penalizes large values of Tardiness? In that case the solver will chose for Tardiness the smallest possible value, which is the max.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How to achieve conditional constraints in CPLEX python?

    Posted 07/15/17 09:06 AM

    Originally posted by: derekxu11


    Thanks!

    This really helps me a lot


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: How to achieve conditional constraints in CPLEX python?

    Posted 02/18/18 07:04 AM

    Originally posted by: EvanSmith


    Hello

     

    similar problem.  

    Need I think a conditional constraint

    Looking at the football schedule problem provided 

    how about I have 

    a match be a-b.  Where a plays at home against b who is away

    and the Boolean matrix is a-b vs week

    want a constraint 

    b will only play two away games in a row if b is playing games

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: How to achieve conditional constraints in CPLEX python?

    Posted 02/19/18 03:59 AM

    Hi

    have you had a look at the example foodmanu.py in

    CPLEX_Studio128\cplex\examples\src\python

    ?

    regards


    #CPLEXOptimizers
    #DecisionOptimization