ILOG CPLEX .NET Reference Manual

Cplex.SolutionGoal Method 

Creates and returns a solution goal.

public Goal SolutionGoal(
   INumVar[] vars,
   double[] vals
);

Parameters

vars
An array of variables for which solution values are specified.
vals
The array of solution values for the variables in vars. Value vals[j] is the proposed solution value for variable vars[j].

Return Value

The goal that injects the solution.

Remarks

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.

See Also

Cplex Class | ILOG.CPLEX Namespace