Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

CP Optimizer 12.3 Performance: after migration from ILOG Solver 6.3

  • 1.  CP Optimizer 12.3 Performance: after migration from ILOG Solver 6.3

    Posted Mon September 12, 2011 11:07 AM

    Originally posted by: UserCH


    Hello,

    I just migrated my CP application from ILOG Solver 6.3 to CP Optimizer in CPLEX Studio 12.3. I am using Visual Studio 2008. After adjusting project setting and making small code changes, the program can be compiled and run. However, I see huge run time increase. Are there any general advices for me to improve the performance after this migration?

    Thanks!
    UserCH
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: CP Optimizer 12.3 Performance: after migration from ILOG Solver 6.3

    Posted Tue September 13, 2011 11:29 AM

    Originally posted by: SystemAdmin


    Dear UserCH,

    If you have ported the same code from Solver 6.3 to CP Optimizer in CPLEX Studio 12.3 you should have at least similar performances.
    Do you have a search goal and have you ported it, or are you using the embedded search in CPO ?
    In the former case, can you observe the search (trace or prints) to see if the strategy is taking a different route or if it branches the same way and the slowdown is due to a slower propagation ?

    Thanks

    Philippe
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: CP Optimizer 12.3 Performance: after migration from ILOG Solver 6.3

    Posted Tue September 13, 2011 03:18 PM

    Originally posted by: UserCH


    Dear Philippe,

    Thank you for your reply. Here is the goal we set:

    IloGoal CPModel::createGoal()
    {
    IloGoal goal = IloGoalTrue(_env);
    #define GOAL IlcChooseMinSizeInt
    for (int empID = 0; empID <_numLines; empID++)
    {
    goal = goal && IloGenerate(_env, _var1empID, GOAL);
    goal = goal && IloGenerate(_env, _var2empID, GOAL);
    goal = goal && IloGenerate(_env, _var3empID, GOAL);
    goal = goal && IloGenerate(_env, _var4empID, GOAL);
    goal = goal && IloGenerate(_env, _var5empID, GOAL);
    goal = goal && IloGenerate(_env, _var6empID, GOAL);
    }

    return goal;
    }

    Can you give me a tutorial about how to observe the search (trace or prints)?

    I also tried to migrate to ILOG CP 1.6 (I understand the Solver version for it is Solver 6.8). The performance is quite comparable to Solver 6.3. However, CP 1.6 is built on Concert 12.2, I can not build it together with Cplex Studio 12.3. Do you know if there is any new version of CP that is built on Concert 12.3?

    Thanks a lot!

    UserCH
    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: CP Optimizer 12.3 Performance: after migration from ILOG Solver 6.3

    Posted Thu September 15, 2011 08:42 AM

    Originally posted by: SystemAdmin


    Hi,

    The simplest way to observe search behavior in your case is to use the following goal:

    ILCGOAL2(IlcMySetValue, IlcIntVar, var, IlcInt, val) {
    //cout << " " << var << " == " << val << endl;
    var.setValue(val);
    return 0;
    }

    ILCGOAL2(IlcMyRemoveValue, IlcIntVar, var, IlcInt, val) {
    //cout << " " << var << " != " << val << endl;
    var.removeValue(val);
    return 0;
    }

    ILCGOAL1(IlcMyInstantiate, IlcIntVar, var) {
    if (var.isBound()) return 0;
    IlcInt val = var.getMin();
    return IlcOr(IlcMySetValue(getManager(), var, val),
    IlcAnd(IlcMyRemoveValue(getManager(), var, val),
    this));
    }

    ILCGOAL1(IlcMyGenerate, IlcIntVarArray, vars) {
    IlcInt index = IlcChooseMinSizeInt(vars);
    if (index == -1) return 0;
    else return IlcAnd(IlcMyInstantiate(getManager(), varsindex), this);
    }

    ILOCPGOALWRAPPER1(IloMyGenerate, cp, IloIntVarArray, iloVars) {
    return IlcMyGenerate(cp, cp.getIntVarArray(iloVars));
    }

    This goal behaves like IloGenerate(_env, vars, IlcChooseMinSizeInt). You can use this goal in CP and in CP Optimizer. If you uncomment the cout lines in IlcMySetValue and IlcMyRemoveValue then the choices made by the search are displayed.

    If there is a difference in the search route between CP and CPO then this means that there are differences in domain reduction. There are two possible reasons for such a difference:
    • change in propagation between CP and CPO (due to bug correction or a stronger propagation);
    • change in your model between CP and CPO ; even a small change can have a large impact on the search.

    If there is no difference, this mean that the progation itself is slower.

    In the case the difference is not on your side, we would appreciate to have a code demonstrating the problem in order to correct it and to give you a workaround. The code will not be disclosed outside CP Optimizer team and we can eliminate it once we have solved the problem.

    Regards

    Philippe
    #CPOptimizer
    #DecisionOptimization