Creates and returns a solution goal.
vars
. Value vals[j]
is the proposed solution value for variable vars[j]
. The goal that injects the solution.
When the solution goal is executed, it attempts to inject the solution specified by setting the variables listed in vars
to the corresponding values listed in val
as a new incumbent.
Cplex
will not blindly accept such a solution. Instead, it will make sure that this solution is compatible with both the model and the goals. When checking feasibility with goals, it will check feasibility with both goals that have already been executed and goals that are still on the goal stack. Thus, in particular, Cplex
will reject any solution that is not compatible with the branching that has been done so far. It then continues by checking compatibility with the goals still remaining on the goal stack, including those that may get created by them. Only if the proposed solution remains feasible and has a better objective value than the current incumbent will it be used to replace the current incumbent.