Solution querying
Generally, users will want to query stored solutions for their solution values. The values for solutions can be written to file or passed to the user in memory using the XPRS_msp_writeslxsol and XPRS_msp_getsol calls, respectively.
The user may be interested in abstract attributes of the solutions and the MIP solution pool itself. For example, the user may want to know the number of solutions stored in the solution pool or the number of non-zero values in a solution. They may also be interested in the objective value of a solution with respect to a given problem or they may want to know how many feasible solutions the MIP solution pool contains for a given problem. The user may perhaps also want to get the list of solutions that are feasible for a given problem. The following sections discuss the various classes of these attributes and how they are accessed.
Solution value output to file and memory
The solution values are accessed in two ways. They are written to file using the routine XPRS_msp_writeslxsol and they are retrieved in memory using the routine XPRS_msp_getsol.
The routine XPRS_msp_writeslxsol allows one or more solution to be written to file. If XPRS_msp_writeslxsol is passed with a problem (XPRSprob) pointer then the user can specify that (i) a particular solution is written out, (ii) the best solution for the problem is written out or (iii) all feasible solutions for the problem are written out. If no problem pointer is provided then the user can specify that (i) a particular solution is written out or (ii) all solutions are written out. The output .slx file has a format based on the MPS format. Each solution has a section in the .slx file starting with the string 'NAME' followed on the same line by the name of the solution. The records of each section each correspond to the solution value at the associated position in the solution array. If a problem is provided in the call then the column name is taken from the given problem for the index position and is written out followed by the solution value; otherwise column names are generated automatically based on a one-based indexing of the solution values.
The routine XPRS_msp_getsol provides in memory access to the values of a particular solution. The routine can return all solution values or solution values over a range of indices.
Attributes
A MIP solution pool and its set of stored solutions have various attributes the user can query. For example, the user can query the number of solutions stored in the solution pool or the number of non-zeros in a solution. They may also, for example, query the objective value of a solution with respect to a given problem or how many feasible solutions the MIP solution pool contains for a given problem.
There are four classes of attributes:-
- MIP solution pool attributes.
- Solution attributes.
- Solution and problem pair attributes.
- Problem attributes.
Each class relates to a different set of entities in the data model of the MIP solution pool and has a particular associated routine for accessing the attribute values. The following sections discuss the attributes.
MIP solution pool attributes
These are attributes relating to the MIP solution pool as a whole. For example, the number of solutions stored in the solution pool. These attributes are accessed using routines XPRS_msp_getintattrib and XPRS_msp_getdblattrib.
Solution attributes
These are attributes relating to a particular solution. For example, the number of non-zero values in a solution. These attributes are accessed using routines XPRS_msp_getintattribsol and XPRS_msp_getdblattribsol.
Problem attributes
These are attributes relating to the set of solutions with respect to a particular problem. For example, how many solutions the MIP solution pool contains that have the same number of columns as a given problem. These attributes are accessed using routines XPRS_msp_getintattribprob and XPRS_msp_getdblattribprob.
Solution and problem pair attributes
These are attributes relating to a solution and problem pair. For example, the objective value of a solution with respect to a given problem. These attributes are accessed using routines XPRS_msp_getintattribprobsol and XPRS_msp_getdblattribprobsol.
The attributes here are a function of a solution and problem pair. However, the user may be interested in the maximum or minimum value of an attribute over all solutions for a given problem. For example, the minimum objective value of any stored solution with respect to a given problem. The values for the attributes in this case are accessed using routines XPRS_msp_getintattribprobextreme and XPRS_msp_getdblattribprobextreme. These routines are special in that, as well as the returning attribute value, they also return the ID of a solution that achieves the attribute value.
© 2001-2020 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.