Originally posted by: UdoKrehler
Hello,
I use CP Optimizer 2.3 under C# in Microsoft Visual Studio. I would like to start CP Optimizer with an initial solution that I've previously computed with some heuristics. I use the following simplified code (where the variable
position is of type IIntVar[]: position = cp.IntVarArray(numberOfJobs, 0, 100)):
ISolution startSolution = cp.Solution(); for (int i = 0; i < numberOfJobs; i++)
{ startSolution.SetValue(position[i], positionInitialSolution[i]); } cp.SetStartingPoint(startSolution); cp.Solve(); The code runs perfectly, but apparently, CP Optimizer completely ignores my initial solution. The first solution CP Optimizer produces is the same regardless of adding the above code lines or leaving them out. Moreover, the first solution CP Optimizer produces is much, much worse than my initial solution (which is definitely feasible, by the way).
I did NOT use the depth-first search, actually I did not manually change anything w.r.t. the search strategy.
Does anybody know why CP Optimizer ignores my initial solution? Did I forget something important?
Thank you very much for your help, Udo.
#CPOptimizer#DecisionOptimization