Originally posted by: SystemAdmin
[Philippe Refalo said:]
Hi Ramy,
Here are a few more information to complete Paul answer.
Ilog CP optimizer integrates an automatic search. This means that you can just
model the problem and call
cp.solve()
to find solutions. Search phases provide a simple way to help this automatic
search by injecting some additional information.
For instance if, from your knowledge about the problem, you consider that some
variables (x) are more important (or more blocking) than others, you might want
to start by giving a value to x variables first. For this purpose, you can write
(in C++)
cp.solve(IloSearchPhase(env, x));
You can also write
IloSearchPhaseArray phaseArray(env);
phaseArray.add(IloSearchPhase(env, x));
phaseArray.add(IloSearchPhase(env, y));
cp.solve(phaseArray);
to tell the automatic search to give a value to x variables first, then to y
variables and finaly to the remaining variables if any.
You can also specify the way the variables and the values are selected.
For instance the code
cp.solve(IloSearchPhase(env, x, IloSelectSmallest(IloExplicitVarEval(env, x, cost)),
IloSelectSmallest(IloValue(env))));
will instantiate the variables x before any other. It will also choose
first the variable with the smallest cost (cost values are given in the array
"cost") and it will give first the smallest possible value to the selected variable.
There is a set of predefined selectors that are available in CP Optimizer but
you can write you own selector in C++ if needed.
These phases are going to be used in certains steps of the automatic search. Restart
search (the default) restart the search from time to time with some extra information
learned from the previous runs. MultiPoint generates a set of solutions and combines
them to find better ones. Finaly DepthFirst is a regular depth-first search that is
mainly used for observing or debugging the search phases.
Regards
#CPOptimizer#DecisionOptimization