Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  iteratively calling cplex in python

    Posted 05/16/15 09:31 PM

    Originally posted by: prashanw


    Whats the best way to iteratively call cplex in python API?

     

    My use case it the following 

    1. I want to solve the MIP with slightly changed constraints, a number of times. Right now for each iteration I do a cplex.Cplex() and freshly load the changed constraints.

    2. While I am iteratively calling cplex, If I keep the order of the objective variables the same but change the order of the constraints (only the order that the constraints are added to linear_constraints.add) is that ok?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: iteratively calling cplex in python

    Posted 05/18/15 12:22 AM

    Changing the order of constraints should not affect correctness. It may however affect performance (in a good or bad way). As discussed in other posts, the order of constraints can make a major (but unpredictable) difference here.

    In your situation, I would update the existing CPLEX object by adding/removing constraints rather than creating a new object from scratch. Unless you need to change a large number of constraints this should be faster than setting things up from scratch. CPLEX can then also try to carry over information from the previous solve (like feasible solutions) to the next solve.


    #CPLEXOptimizers
    #DecisionOptimization