Injects a solution to be used as the potential new incumbent from an array that may possibly contain other elements.
vars
. vals[j]
specifies the solution value for vars[j]
for j
in start
through start+num-1
. vars
and vals
. vars
and vals
. The injected solution is specified by providing solution values for all variables in the model. The array used to specify the values may contain more elements; in that case, use the argument start
to specify the starting element and the argument num
to specify the number of consecutive elements to use.
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, Cplex
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.
Cplex.HeuristicCallback Class | ILOG.CPLEX Namespace | Cplex.HeuristicCallback.SetSolution Overload List