Purpose
Adds a new feasible, infeasible or partial MIP solution for the problem to the Optimizer.
Topic area
Synopsis
int XPRSaddmipsol(XPRSprob prob, int length, const double solval[], const int colind[], const char* name);
Arguments
|
prob
|
The current problem.
|
|
length
|
Number of columns for which a value is provided.
|
|
solval
|
Double array of length
length containing solution values.
|
|
colind
|
Optional integer array of length
length containing column indices from
0 to
INPUTCOLS
-1, for the solution values provided in
solval. Duplicate entries are not allowed. May be
NULL when
solval provides a complete solution vector, in which case
solval should have
INPUTCOLS elements.
|
|
name
|
An optional name to associate with the solution. Can be
NULL.
|
Related controls
Integer
|
|
Controls the large neighborhood search heuristic for an infeasible or partial solution.
|
Example
This example loads a problem and then adds a solution found previously for the problem to help speed up the MIP search:
XPRSreadprob(prob,"problem","");
int ncols;
XPRSgetintattrib(prob,XPRS_INPUTCOLS,&ncols);
XPRSaddmipsol(prob,ncols,x,NULL,"warmstart");
XPRSmipoptimize(prob,"");
See also examples
addmipsol.c, tsp.c.
Further information
1. 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.
2. If the provided solution is found to be infeasible, a limited large neighborhood search heuristic will be run in an attempt to find a close feasible integer solution.
3. Note that this function does not immediately load the solution as a starting point for
XPRSfixmipentities. Consider using
XPRSfixmipentitiessolution instead to immediately fix integer columns to their values in that solution.
4. If a partial solution is provided, integer columns will be fixed to any provided values and a limited large neighborhood search heuristic will be run in an attempt to find integer feasible values for the remaining unspecified columns. Values provided for continuous column in partial solutions are currently ignored.
5. The
XPRSaddcbusersolnotify callback function can be used to discover the outcome of a loaded solution. The optional name provided as
name will be returned in the callback function.
6. If one or more solutions are loaded during the
XPRSaddcboptnode callback, the Optimizer will process all loaded solutions and fire the callback again. This will be repeated as long as new solutions are loaded during the callback. You can check the
CALLBACKCOUNT_OPTNODE attribute if you only want to run once.
7. The provided solution must be in the input space.
Related topics
© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the
property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not
convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except
solely for internal evaluation purposes to determine whether to purchase a license to the software
described in this documentation, or as otherwise set forth in a written software license agreement
between you and FICO (or a FICO affiliate). Use of this documentation and the software described in
it must conform strictly to the foregoing permitted uses, and no other use is permitted.