XPRBaddmipsol
XPRBaddmipsol |
Purpose
Synopsis
int XPRBaddmipsol(XPRBprob prob, XPRBsol sol, const char *name);
Arguments
prob
|
Reference to a problem.
|
sol
|
Reference to a solution.
|
name
|
An optional name to associate with the solution. Can be NULL.
|
Return value
0 if function executed successfully, 1 otherwise.
Example
Add a MIP solution for problem
expl2 to the Optimizer.
XPRBprob expl2; XPRBsol sol; ... XPRBaddmipsol(prob, sol, "myHeurSol"); XPRBdelsol(sol); /* Free the solution object */ /* Request notification of solution status after processing */ XPRSaddcbusersolnotify(XPRBgetXPRSprob(prob), solnotify, NULL, 0);
Further information
1. If the matrix loaded in the Optimizer does not correspond to the current state of the specified problem definition, it is regenerated automatically before adding the solution.
2. The
XPRBmipoptimize function by default resets problem status including eventual loaded solutions; to avoid that, flag "c" should be specified for the
alg argument of
XPRBmipoptimize when called after
XPRBaddmipsol.
3. The function returns immediately after passing the solution to the Optimizer. The solution is placed in a pool until the Optimizer is able to analyze the solution during a MIP solve.
4. If the provided solution is partial or found to be infeasible, a limited local search heuristic will be run in an attempt to find a close feasible integer solution. Values provided for continuous columns in partial solutions are currently ignored.
5. The
usersolnotify callback can be used to discover the outcome of a loaded solution. The optional name provided as
name will be returned in the callback.
Related topics