Originally posted by: SystemAdmin
[prubin said:]
[quote author=Student link=topic=824.msg2465#msg2465 date=1231601068]
I have two assumptions, why it may not work, but I don't know how to make it work.
The first reason could be that my MIP has three kinds of variables: boolean, integer and real variables,
which are stored in multidimensional BoolVarArrays, IntVarArrays and NumVarArrays.
I copy them altogether in a onedimensional NumVarArray to pass them to setSolution.
Could this be a reason, why it doesn't work?
That is the correct approach. There should be no problem with mixing integer, boolean and general numeric variables in one array.
[quote author=Student link=topic=824.msg2465#msg2465 date=1231601068]
By the way, does the solution I provide have to be complete,
that means, do I have to give a solution value to all the Variables in my model?
I believe so. When you feed an initial incumbent to CPLEX at the outset of a run, it does not have to be complete; CPLEX will take a partial solution and try to complete it. In a (an?) heuristic callback, though, I believe you have to supply a complete solution. I think the documentation might be a bit clearer about this, but it does say "all variables" in one spot.
[quote author=Student link=topic=824.msg2465#msg2465 date=1231601068]
The second reason could be that my solution is not connected to the node at which the Heuristic Callback
is called. That means, there can be variables which have their values already fixed at that node,
but the solution I want to pass to CPLEX gives them another value.
Or the bounds at that node in the tree are violated by my solution.
I don't think that's a problem.
/Paul
#CPLEXOptimizers#DecisionOptimization