Originally posted by: GGR
Hi
You should have a look to the function IloCP::next(). After each succcessful iteration, the solver is in a state that is the best so far incumbent.
IloEnv env();
IloModel model(env);
/*..*/ //fill the model
IloExpr obj = /*..*/; the objective expression
IloGoal goal = /*..*/; // if you do not use automatic search
IloConstraint ct = /*..*/; the user constraint
IloMinimize(model, obj);
IloCP cp(model);
cp.startNewSearch(goal); // ignore goal argument in automatic search
while(cp.next()) {
IloNum bestSoFar = cp.getObjValue();
/*..*/ store bestSofar in your data structure
}
Hope that helps
#ConstraintProgramming-General#DecisionOptimization