MIP Solution Pool

The solver always find multiple feasible solutions in the process of solving a MIP problem with Branch and Bound method. COPT provides a solution pool for MIP problem, from which users can obtain solutions and the corresponding objective function values.

COPT provides functions that users can get the iSol th solution’s objective function value and solution values (of specified variables) by specifying the following parameters.

  • iSol: Index of the solution to obtain. (0-based)

  • vars: Variables

The functions in different APIs are shown in Table 23:

Table 23 Get solutions and objective values from solution pool

API

Get solution

Get objective value

C

COPT_GetSolution

COPT_GetPoolObjVal

C++

Model::GetPoolSolution()

Model.GetPoolSolution()

C#

Model.GetPoolSolution()

Model.GetPoolSolution()

Java

Model.getPoolSolution()

Model.getPoolObjVal()

Python

Model.getPoolSolution()

Model.getPoolObjVal()

Note: Regarding the operations of solution pool, their function names, calling methods, and parameter names are slightly different in different programming interfaces, but the implementation of functions and meanings of parameter are the same.

Attributes of Solution Pool

  • PoolSols

    Integer attribute

    Number of solutions in the solution pool.