ILOG CPLEX .NET Reference Manual

Cplex.HeuristicCallback.SetSolution Method (INumVar[], Double[])

Injects a solution to be used as the potential new incumbent.

protected virtual void SetSolution(
   INumVar[] vars,
   double[] vals
);

Parameters

vars
An array of variables whose solution values are specified.
vals
An array containing the solution values for the variables specified in vars. vals[j] specifies the solution value for vars[j].

Remarks

The injected solution is specified by providing solution values for all variables. If a user heuristic is successful in finding a new candidate for an incumbent, it can be passed to Cplex by the method setSolution. Cplex analyzes the solution and, if it is both feasible and better than the current incumbent, uses it as the new incumbent. A solution is specified using arrays vars and vals, where vals[i] specifies the solution value for vars[i].

Do not call this method multiple times. Calling it again overwrites any previously specified solution.

See Also

Cplex.HeuristicCallback Class | ILOG.CPLEX Namespace | Cplex.HeuristicCallback.SetSolution Overload List