Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  change IP objective and resolve

    Posted 08/22/20 03:15 AM
    Hi all,

    Suppose we have an MIP model coded in Python, and we solve it by CPLEX. When the solution procedure is over, I like to resolve the model using a different objective function. Is there a way or syntax to handle this? 

    If yes, the second problem is being solved from scratch or just being reoptimized? 


    Thanks

    ------------------------------
    Amin
    ------------------------------

    #DecisionOptimization


  • 2.  RE: change IP objective and resolve

    Posted 08/22/20 09:34 AM


  • 3.  RE: change IP objective and resolve

    Posted 08/24/20 12:50 AM
    You should specify whether you use docplex or the CPLEX Python API because the syntax is different between the two. Alex's answer is for docplex.

    Yes, the second problem is solved from scratch. There is no way around this because changing the objective is likely to invalidate certain presolve reductions and for sure requires a new tree search. However, since changing the objective only affects optimality and not feasibility, CPLEX will use every solution it found in the first round as MIP start for the second round. This may or may not speed up the second solve.

    ------------------------------
    Daniel Junglas
    ------------------------------



  • 4.  RE: change IP objective and resolve

    Posted 08/25/20 05:41 PM
    Thanks Daniel!

    I use CPLEX Python API.

    ------------------------------
    Amin
    ------------------------------



  • 5.  RE: change IP objective and resolve

    Posted 08/26/20 12:21 AM
    In the CPLEX Python API use Cplex.objective.set_linear() and Cplex.objective.set_sense() to modify the objective function.

    ------------------------------
    Daniel Junglas
    ------------------------------