Managing the Solution Repository
The solution repository
The GMP library maintains a solution repository for every generated mathematical program instance. You can use this repository, for instance, to store
a number of starting solutions for a NLP problem to be solved successively,
a number of incumbent solutions as reported by a MIP solver, or
let a solver store multiple solutions.
If you are using solver sessions to initiate a solver, you must
explicitly transfer the initial, intermediate or final solutions between
the model, the solution repository and the solver session. As discussed
in Managing Generated Mathematical Program Instances, the function GMP::Instance::Solve
performs these necessary solution transfer steps for you, and uses the
fixed solution number 1 for all of its communication.
Some solvers are capable of finding multiple solutions instead of at most one. Examples of such solvers are BARON, COPT, CPLEX and Gurobi. When such a solver finds multiple solutions, these solutions are stored in the solution repository from number 1 on upwards. The control mechanism to let solvers find multiple solutions is solver specific:
BARON 21
: For more information see the Help file for optionNumber of best solutions
in option categorySpecific solvers
-BARON 21
-General
.COPT 6.0
: For more information see the Help file for optionPool size
in option categorySpecific solvers
-COPT 6.0
-MIP
.CPLEX 22.1
: For more information see the Help file for optionDo populate
in option categorySpecific solvers
-CPLEX 22.1
-MIP solution pool
.Gurobi 10.0
: For more information see the Help file for optionPool search mode
in option categorySpecific solvers
-Gurobi 10.0
-Solution pool
.
Solution repository functions
The procedures and functions of the GMP::Solution
namespace are
listed in this table. Through these functions you can
transfer a solution between the solution repository on the one side and the symbolic model or the solver on the other side,
obtain and set solution properties of a solution in the repository, or
perform a feasibility check on a solution in the repository.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Solution contents
Each solution in the repository is represented by a solution vector containing all relevant solution data, such as
solution status,
level values,
basis information,
marginals, and
other relevant requested sensitivity information.
Solution numbering
Each generated mathematical program instance has its own associated
solution repository. Each solution in the repository is represented by
an integer solution number. Through the function
GMP::Solution::GetSolutionsSet
you can retrieve a subset of the
predefined set Integers
containing the set of all solution numbers
that are currently in use for the given mathematical program instance.
Solution transfer to the model
Through the functions
you can (re-)initialize a solution with the values currently contained
in the symbolic model, and vice versa. The function
SendToModelSelection
allows you to only initialize a part of the
model identifiers and suffices with a solution of from the solution
repository.
Solution transfer to a solver session
Through the functions
you can set a solution in the repository equal to a solution reported by a given solver session, or initialize the (initial) solution of a solver session with a solution stored in the repository. Notice that these functions do not have a GMP argument. Because each solver session is uniquely associated with a single mathematical program instance, AIMMS is able to determine the correct solution repository.
Computing first order derivatives
Using the function GMP::Solution::GetFirstOrderDerivative
, you can
compute, for the given solution, first order derivative of a particular
row in a mathematical program with respect to a given variable. You can
use such a function, for instance, to implement a sequential linear
programming approach for nonlinear programs, as outlined in
Sequential Linear Programming.