Reference manual

FICO Xpress OptimizationR

MIP Solution Pool
Reference manual
Release 31.01

Last update 04 April 2017www.fico.com

Make every decision countTM

This material is the confidential, proprietary, and unpublished property of Fair Isaac Corporation.
Receipt or possession of this material does not convey rights to divulge, reproduce, use, or allow
others to use it without the specific written authorization of Fair Isaac Corporation and use must
conform strictly to the license agreement.
The information in this document is subject to change without notice. If you find any problems inthis documentation, please report them to us in writing. Neither Fair Isaac Corporation nor its
affiliates warrant that this documentation is error-free, nor are there any other warranties withrespect to the documentation except as may be provided in the license agreement.
©1983–2017 Fair Isaac Corporation. All rights reserved. Permission to use this software and its
documentation is governed by the software license agreement between the licensee and Fair Isaac
Corporation (or its affiliate). Portions of the program may contain copyright of various authors andmay be licensed under certain third-party licenses identified in the software, documentation, orboth.
In no event shall Fair Isaac Corporation or its affiliates be liable to any person for direct, indirect,
special, incidental, or consequential damages, including lost profits, arising out of the use of thissoftware and its documentation, even if Fair Isaac Corporation or its affiliates have been advised ofthe possibility of such damage. The rights and allocation of risk between the licensee and Fair Isaac
Corporation (or its affiliates) are governed by the respective identified licenses in the software,
documentation, or both.
Fair Isaac Corporation and its affiliates specifically disclaim any warranties, including, but not limited
to, the implied warranties of merchantability and fitness for a particular purpose. The software andaccompanying documentation, if any, provided hereunder is provided solely to users licensed under
the Fair Isaac Software License Agreement. Fair Isaac Corporation and its affiliates have no
obligation to provide maintenance, support, updates, enhancements, or modifications except as
required to licensed users under the Fair Isaac Software License Agreement.
FICO and Fair Isaac are trademarks or registered trademarks of Fair Isaac Corporation in the UnitedStates and may be trademarks or registered trademarks of Fair Isaac Corporation in other countries.
Other product and company names herein may be trademarks of their respective owners.
Xpress-Optimizer
Deliverable Version: A
Last Revised: 04 April 2017
Version 31.01

ContentsI

MIP Solution Pool

1

1 Introduction
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Solution input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3.1 Attaching problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3.2 Input from file and from memory . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4 Solution querying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.1 Solution value output to file and memory . . . . . . . . . . . . . . . . . . . . . .
1.4.2 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.3 MIP solution pool attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.4 Solution attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.5 Problem attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.6 Solution and problem pair attributes . . . . . . . . . . . . . . . . . . . . . . . . .
1.5 Getting lists of solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.6 Control options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.6.1 Duplicate solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2
2
2
3
4
5
5
6
6
6
6
7
7
7
7
7

2 MSP Functions
XPRS_msp_addcbmsghandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_delsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_findsolbyname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getcbmsghandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getdblattrib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getdblattribprob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getdblattribprobextreme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getdblattribprobsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getdblattribsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getdblcontrol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getdblcontrolsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getintattrib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getintattribprob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getintattribprobextreme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getintattribprobsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getintattribsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getintcontrol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getintcontrolsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getlasterror . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getsollist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_getsollist2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
36

Fair Isaac Corporation Confidential and Proprietary Informationi

Contents

XPRS_msp_getsolname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_loadsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_probattach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_probdetach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_readslxsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_removecbmsghandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_setcbmsghandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_setdblcontrol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_setdblcontrolsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_setintcontrol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_setintcontrolsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_setsolname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_msp_writeslxsol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38
39
40
41
42
43
44
45
46
47
48
49
50

3 MSP Control Parameters
MSP_DEFAULTUSERSOLFEASTOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_DEFAULTUSERSOLMIPTOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_DUPLICATESOLUTIONSPOLICY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_INCLUDEPROBNAMEINLOGGING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOL_BITFIELDSUSR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOL_FEASTOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOL_MIPTOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

51
51
52
52
52
52
53
53

4 MSP Attributes
MSP_PRB_FEASIBLESOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_PRB_VALIDSOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_BIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_COLUMN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_DELAYEDROW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_INT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_MIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_PI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_PRIMAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_SC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_SET1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_SET2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_SI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFCNT_SLACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFEASCOUNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMAX_BIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMAX_COLUMN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMAX_DELAYEDROW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMAX_INT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMAX_PI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMAX_SC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMAX_SET1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMAX_SET2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMAX_SI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMAX_SLACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMXI_BIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMXI_COLUMN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMXI_DELAYEDROW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMXI_INT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMXI_PI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMXI_SC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

54
56
57
57
57
57
57
57
58
58
58
58
58
58
59
59
59
59
59
59
60
60
60
60
60
60
61
61
61
61
61
61

Fair Isaac Corporation Confidential and Proprietary Informationii

ContentsII

MSP_SOLPRB_INFMXI_SET1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMXI_SET2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMXI_SI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFMXI_SLACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_BIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_COLUMN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_DELAYEDROW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_INT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_MIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_PI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_PRIMAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_SC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_SET1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_SET2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_SI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_INFSUM_SLACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLPRB_OBJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOLUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOL_BITFIELDSSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOL_COLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOL_ISREPROCESSEDUSERSOLUTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOL_ISUSERSOLUTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSP_SOL_NONZEROS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

62
62
62
62
62
62
63
63
63
63
63
63
64
64
64
64
64
64
65
65
65
65
65

MIP Solution Enumerator

66

5 Introduction
5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Applications: N-Best Solutions Example . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.3 Presolve considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.4 Basic customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5 Advanced customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6 Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

67
67
67
68
69
69
70

6 MSE Functions
XPRS_mse_addcbmsghandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_defaulthandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_getcbmsghandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_getcullchoice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_getdblattrib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_getdblcontrol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_getintattrib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_getintcontrol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_getlasterror . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_getsolbasename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_getsollist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_getsolmetric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_maxim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_minim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_opt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_removecbmsghandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_setcbgetsolutiondiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

71
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

Fair Isaac Corporation Confidential and Proprietary Informationiii

Contents

XPRS_mse_setcbmsghandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_setdblcontrol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_setintcontrol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XPRS_mse_setsolbasename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

93
94
95
96

7 MSE Controls
MSE_CALLBACKCULLSOLS_DIVERSITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSE_CALLBACKCULLSOLS_MIPOBJECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSE_CALLBACKCULLSOLS_MODOBJECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSE_OPTIMIZEDIVERSITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MSE_OUTPUTTOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

97
97
98
98
98
99

8 MSE Attributes
100
MSE_DIVERSITYSUM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
MSE_METRIC_DIVERSITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
MSE_METRIC_MIPOBJECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
MSE_METRIC_MODOBJECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
MSE_SOLUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

Appendix

102

A Error codes
103
A.1 MIP Solution Pool errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
A.2 MIP Solution Enumerator errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
B Contacting FICO
109
Product support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Product education . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Product documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Sales and maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Related services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
About FICO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

Index

Fair Isaac Corporation Confidential and Proprietary Information

111

iv

I. MIP Solution PoolC HAPTER 1

Introduction
1.1

Overview
The MIP solution pool (XPRSmipsolpool) stores the column solution values for multiple solutions.
No slack or dual information is stored with the solutions. The solutions will usually be for MIP
problems although the pool will store any arbitrary length vector of double values. Solutions canbe read into the MIP solution pool by the user via the file reader routine
XPRS_msp_readslxsol or from memory via the XPRS_msp_loadsol routine. Solutions can also be
captured automatically from problems (XPRSprob) as they are found during a search.
Since the XPRSprob problems only store the best MIP solution the MIP solution pool is useful when
the user is interested in more than one MIP solution for a problem. This can happen when there
are constraints or costs not reflected in the problem that the user wants to use to select a solution
from a set that have been found by the FICO Xpress Optimizer.
Once a MIP solution pool contains some solutions the user can query for the solution values andalso for more abstract attributes such as the objective value of the solution with respect to agiven problem. Apart from querying information for a single solution the user has various
options for managing the set of stored solutions. The user can query for lists of stored solutions.
They may delete solutions from the pool and output solutions to file. Also, a set of policies areavailable to the user for automatically handling the exclusion of solutions that are duplicated.
The following sections discuss the MIP solution pool functionality and provide some hints on
usage.

1.2

Data Model
The UML diagram in Figure 1.1 outlines the relationships the XPRSmipsolpool has with someother data entities.
Starting from the bottom right the diagram shows that the XPRSmipsolpool contains 0 or more
solutions. Solutions are loaded into the MIP solution pool as a dense vector of double values.
Solution vectors of varying length can be stored in the same MIP solution pool so each solution
stores the number of columns nCols for the solution. When solutions are loaded they are storedwith a name and an ID number. The names of the stored solutions are maintained so they are
unique among the current set of stored solutions. The IDs are generated using a counter startingfrom 1 and are therefore unique over all solutions ever to be stored in the MIP solution pool.
Note that no mapping of column names to column index values is stored with the solutions.
Therefore, the solutions are stored as plain vectors of implicitly indexed values. Note that
although the array of solution values Vals is represented in the Solution object in the diagram asa dense array of doubles the solutions are stored in a compact form.

Fair Isaac Corporation Confidential and Proprietary Information2

Introduction

Figure 1.1:

Moving to the top right the diagram shows that the XPRSmipsolpool references 0 or more
XPRSprob problems and that an XPRSprob references at most 1 XPRSmipsolpool. This relationship ismanaged through the "attaching" of problems to the MIP solution pool, which we discuss insection "Attaching problems". Note that by attaching problems it is possible, for example, toautomatically capture MIP solutions from the problems as they are found by the solver.
Finally, moving to the top left the diagram shows the object defining the global entities for a
problem. Clearly the XPRSprob has one of these (even if it is empty in the case of an LP problem).
The XPRSmipsolpool may capture one of these from an attached problem and uses it only todetect duplicate solutions. We discuss duplicate solutions in section "Duplicate solutions".
Once the MIP solution pool contains some solutions the user can administer the stored solutions
using the following functionality:-

1.3



Solution names can be changed using the routine XPRS_msp_setsolname.



Solutions can be deleted from the MIP solution pool by calling XPRS_msp_delsol with the IDof the solution to delete.



A mapping between solution name and ID is provided with the routines
XPRS_msp_findsolbyname and XPRS_msp_getsolname.



Attributes of the solutions can be accessed using routines XPRS_msp_getsol,
XPRS_msp_getdblattribprobsol, XPRS_msp_getintattribprobsol,
XPRS_msp_getdblattribsol, XPRS_msp_getintattribsol,
XPRS_msp_getdblattribprob, XPRS_msp_getintattribprob,
XPRS_msp_getdblattribprobextreme and XPRS_msp_getintattribprobextreme.



Lists of solution IDs can be generated based on attributes of the solutions with respect to agiven problem using the routine XPRS_msp_getsollist.

Solution input
Solutions can be input into the MIP solution pool from file, from memory and they can be

Fair Isaac Corporation Confidential and Proprietary Information

3

Introduction

captured automatically by the MIP solution pool directly from XPRSprob problems. The following
two sections discuss this functionality.

1.3.1

Attaching problems
Of the more useful features of the MIP solution pool type has the ability to ’attach’ XPRSprob
problems to a MIP solution pool with a call to XPRS_msp_probattach. Once a problem is attached
to a MIP solution pool they interact automatically with useful functions. For example, when an
attached problem finds a solution it automatically stores the solution into the MIP solution pool.
As illustrated in the UML data model diagram a MIP solution pool can have one or more attachedproblems although a problem can only be attached to at most one MIP solution pool. The
attached problems do not need to be copies of each other and they do not need to have thesame number of columns.
The MIP solution pool ensures each solution is automatically loaded to all attached problems withthe same number of columns as the solution. Solutions are loaded to a problem when the solver
is running the problem with XPRSminim (p.285 of the Optimizer Reference Manual )/XPRSmaxim(p.285 of the Optimizer Reference Manual )/XPRSglobal (p.238 of the Optimizer Reference
Manual ). The solver can then use the loaded solutions to update the best solution and/or as aseed for heuristic searches.
Solutions loaded directly from attached problems (compared with solutions loaded by the userfrom file or from memory) are marked with the MSP_SOL_ISUSERSOLUTION solution attribute set to0.
Note that problems are automatically detached from their MIP solution pool when they aredestroyed (with a call to XPRSdestroyprob (p.163 of the Optimizer Reference Manual ). A MIP
solution pool automatically detaches all problems when it is destroyed (with a call to
XPRS_msp_destroy).
Example:#include <stdio.h>#include <stdio.h>#include "xprs.h"
int main(int argc, char **argv) {XPRSprob prob;
XPRSmipsolpool msp;
int i, nSols, nCols, iSolutionId, iSolutionIdStatus;
double dObj, dSol;
const char *sProblem = argv[1];
XPRSinit(NULL);
XPRScreateprob(&prob);
XPRSreadprob(prob, sProblem, "");XPRS_msp_create(&msp);
XPRS_msp_probattach(msp, prob);
XPRSmaxim(prob, "g");XPRS_msp_getintattrib(msp, XPRS_MSP_SOLUTIONS, &nSols);
if(nSols) {XPRS_msp_getdblattribprobextreme(msp, prob, 0, &iSolutionId, XPRS_MSP_SOLPRB_OBJ,&dObj);
printf("Optimal Solution ID: %i\n", iSolutionId);

Fair Isaac Corporation Confidential and Proprietary Information

4

Introduction

printf("Optimal Objective: %12.5f\n", dObj);XPRS_msp_getintattribsol(msp, iSolutionId, &iSolutionIdStatus, XPRS_MSP_SOL_COLS,&nCols);for(i = 0; i < nCols; i++) {XPRS_msp_getsol(msp, iSolutionId, &iSolutionIdStatus, &dSol, i, i, NULL);
printf("%3i = %12.5f\n", i, dSol);}}
XPRSdestroyprob(prob);
XPRS_msp_destroy(msp);
XPRSfree();
}

1.3.2

Input from file and from memory
Solutions can be input into the MIP solution pool via the file reader routine
XPRS_msp_readslxsol or from memory via the XPRS_msp_loadsol routine. When solutions areloaded in these ways the user is returned the ID(s) of the stored solutions. When solutions are
input from memory via XPRS_msp_loadsol only one solution is stored per call and the user isreturned the ID of the stored solution each time. When solutions are input from file via
XPRS_msp_readslxsol the user is returned the first and last ID of the set of solutions that weresuccessfully stored.
Note that solutions are not stored with a mapping of column name to solution index. Therefore,
once a solution is stored the user is responsible for mapping the solution values against any
column names. The indexing of the solution values is determined when the solution is loaded.
When loading solutions from memory with a call to XPRS_msp_loadsol, the solution values areindexed by their position in the dense array. Similarly, solutions loaded automatically to the MIP
solution pool from a problem are also indexed in this way.
When loading solutions from .slx file using XPRS_msp_readslxsol the file format has column
name/solution value pairs. Solution values may be mapped to solution index using a runtime
supplied name map object of type XPRSnamelist passed in the call to
XPRS_msp_readslxsol. The XPRSnamelist object is typically obtained from an XPRSprob by calling
XPRSgetnamelistobject (p.210 of the Optimizer Reference Manual ) on the problem to get thecolumn name list (type 2). If the XPRSnamelist object is passed as NULL the solution values areindexed by the order they are encountered in the file.
Solutions loaded by the user from file or from memory (compared with solutions loaded directlyfrom attached problems) are marked with the MSP_SOL_ISUSERSOLUTION solution attribute set to 1.

1.4

Solution querying
Generally, users will want to query stored solutions for their solution values. The values forsolutions 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 ofa 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

Fair Isaac Corporation Confidential and Proprietary Information

5

Introduction

various classes of these attributes and how they are accessed.

1.4.1

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 theuser 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 filestarting with the string ’NAME’ followed on the same line by the name of the solution. The recordsof 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.

1.4.2

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 withrespect to a given problem or how many feasible solutions the MIP solution pool contains for agiven 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.

1.4.3

MIP solution pool attributes
These are attributes relating to the MIP solution pool as a whole. For example, the number ofsolutions stored in the solution pool. These attributes are accessed using routines
XPRS_msp_getintattrib and XPRS_msp_getdblattrib.

1.4.4

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.

Fair Isaac Corporation Confidential and Proprietary Information

6

Introduction

1.4.5

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 ofcolumns as a given problem. These attributes are accessed using routines
XPRS_msp_getintattribprob and XPRS_msp_getdblattribprob.

1.4.6

Solution and problem pair attributes
These are attributes relating to a solution and problem pair. For example, the objective value of asolution 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 beinterested 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 agiven 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.

1.5

Getting lists of solutions
Apart from just getting an attribute value for a given solution and problem (using the functions
XPRS_msp_getintattribprobsol and XPRS_msp_getdblattribprobsol) the user may also beinterested in how an attribute behaves over a set of solutions. For example, the user may want
the objective function values for the solutions with respect to a given problem. Another example
may be that the user wants the MIP infeasibilities of the solutions with respect to a given
problem.
The function XPRS_msp_getsollist is used to query for a list of solutions based on an attribute.
The solutions are returned as a list of solution IDs. The user can choose to rank the returned
solutions by their attribute values and they may also choose to return solutions in a range of theranked ordering of the solutions. The user can, for example, get the objective functions of thesolutions ranked in ascending order so they can find the one (or more) solutions that have theminimum objective value.
Note that XPRS_msp_getsollist will only return solutions for which the attribute is relevant. For
example, if the user queries on the objective function values then only feasible solutions of the
problem are returned. If, for example, the users queries on MIP infeasibilities then only thosesolutions with any MIP infeasibilities are returned.
A function XPRS_msp_getsollist2, similar to XPRS_msp_getsollist, provides the user withadditional filtering control on the returned list of solution IDs.

1.6

Control options

1.6.1

Duplicate solutions
Handling solution duplicates is an issue of particular relevance to the storage of solutions. Firstly,
it is an issue with regards to the efficient use of the storage memory. It is also an issue withregards to how the set of stored solutions for a problem reflects the properties of the problem.
For example, consider that we query, using XPRS_msp_getsollist, the solution pool looking for
MIP solutions of a problem and we find 10 solutions with the same, optimal MIP objective for the

Fair Isaac Corporation Confidential and Proprietary Information

7

Introduction

problem. We may believe that the problem has multiple optimal MIP solutions. However, if thesesolutions are all duplicates then there is only one solution and we do not have proof the problem
has multiple optimal solutions.
The MIP solution pool provides a set of policies the user can choose as an integer control
parameter MSP_DUPLICATESOLUTIONSPOLICY for automatically handling the exclusion of solutions
that are duplicated. These are:

Keep all: There is no checking for duplicate solutions.



Exact: Solution pairs are the same if all variables have exactly the same value. Duplicatessolutions are discarded.



Exact and rounded: Solution pairs are the same if all continuous variables have exactly thesame value and the global component of the solution matches i.e., matches withintolerance. Duplicates solutions are discarded.

Rounded only: Solution pairs are the same if the global components of the solutions match.
Duplicates solutions are discarded.

When the policy requires duplicate solutions be discarded the MIP solution pool compares all
pairs of solutions to determine duplicates. If a solution is found to be duplicated by anothersolution then the solution with the larger solution id value is discarded i.e., a solution that isstored earlier is kept in place of a later, duplicate solution.
The global component of the solutions is determined by the global model of one of the’attached’ problems. The attached problem that defines the global model is the first problem to
be attached to the MIP solution pool once the global model is undefined. The global model is
undefined when the MIP solution pool is first created and after the problem currently defining
the global model is ’detached’.
When comparing the global component of two solutions there are two types of tolerance used.
The MIPTOL (p.428 of the Optimizer Reference Manual ) tolerance is used to define the roundedvalues of the variables and the FEASTOL (p.402 of the Optimizer Reference Manual ) tolerance isused to define when solution values are zero. Each solution has a control for each of thesetolerances identified by MSP_SOL_MIPTOL and MSP_SOL_FEASTOL. The user can access these control
values for a solution using XPRS_msp_getdblcontrolsol and
XPRS_msp_setdblcontrolsol.
The global component of a solution (assuming it is MIP feasible with respect to the global model)
is insensitive to small floating point variations in the values of the double solution variables e.g.,a binary variable in a solution pair is compared as if the double solution value was rounded to 0
or 1. Therefore, comparing the global components of two solutions will match more readily thancomparing the variable values with exact matches. As a result there will be no fewer solutions
discarded using the global components comparison than there will be discarded using exact value
matches (and likely there will be more solutions discarded). For this reason it is important to use
care when using the policies that include global component comparisons since it is possible thatsolutions of interest may be deleted from the pool. Note that this may be a problem in the casewhere there is more than one global model for the solutions being stored in the MIP solution
pool. We may delete solutions that are considered to be duplicates with regards to the global
model used by the pool but are not considered duplicates by the other global model.

Fair Isaac Corporation Confidential and Proprietary Information

8

C HAPTER 2

MSP Functions
XPRS_msp_addcbmsghandler Declares an output callback function, called every time a line ofmessage text is output by the MIP solution pool. This callback function
will be called in addition to any output callbacks already added by
XPRS_msp_addcbmsghandler.
p. 12
XPRS_msp_create

Sets up a new MIP solution pool object.

p. 13

XPRS_msp_delsol

Deletes a solution from the pool.

p. 14

XPRS_msp_destroy

Destroys a MIP solution pool object and its resources. The object will
generally be created by a call to the function XPRS_msp_create. p. 15

XPRS_msp_findsolbyname

Finds the id of a solution given the solution’s name.

XPRS_msp_getcbmsghandler Get the output callback function, as set by
XPRS_msp_setcbmsghandler.
XPRS_msp_getdblattrib

p. 16
p. 17

Provides read access to the values of double attributes associated with
the MIP solution pool.
p. 18

XPRS_msp_getdblattribprob Provides read access to the values of double attributes associatedwith the MIP solution pool with respect to the given problem.
p. 19
XPRS_msp_getdblattribprobextreme Retrieves the extreme value of a double attributeassociated with the set of solutions stored in the MIP solution poolevaluated with respect to the given problem. For example, the minimof the objective values of feasible solutions for the problem across thesolutions stored in the MIP solution pool.
p. 20
XPRS_msp_getdblattribprobsol Provides read access to the values of double attributes
associated with the MIP solution pool with respect to the given
solution stored in the MIP solution pool and the given problem. For
example, the objective value of the given solution with respect to thegiven problem.
p. 21
XPRS_msp_getdblattribsol Provides read access to the values of double attributes associated asolution stored in the MIP solution pool.
p. 22
XPRS_msp_getdblcontrol

Retrieves the value of a given double control parameter.

XPRS_msp_getdblcontrolsol
XPRS_msp_getintattrib

Retrieves the value of a given double control parameter.

p. 23
p. 24

Provides read access to the values of integer attributes associated with
the MIP solution pool.
p. 25

Fair Isaac Corporation Confidential and Proprietary Information

9

MSP Functions

XPRS_msp_getintattribprob Provides read access to the values of integer attributes associatedwith the MIP solution pool with respect to the given problem. For
example, the number of solutions in the MIP solution pool that arefeasible for the problem.
p. 26
XPRS_msp_getintattribprobextreme Retrieves the extreme value of an integer attributeassociated with the set of solutions stored in the MIP solution poolevaluated with respect to the given problem. For example, the minimof the count of column bound infeasibilities for solutions of the
problem taken across solutions stored in the MIP solution pool thathave at least one column bound infeasibility for the problem.
p. 27
XPRS_msp_getintattribprobsol Provides read access to the values of integer attributes
associated with the MIP solution pool with respect to the given
solution stored in the MIP solution pool and the given problem. For
example, the count of column bound infeasibilities for solutions of the
problem.
p. 28
XPRS_msp_getintattribsol Provides read access to the values of integer attributes associatedwith a solution stored in the MIP solution pool. For example, thenumber of columns in the solution.
p. 29
XPRS_msp_getintcontrol

Retrieves the value of a given integer control parameter.

XPRS_msp_getintcontrolsol

Retrieves the value of a given integer control parameter.

p. 30
p. 31

XPRS_msp_getlasterror

Gets the last error message.

XPRS_msp_getsol

Returns the solution values for a solution stored in the MIP solution
pool.
p. 33

XPRS_msp_getsollist

Returns a list of solution ids of solutions with the same number ofcolumns as prob_to_rank_against. The list may be sorted by the valueof some attribute of the solutions e.g., the objective function. The list
may be filtered to contain either only feasible solutions or only
infeasible solutions.
p. 34

XPRS_msp_getsollist2

Returns a list of solution ids of solutions with the same number ofcolumns as prob_to_rank_against. The list may be sorted by the valueof some attribute of the solutions e.g., the objective function. The list
may be filtered to contain either only feasible solutions or only
infeasible solutions. This function is the same as XPRS_msp_getsollist interms of the purpose described so far. The additional functionality
provided by XPRS_msp_getsollist2 is to allow the returned solutions to
be filtered logically on the values of MSP_SOL_BITFIELDSSYS and
MSP_SOL_BITFIELDSUSR.
p. 36

XPRS_msp_getsolname

Gets the name of a solution stored in a MIP solution pool.

p. 38

XPRS_msp_loadsol

Loads a solution into a MIP solution pool.

p. 39

XPRS_msp_probattach

Attaches a problem to a MIP solution pool.

p. 40

XPRS_msp_probdetach

Detaches a problem from a MIP solution pool that was previously
attached with a call to XPRS_msp_probattach.
p. 41

XPRS_msp_readslxsol

Reads one or more solutions from an ASCII solution file (.slx). Solution
files can be created with a call to XPRS_msp_writeslxsol.
p. 42

Fair Isaac Corporation Confidential and Proprietary Information

p. 32

10

MSP Functions

XPRS_msp_removecbmsghandler Removes an output callback function previously added by
XPRS_msp_addcbmsghandler. The specified callback function will nolonger be called after it has been removed.
p. 43
XPRS_msp_setcbmsghandler Declares an output callback function, called every time a line ofmessage text is output by a MIP solution pool object.
p. 44
XPRS_msp_setdblcontrol

Sets the value of a given double control parameter.

XPRS_msp_setdblcontrolsol
XPRS_msp_setintcontrol

Sets the value of a given double control parameter.

Sets the value of a given integer control parameter.

XPRS_msp_setintcontrolsol

Sets the value of a given integer control parameter.

p. 45
p. 46
p. 47
p. 48

XPRS_msp_setsolname

Changes the name of a solution stored in the MIP solution pool.

XPRS_msp_writeslxsol

Creates an ASCII solution file (.slx) using a similar format to MPS files.
The file can contain one or more solutions. These files can be read backinto a MIP solution pool using the XPRS_msp_readslxsol function. p. 50

Fair Isaac Corporation Confidential and Proprietary Information

p. 49

11

MSP Functions

XPRS_msp_addcbmsghandler
Purpose
Declares an output callback function, called every time a line of message text is output by the MIP
solution pool. This callback function will be called in addition to any output callbacks already
added by XPRS_msp_addcbmsghandler.
Synopsis
int XPRS_CC XPRS_msp_addcbmsghandler(XPRSmipsolpool msp, int (XPRS_CC *f_msghandler)(XPRSobject vXPRSObject, void * vUserContext, void * vSystemThreadId, const
char * sMsg, int iMsgType, int iMsgNumber), void * p, int priority);
Arguments
msp
The current MIP solution poolf_msghandler The callback function which takes six arguments, vXPRSObject, vUserContext,
vSystemThreadId, sMsg, iMsgType and iMsgNumber. Use a NULL value to cancel a
callback function.
vXPRSObject The object sending the message. Use XPRSgetobjecttypename (p.213 of the
Optimizer Reference Manual ) to get the name of the object type.
vUserContext The user-defined object passed to the callback function.
vSystemThreadId The system id of the thread sending the message caste to a void *.
sMsg
A null terminated character array (string) containing the message, which may simply
be a new line. When the callback is called for the first time sMsg will be a NULL
pointer.
iMsgType Indicates the type of output message:
1
information messages;
2(not used);3
warning messages;
4
error messages.
A negative value means the callback is being called for the first time.
iMsgNumber The number associated with the message. If the message is an error or a warningthen you can look up the number in the section Optimizer Error and Warning
Messages for advice on what it means and how to resolve the associated issue.
p
A user-defined object to be passed to the callback function.
priority An integer that determines the order in which multiple output callbacks will be
invoked. The callback added with a higher priority will be called before a callbackwith a lower priority. Set to 0 if not required.
Further information
To send messages to a log file the built in message handler XPRSlogfilehandler can be used. Thiscan be done with:
XPRS_msp_addcbmsghandler(msp, XPRSlogfilehandler, "log.txt");

Related topics
XPRS_msp_removecbmsghandler, XPRSgetobjecttypename (p.213 of the Optimizer Reference
Manual ).

Fair Isaac Corporation Confidential and Proprietary Information

12

MSP Functions

XPRS_msp_create
PurposeSets up a new MIP solution pool object.
Synopsis
int XPRS_CC XPRS_msp_create(XPRSmipsolpool *msp)
Argument
msp

Pointer to a variable holding the new MIP solution pool.

Further information
1. Calls to XPRS_msp_create must be made after the call to XPRSinit (p.252 of the Optimizer
Reference Manual ).
2. All MIP solution pools created using a call to XPRS_msp_create should be disposed of with a call to
XPRS_msp_destroy.
Related topics
XPRSinit (p.252 of the Optimizer Reference Manual ), XPRS_msp_destroy.

Fair Isaac Corporation Confidential and Proprietary Information

13

MSP Functions

XPRS_msp_delsol
PurposeDeletes a solution from the pool.
Synopsis
int XPRS_CC XPRS_msp_delsol(XPRSmipsolpool msp, const int iSolutionId, int * const
iSolutionIdStatus)
Arguments
msp
The current MIP solution pool.
iSolutionId The id of the solution to be deleted.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution which is deleted.
Further information
The user will obtain the solution id iSolutionId from interaction with the MIP solution pool via
functions such as XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme and XPRS_msp_getsollist.
Related topics
XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme, XPRS_msp_getsollist.

Fair Isaac Corporation Confidential and Proprietary Information

14

MSP Functions

XPRS_msp_destroy
PurposeDestroys a MIP solution pool object and its resources. The object will generally be created by acall to the function XPRS_msp_create.
Synopsis
int XPRS_CC XPRS_msp_destroy(XPRSmipsolpool msp)
Argumentmsp

MIP solution pool to be destroyed.

Related topics
XPRS_msp_create.

Fair Isaac Corporation Confidential and Proprietary Information

15

MSP Functions

XPRS_msp_findsolbyname
PurposeFinds the id of a solution given the solution’s name.
Synopsis
int XPRS_CC XPRS_msp_findsolbyname(XPRSmipsolpool msp, const char *sSolutionName, int*const iSolutionId)
Arguments
msp
The current MIP solution pool.
sSolutionName A null terminated string containing the name of the solution to find.
iSolutionId Pointer to the integer where the solution id will be returned. A value of 0 will be
returned if the solution name does not exist.
Further information
Names of solutions enter the MIP solution pool via functions such as XPRS_msp_loadsol,
XPRS_msp_setsolname and XPRS_msp_readslxsol. Solutions entering the MIP solution pool directlyfrom attached problems are given automatic names.
Related topics
XPRS_msp_loadsol, XPRS_msp_setsolname, XPRS_msp_getsolname, XPRS_msp_readslxsol.

Fair Isaac Corporation Confidential and Proprietary Information

16

MSP Functions

XPRS_msp_getcbmsghandler
PurposeGet the output callback function, as set by XPRS_msp_setcbmsghandler.
Synopsis
int XPRS_CC XPRS_msp_getcbmsghandler(XPRSmipsolpool msp, int (XPRS_CC**r_f_msghandler)(XPRSobject vXPRSObject, void * vUserContext, void * vSystemThreadId, const
char * sMsg, int iMsgType, int iMsgNumber), void **object);Arguments
msp
The current MIP solution pool.
r_f_msghandler Pointer to the memory where the callback function will be returned.
Related topics
XPRS_msp_setcbmsghandler.

Fair Isaac Corporation Confidential and Proprietary Information

17

MSP Functions

XPRS_msp_getdblattrib
Purpose
Provides read access to the values of double attributes associated with the MIP solution pool.
Synopsis
int XPRS_CC XPRS_msp_getdblattrib(XPRSmipsolpool msp, const int iAttribId, double *const Val)
Arguments
msp
The current MIP solution pool.
iAttribId Id of attribute whose value is to be returned. A full list of all available attributes may
be found in Chapter 4, or from the list in the xprs.h header file.
Val
Pointer to a double where the value of the attribute will be returned.
Related topics
XPRS_msp_getintattrib

Fair Isaac Corporation Confidential and Proprietary Information

18

MSP Functions

XPRS_msp_getdblattribprob
Purpose
Provides read access to the values of double attributes associated with the MIP solution pool withrespect to the given problem.
Synopsis
int XPRS_CC XPRS_msp_getdblattribprob(XPRSmipsolpool msp, XPRSprob prob, const int
iAttribId, double * const Dst)
Arguments
msp
The current MIP solution pool.
prob
Problem for which the attribute is required to be evaluated.
iAttribId Id of attribute whose value is to be returned. A full list of all available attributes may
be found in Chapter 4, or from the list in the xprs.h header file.
Dst
Pointer to a double where the value of the attribute will be returned.
Related topics
XPRS_msp_getintattribprob.

Fair Isaac Corporation Confidential and Proprietary Information

19

MSP Functions

XPRS_msp_getdblattribprobextreme
PurposeRetrieves the extreme value of a double attribute associated with the set of solutions stored in
the MIP solution pool evaluated with respect to the given problem. For example, the minim of
the objective values of feasible solutions for the problem across the solutions stored in the MIP
solution pool.
Synopsis
int XPRS_CC XPRS_msp_getdblattribprobextreme(XPRSmipsolpool msp, XPRSprob
prob_to_rank_against, const int bGet_Max_Otherwise_Min, int * const
iSolutionId, const int iAttribId, double * const ExtremeVal)
Arguments
msp
The current MIP solution pool.
prob_to_rank_against Problem for which the attribute is required to be evaluated.
bGet_Max_Otherwise_Min If set to a non-zero value the routine will return the maximum
attribute value; otherwise the minim attribute value will be returned.
iAttribId Id of attribute whose value is to be returned. A full list of all available attributes may
be found in Chapter 4, or from the list in the xprs.h header file.
iSolutionId The id of the solution for which the returned attribute value was evaluated withthe problem prob_to_rank_against.
ExtremeVal Pointer to a double where the value of the attribute will be returned.
Further information
1. This function returns objective values only for feasible solutions. For attributes representing
infeasibility this function returns a meaningful value only if there any solutions with an
infeasibility associated with the attribute. For example, if the attribute represents the sum ofcolumn bound infeasibilities for solutions in the MIP solution pool then a meaningful value isonly returned if there are any solutions with column bound infeasibilities for the problem.
2. The attributes accessed by this function are the same as those available through
XPRS_msp_getdblattribprobsol. That is, double attributes relating to a problem and solution
pair, e.g., the objective function value of a solution to the problem
3. If there is no value returned then the value of iSolutionId is set to 0; otherwise it will be thepositive id of the solution with the returned attribute value.
Related topics
XPRS_msp_getintattribprobextreme, XPRS_msp_getdblattribprobsol.

Fair Isaac Corporation Confidential and Proprietary Information

20

MSP Functions

XPRS_msp_getdblattribprobsol
Purpose
Provides read access to the values of double attributes associated with the MIP solution pool withrespect to the given solution stored in the MIP solution pool and the given problem. For example,
the objective value of the given solution with respect to the given problem.
Synopsis
int XPRS_CC XPRS_msp_getdblattribprobsol(MipSolPool msp, XPRSprob
prob_to_rank_against, const int iSolutionId, int * const iSolutionIdStatus,
const int iAttribId, double * const Dst)
Arguments
msp
The current MIP solution pool.
prob_context Problem for which the attribute iAttribId is required to be evaluated using
solution iSolutionId .
iSolutionId The id of the solution for which the attribute iAttribId is evaluated with respect
to the problem prob_context.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
iAttribId Id of attribute whose value is to be returned. A full list of all available attributes may
be found in Chapter 4, or from the list in the xprs.h header file.
Dst
Pointer to a double where the value of the attribute will be returned.
Further information
1. The user will obtain the solution id iSolutionId from interaction with the MIP solution pool via
functions such as XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme and XPRS_msp_getsollist.
2. The attributes accessed by this function are the same as those available through
XPRS_msp_getdblattribprobextreme. That is, double attributes relating to a problem and solution
pair, e.g., the objective function value of a solution to the problem
Related topics
XPRS_msp_getintattribprobsol, XPRS_msp_getdblattribprobextreme, XPRS_msp_findsolbyname,
XPRS_msp_getintattribprobextreme, XPRS_msp_getsollist.

Fair Isaac Corporation Confidential and Proprietary Information

21

MSP Functions

XPRS_msp_getdblattribsol
Purpose
Provides read access to the values of double attributes associated a solution stored in the MIP
solution pool.
Synopsis
int XPRS_CC XPRS_msp_getdblattribsol(XPRSmipsolpool msp, const int iSolutionId, int *const iSolutionIdStatus, const int iAttribId, double * const Dst)
Arguments
msp
The current MIP solution pool.
iSolutionId The id of the solution for which the attribute is to be returned.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
iAttribId Id of attribute whose value is to be returned. A full list of all available attributes may
be found in Chapter 4, or from the list in the xprs.h header file.
Dst
Pointer to a double where the value of the attribute will be returned.
Further information
The user will obtain the solution id iSolutionId from interaction with the MIP solution pool via
functions such as XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme and XPRS_msp_getsollist.
Related topics
XPRS_msp_getintattribsol, XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme, XPRS_msp_getsollist.

Fair Isaac Corporation Confidential and Proprietary Information

22

MSP Functions

XPRS_msp_getdblcontrol
PurposeRetrieves the value of a given double control parameter.
Synopsis
int XPRS_CC XPRS_msp_getdblcontrol(XPRSmipsolpool msp, const int iControlId, double *const Val)
Arguments
msp
The current MIP solution pool.
iControlId Id of control whose value is to be returned. A full list of all available controls may
be found in Chapter 4, or from the list in the xprs.h header file.
Val
Pointer to a double where the value of the control will be returned.
Related topics
XPRS_msp_getintcontrol, XPRS_msp_setdblcontrol, XPRS_msp_setintcontrol.

Fair Isaac Corporation Confidential and Proprietary Information

23

MSP Functions

XPRS_msp_getdblcontrolsol
PurposeRetrieves the value of a given double control parameter.
Synopsis
int XPRS_CC XPRS_msp_getdblcontrolsol(XPRSmipsolpool msp, int iSolutionId, int *iSolutionIdStatus, const int iControlId, double * const Val)
Arguments
msp
The current MIP solution pool.
iSolutionId The id of the solution for which the control is to be returned.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
iControlId Id of control whose value is to be returned. A full list of all available controls may
be found in Chapter 3, or from the list in the xprs.h header file.
Val
Pointer to a double where the value of the control will be returned.
Related topics
XPRS_msp_getintcontrolsol, XPRS_msp_setdblcontrolsol, XPRS_msp_setintcontrolsol.

Fair Isaac Corporation Confidential and Proprietary Information

24

MSP Functions

XPRS_msp_getintattrib
Purpose
Provides read access to the values of integer attributes associated with the MIP solution pool.
Synopsis
int XPRS_CC XPRS_msp_getintattrib(XPRSmipsolpool msp, const int iAttribId, int * const
Val)
Arguments
msp
The current MIP solution pool.
iAttribId Id of attribute whose value is to be returned. A full list of all available attributes may
be found in Chapter 4, or from the list in the xprs.h header file.
Val
Pointer to an integer where the value of the attribute will be returned.
Related topics
XPRS_msp_getdblattrib.

Fair Isaac Corporation Confidential and Proprietary Information

25

MSP Functions

XPRS_msp_getintattribprob
Purpose
Provides read access to the values of integer attributes associated with the MIP solution pool withrespect to the given problem. For example, the number of solutions in the MIP solution pool thatare feasible for the problem.
Synopsis
int XPRS_CC XPRS_msp_getintattribprob(XPRSmipsolpool msp, XPRSprob prob, const int
iAttribId, int * const Dst)
Arguments
msp
The current MIP solution pool.
prob
Problem for which the attribute is required to be evaluated.
iAttribId Id of attribute whose value is to be returned. A full list of all available attributes may
be found in Chapter 4, or from the list in the xprs.h header file.
Dst
Pointer to an integer where the value of the attribute will be returned.
Related topics
XPRS_msp_getdblattribprob.

Fair Isaac Corporation Confidential and Proprietary Information

26

MSP Functions

XPRS_msp_getintattribprobextreme
PurposeRetrieves the extreme value of an integer attribute associated with the set of solutions stored in
the MIP solution pool evaluated with respect to the given problem. For example, the minim of
the count of column bound infeasibilities for solutions of the problem taken across solutions
stored in the MIP solution pool that have at least one column bound infeasibility for the problem.
Synopsis
int XPRS_CC XPRS_msp_getintattribprobextreme(XPRSmipsolpool msp, XPRSprob
prob_to_rank_against, const int bGet_Max_Otherwise_Min, int * const
iSolutionId, const int iAttribId, int * const ExtremeVal)
Arguments
msp
The current MIP solution pool.
prob_to_rank_against Problem for which the attribute is required to be evaluated.
bGet_Max_Otherwise_Min If set to a non-zero value the routine will return the maximum
attribute value; otherwise the minim attribute value will be returned.
iAttribId Id of attribute whose value is to be returned. A full list of all available attributes may
be found in Chapter 4, or from the list in the xprs.h header file.
iSolutionId The id of the solution for which the returned attribute value was evaluated withthe problem prob_to_rank_against.
ExtremeVal Pointer to an integer where the value of the attribute will be returned.
Further information
1. For attributes representing infeasibility this function returns a meaningful value only if there any
solutions with an infeasibility associated with the attribute. For example, if the attribute
represents the count of column bound infeasibilities for solutions in the MIP solution pool then ameaningful value is only returned if there are any solutions with column bound infeasibilities forthe problem.
2. The attributes accessed by this function are the same as those available through
XPRS_msp_getintattribprobsol. That is, integer attributes relating to a problem and solution
pair, e.g., the count of column bound infeasibilities for solutions of the problem.
3. If there is no value returned then the value of iSolutionId is set to 0; otherwise it will be thepositive id of the solution with the returned attribute value.
Related topics
XPRS_msp_getdblattribprobextreme, XPRS_msp_getintattribprobsol.

Fair Isaac Corporation Confidential and Proprietary Information

27

MSP Functions

XPRS_msp_getintattribprobsol
Purpose
Provides read access to the values of integer attributes associated with the MIP solution pool withrespect to the given solution stored in the MIP solution pool and the given problem. For example,
the count of column bound infeasibilities for solutions of the problem.
Synopsis
int XPRS_CC XPRS_msp_getdblattribprobsol(MipSolPool msp, XPRSprob
prob_to_rank_against, const int iSolutionId, int * const iSolutionIdStatus,
const int iAttribId, double * const Dst)
Arguments
msp
The current MIP solution pool.
prob_context Problem for which the attribute iAttribId is required to be evaluated using
solution iSolutionId.
iSolutionId The id of the solution for which the attribute iAttribId is evaluated with respect
to the problem prob_context.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
iAttribId Id of attribute whose value is to be returned. A full list of all available attributes may
be found in Chapter 4, or from the list in the xprs.h header file.
Dst
Pointer to an integer where the value of the attribute will be returned.
Further information
1. The user will obtain the solution id iSolutionId from interaction with the MIP solution pool via
functions such as XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme and XPRS_msp_getsollist.
2. The attributes accessed by this function are the same as those available through
XPRS_msp_getintattribprobextreme. That is, integer attributes relating to a problem andsolution pair, e.g., the count of column bound infeasibilities for solutions of the problem.
Related topics
XPRS_msp_getdblattribprobsol, XPRS_msp_getintattribprobextreme, XPRS_msp_findsolbyname,
XPRS_msp_getdblattribprobextreme, XPRS_msp_getsollist.

Fair Isaac Corporation Confidential and Proprietary Information

28

MSP Functions

XPRS_msp_getintattribsol
Purpose
Provides read access to the values of integer attributes associated with a solution stored in the
MIP solution pool. For example, the number of columns in the solution.
Synopsis
int XPRS_CC XPRS_msp_getintattribsol(XPRSmipsolpool msp, const int iSolutionId, int *const iSolutionIdStatus, const int iAttribId, int * const Dst)
Arguments
msp
The current MIP solution pool.
iSolutionId The id of the solution for which the attribute is to be returned.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
iAttribId Id of attribute whose value is to be returned. A full list of all available attributes may
be found in Chapter 4, or from the list in the xprs.h header file.
Dst
Pointer to an integer where the value of the attribute will be returned.
Further information
The user will obtain the solution id iSolutionId from interaction with the MIP solution pool via
functions such as XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme and XPRS_msp_getsollist.
Related topics
XPRS_msp_getdblattribsol, XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme, XPRS_msp_getsollist.

Fair Isaac Corporation Confidential and Proprietary Information

29

MSP Functions

XPRS_msp_getintcontrol
PurposeRetrieves the value of a given integer control parameter.
Synopsis
int XPRS_CC XPRS_msp_getintcontrol(XPRSmipsolpool msp, const int iControlId, int *const Val)
Arguments
msp
The current MIP solution pool.
iControlId Id of control whose value is to be returned. A full list of all available controls may
be found in Chapter 3, or from the list in the xprs.h header file.
Val
Pointer to an integer where the value of the control will be returned.
Related topics
XPRS_msp_getdblcontrol, XPRS_msp_setdblcontrol, XPRS_msp_setintcontrol.

Fair Isaac Corporation Confidential and Proprietary Information

30

MSP Functions

XPRS_msp_getintcontrolsol
PurposeRetrieves the value of a given integer control parameter.
Synopsis
int XPRS_CC XPRS_msp_getintcontrolsol(XPRSmipsolpool msp, int iSolutionId, int *iSolutionIdStatus, const int iControlId, int * const Val)
Arguments
msp
The current MIP solution pool.
iSolutionId The id of the solution for which the control is to be returned.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
iControlId Id of control whose value is to be returned. A full list of all available controls may
be found in Chapter 3, or from the list in the xprs.h header file.
Val
Pointer to an integer where the value of the control will be returned.
Related topics
XPRS_msp_getdblcontrolsol, XPRS_msp_setdblcontrolsol, XPRS_msp_setintcontrolsol.

Fair Isaac Corporation Confidential and Proprietary Information

31

MSP Functions

XPRS_msp_getlasterror
PurposeGets the last error message.
Synopsis
int XPRS_CC XPRS_msp_getlasterror(XPRSmipsolpool msp, int * iMsgNumber, char * msg,
int iStringBufferBytes, int * iBytesInInternalString)Arguments
mse
The current MIP solution pool.
iMsgNumber
A pointer to an integer to return the number of the last error message. Can be
NULL if not required. Refer to Chapter 11 of the Optimizer Reference Manual for a listof possible error numbers, the errors and warnings that they indicate, and advice on
what they mean and how to resolve them.
msg
A character buffer of length at least iStringBufferBytes to return the error message.
Can be NULL if not required.
iStringBufferBytes The length of the msg buffer.
iBytesInInternalString A pointer to an integer to return the number of bytes required tostore the error message. Can be NULL if not required.
Related topics
Chapter 11 of the Optimizer Reference Manual , XPRS_msp_setcbmsghandler.

Fair Isaac Corporation Confidential and Proprietary Information

32

MSP Functions

XPRS_msp_getsol
PurposeReturns the solution values for a solution stored in the MIP solution pool.
Synopsis
int XPRS_CC XPRS_msp_getsol(XPRSmipsolpool msp, const int iSolutionId, int * const
iSolutionIdStatus, double x[], const int iColFirst, const int iColLast, int *const nValuesReturned)
Arguments
Msp
The current MIP solution pool.
iSolutionId The id of the required solution.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
x
Double array where the values of the solution will be returned. May be NULL if not
required.
iColFirst Index of the column whose solution value is to be returned in the first element ofarray x. If iColLast > iColFirst then any subsequent columns are to have theirvalues written to the subsequent elements of x.
iColLast If x is non-NULL then at most iColLast - iColFirst + 1 solution values will be
written to x. There will be fewer solution values written if iColLast is greater than orequal to the number of columns in the solution.
nValuesReturned Pointer to an integer where the number of solution values that were available
to be written is returned. This number will always be less than or equal to iColLast iColFirst + 1. A value is returned for this parameter regardless of whether x is
passed as NULL. May be NULL if not required.
Further information
1. It is an error condition if iColLast <iColFirst or iColFirst <0 or if iColFirst is greater than orequal to the number of columns in the solution.
2. The user will obtain the solution id iSolutionId from interaction with the MIP solution pool via
functions such as XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme and XPRS_msp_getsollist.
3. By passing x as NULL and setting iColFirst to 0 and iColLast to a large positive integer it ispossible to use XPRS_msp_getsol to obtain in the nValuesReturned parameter the number ofcolumns in the solution.
Related topics
XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme, XPRS_msp_getsollist.

Fair Isaac Corporation Confidential and Proprietary Information

33

MSP Functions

XPRS_msp_getsollist
PurposeReturns a list of solution ids of solutions with the same number of columns as
prob_to_rank_against. The list may be sorted by the value of some attribute of the solutions e.g.,the objective function. The list may be filtered to contain either only feasible solutions or only
infeasible solutions.
Synopsis
int XPRS_CC XPRS_msp_getsollist(XPRSmipsolpool msp, XPRSprob prob_to_rank_against,
const int iRankAttrib, const int bRankAscending, const int iRankFirstIndex,
const int iRankLastIndex, int iSolutionIds_Zb[], int * const nReturnedSolIds,
int * const nSols)
Arguments
msp
The current MIP solution pool.
prob_to_rank_against Problem for which the attribute iRankAttrib is evaluated in order torank the solution ids returned in the iSolutionIds array. Only solutions with the same
number of columns as prob_to_rank_against are considered when generating the listof solution ids. May be NULL if the IDs of all solutions are to be returned.
iRankAttrib Id of the attribute whose value is used to rank the solution ids returned in theiSolutionIds array. A full list of all available attributes may be found in Chapter 4, orfrom the list in the xprs.h header file. If the attribute represents infeasibility then
only infeasible solutions will be returned; otherwise only feasible solutions will be
returned. If iRankAttrib is passed in as 0, or if it is not a valid attribute id, then thesolution ids of feasible solutions for the problem will be returned unranked. If
iRankAttrib is not a valid attribute id then a warning is logged. This argument isignored if prob_to_rank_against is passed as NULL.
bRankAscending If set to a non-zero value the function returns the solution ids ordered inascending order of the attribute value; otherwise the solution ids are returned indescending order. This argument is ignored if prob_to_rank_against is passed as NULL
or if iRankAttrib is passed in as 0, or if it is not a valid attribute id.
iRankFirstIndex Index (one-based) in the rank order of solutions for which the associatedsolution’s id number, if there is a solution at this index, is to be returned in the firstelement of array iSolutionIds. If iRankLastIndex > iRankFirstIndex then any
subsequent solutions in the rank ordering are to have their solution ids written to thesubsequent elements of iSolutionIds.
iRankLastIndex If iSolutionIds is non-NULL then at most iRankLastIndex - iRankFirstIndex +1 solution ids will be written to iSolutionIds. There will be fewer solution ids written
if iRankLastIndex is greater than the number of solutions in the MIP solution pool.
iSolutionIds Integer array where the solution ids will be returned. May be NULL if not
required.
nReturnedSolIds Pointer to an integer where the number of solution ids that were available tobe written is returned. This number will always be less than or equal toiRankLastIndex - iRankFirstIndex + 1. A value is returned for this parameter
regardless of whether iSolutionIds is passed as NULL. May be NULL if not required.
nSols
Pointer to an integer where the total number of solution ids that could possibly be
written is returned. May be NULL if not required.

Fair Isaac Corporation Confidential and Proprietary Information

34

MSP Functions

Further information
1. If iRankFirstIndex > iRankLastIndex and the nSols argument is passed down as NULL then theroutine will return with no solution ids written.
2. Information about the solution with respect to the problem can be obtained via routines
XPRS_msp_getdblattribprobsol, XPRS_msp_getintattribprobsol, XPRS_msp_getdblattribsol and
XPRS_msp_getintattribsol. The solution values can be obtained via the routine XPRS_msp_getsol.
Related topics
XPRS_msp_getsollist2, XPRS_msp_getsol, XPRS_msp_getdblattribprobsol,
XPRS_msp_getintattribprobsol, XPRS_msp_getdblattribsol, XPRS_msp_getintattribsol.

Fair Isaac Corporation Confidential and Proprietary Information

35

MSP Functions

XPRS_msp_getsollist2
PurposeReturns a list of solution ids of solutions with the same number of columns as
prob_to_rank_against. The list may be sorted by the value of some attribute of the solutions e.g.,the objective function. The list may be filtered to contain either only feasible solutions or only
infeasible solutions. This function is the same as XPRS_msp_getsollist in terms of the purpose
described so far. The additional functionality provided by XPRS_msp_getsollist2 is to allow the
returned solutions to be filtered logically on the values of MSP_SOL_BITFIELDSSYS and
MSP_SOL_BITFIELDSUSR.
Synopsis
int XPRS_CC XPRS_msp_getsollist2(XPRSmipsolpool msp, XPRSprob prob_to_rank_against,
int iRankAttrib, int bRankAscending, int iRankFirstIndex_Ob, int
iRankLastIndex_Ob, int bUseUserBitFilter, int iUserBitMask, int
iUserBitPattern, int bUseInternalBitFilter, int iInternalBitMask, int
iInternalBitPattern, int iSolutionIds_Zb[], int * nReturnedSolIds, int * nSols)
Arguments
msp
The current MIP solution pool.
prob_to_rank_against Problem for which the attribute iRankAttrib is evaluated in order torank the solution ids returned in the iSolutionIds array. Only solutions with the same
number of columns as prob_to_rank_against are considered when generating the listof solution ids. May be NULL if the IDs of all solutions are to be returned.
iRankAttrib Id of the attribute whose value is used to rank the solution ids returned in theiSolutionIds array. A full list of all available attributes may be found in Chapter 4, orfrom the list in the xprs.h header file. If the attribute represents infeasibility then
only infeasible solutions will be returned; otherwise only feasible solutions will be
returned. If iRankAttrib is passed in as 0, or if it is not a valid attribute id, then thesolution ids of feasible solutions for the problem will be returned unranked. If
iRankAttrib is not a valid attribute id then a warning is logged. This argument isignored if prob_to_rank_against is passed as NULL.
bRankAscending If set to a non-zero value the function returns the solution ids ordered inascending order of the attribute value; otherwise the solution ids are returned indescending order. This argument is ignored if prob_to_rank_against is passed as NULL
or if iRankAttrib is passed in as 0, or if it is not a valid attribute id.
iRankFirstIndex Index (one-based) in the rank order of solutions for which the associatedsolution’s id number, if there is a solution at this index, is to be returned in the firstelement of array iSolutionIds. If iRankLastIndex > iRankFirstIndex then any
subsequent solutions in the rank ordering are to have their solution ids written to thesubsequent elements of iSolutionIds.
iRankLastIndex If iSolutionIds is non-NULL then at most iRankLastIndex iRankFirstIndex + 1 solution ids will be written to iSolutionIds. There will be fewer
solution ids written if iRankLastIndex is greater than the number of solutions in the
MIP solution pool.
bUseUserBitFilter Set this value to 1 if the solutions should be filtered by their
MSP_SOL_BITFIELDSUSR control values using the values of iUserBitMask andiUserBitPattern. If we let iBitFieldUser be the value of the MSP_SOL_BITFIELDSUSR
control for a solution then the solution will not be returned in the list if(iBitFieldUser & iUserBitMask) != iUserBitPattern. Set to 0 if filtering is not
required on the MSP_SOL_BITFIELDSUSR control values.
iUserBitMask Bit mask used to filter solutions by their MSP_SOL_BITFIELDSUSR control values.
iUserBitPattern Bit pattern used to filter solutions by their MSP_SOL_BITFIELDSUSR control

Fair Isaac Corporation Confidential and Proprietary Information

36

MSP Functions

values.
bUseInternalBitFilter Set this value to 1 if the solutions should be filtered by their
MSP_SOL_BITFIELDSSYS attribute values using the values of iInternalBitMask andiInternalBitPattern. If we let iBitFieldSys be the value of the
MSP_SOL_BITFIELDSSYS attribute for a solution then the solution will not be returnedin the list if (iBitFieldUser & iInternalBitMask) != iInternalBitPattern. Set to 0 if
filtering is not required on the MSP_SOL_BITFIELDSSYS attribute values.
iInternalBitMask Bit mask used to filter solutions by MSP_SOL_BITFIELDSSYS attribute values.
iInternalBitPattern Bit pattern used to filter solutions by MSP_SOL_BITFIELDSSYS attributevalues.
iSolutionIds Integer array where the solution ids will be returned. May be NULL if not
required.
nReturnedSolIds Pointer to an integer where the number of solution ids that were available tobe written is returned. This number will always be less than or equal toiRankLastIndex - iRankFirstIndex + 1. A value is returned for this parameter
regardless of whether iSolutionIds is passed as NULL. May be NULL if not required.
nSols
Pointer to an integer where the total number of solution ids that could possibly be
written is returned. May be NULL if not required.
Further information
1. If iRankFirstIndex > iRankLastIndex and the nSols argument is passed down as NULL then theroutine will return with no solution ids written.
2. Information about the solution with respect to the problem can be obtained via routines
XPRS_msp_getdblattribprobsol, XPRS_msp_getintattribprobsol, XPRS_msp_getdblattribsol and
XPRS_msp_getintattribsol. The solution values can be obtained via the routine XPRS_msp_getsol.
Related topics
XPRS_msp_getsollist, XPRS_msp_getsol, XPRS_msp_getdblattribprobsol,
XPRS_msp_getintattribprobsol, XPRS_msp_getdblattribsol, XPRS_msp_getintattribsol.

Fair Isaac Corporation Confidential and Proprietary Information

37

MSP Functions

XPRS_msp_getsolname
PurposeGets the name of a solution stored in a MIP solution pool.
Synopsis
int XPRS_CC XPRS_msp_getsolname(XPRSmipsolpool msp, const int iSolutionId, char*sname, const int iStringBufferBytes, int * const iBytesInInternalString, int *const iSolutionIdStatus)
Arguments
msp
The current MIP solution pool.
iSolutionId Id of the solution whose name is to be retrieved.
sname
Pointer to a string where the name of the solution (plus null terminator) will be
returned. This argument can be passed with NULL.
iStringBufferBytes Maximum number of bytes to be returned in sname.
iBytesInInternalString Pointer to the integer where the number of bytes required storing thename (including null terminator) will be returned.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
Further information
1. Names of solutions stored in a MIP solution pool are unique.
2. The user will obtain the solution id iSolutionId from interaction with the MIP solution pool via
functions such as XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme and XPRS_msp_getsollist.
3. Names of solutions enter the MIP solution pool via functions such as XPRS_msp_loadsol,
XPRS_msp_setsolname and XPRS_msp_readslxsol. Solutions entering the MIP solution pool directlyfrom attached problems are given automatic names.
Related topics
XPRS_msp_setsolname, XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme, XPRS_msp_getsollist.

Fair Isaac Corporation Confidential and Proprietary Information

38

MSP Functions

XPRS_msp_loadsol
PurposeLoads a solution into a MIP solution pool.
Synopsis
int XPRS_CC XPRS_msp_loadsol(XPRSmipsolpool msp, int * const iSolutionId, const double
x[], const int nCols, const char *sSolutionName, int * const
bNameModifiedForUniqueness, int * const bSolutionNotLoadedBecauseOfDuplication)
Arguments
msp
The current MIP solution pool.
iSolutionId Pointer to the integer where the id of the loaded solution will be returned.
x
Double array of length nCols containing the solution to be stored.
nCols
The number of elements in the solution array x.
sSolutionName The name to use to identify the solution to be stored. If the given name alreadyexists then the name to be stored will have characters appended to ensure theresulting name is unique among the stored solutions. If sSolutionName is passed as
NULL then a unique name will be generated automatically for the solution.
bNameModifiedForUniqueness Pointer to an integer returning 1 if it was necessary for the given
solution name sNewSolutionBaseName to be modified to maintain uniqueness ofsolution names; 0 otherwise.
bSolutionNotLoadedBecauseOfDuplication Pointer to an integer returning 1 if the solution was
rejected because it was found to a duplicate of an existing solution; 0 otherwise.
Further information
Information about the solution with respect to a problem can be obtained via routines
XPRS_msp_getdblattribprobsol, XPRS_msp_getintattribprobsol, XPRS_msp_getdblattribsol and
XPRS_msp_getintattribsol.
Related topics
XPRS_msp_getdblattribprobsol, XPRS_msp_getintattribprobsol, XPRS_msp_getdblattribsol,
XPRS_msp_getintattribsol.

Fair Isaac Corporation Confidential and Proprietary Information

39

MSP Functions

XPRS_msp_probattach
PurposeAttaches a problem to a MIP solution pool.
Synopsis
int XPRS_CC XPRS_msp_probattach(XPRSmipsolpool msp, XPRSprob prob)
Arguments
msp
prob

The current MIP solution pool.
Problem to be attached to the MIP solution pool.

Further information
1. The function will return successfully if the solution is already attached to the MIP solution pool.
2. One or more problems can be attached to the MIP solution pool. A problem can only be attached
to one MIP solution pool.
3. The function will return an error if the problem is already attached to another MIP solution pool.
4. The user can detach the problem from the MIP solution pool with a call to XPRS_msp_probdetach.
5. A problem is automatically detached from a MIP solution pool when it is destroyed. A MIP
solution pool automatically detaches all problems when it is destroyed.
Related topics
XPRS_msp_probdetach.

Fair Isaac Corporation Confidential and Proprietary Information

40

MSP Functions

XPRS_msp_probdetach
Purpose
Detaches a problem from a MIP solution pool that was previously attached with a call to
XPRS_msp_probattach.
Synopsis
int XPRS_CC XPRS_msp_probdetach(XPRSmipsolpool msp, XPRSprob prob)
Arguments
msp
prob

The current MIP solution pool.
Problem to be detached from the MIP solution pool.

Further information
The function will return successfully if the solution is not attached to the MIP solution pool.
Related topics
XPRS_msp_probattach.

Fair Isaac Corporation Confidential and Proprietary Information

41

MSP Functions

XPRS_msp_readslxsol
PurposeReads one or more solutions from an ASCII solution file (.slx). Solution files can be created witha call to XPRS_msp_writeslxsol.
Synopsis
int XPRS_CC XPRS_msp_readslxsol(XPRSmipsolpool msp, XPRSnamelist col_name_list, const
char * sFileName, const char *sFlags, int * const iSolutionId_Beg, int * const
iSolutionId_End)
Arguments
msp
The current MIP solution pool.
col_name_list An object used to map column names on to solution indices. May be NULL if not
required.
sFileName Null terminated string containing the file name from which the solution(s) are to beread.
sFlagsFlags for XPRS_msp_readslxsol. None currently.
iSolutionId_Beg Pointer to an integer returning the solution ID of the first solution successfully
loaded from the file. May be NULL if not required.
iSolutionId_End Pointer to an integer returning the solution ID of the last solution successfully
loaded from the file. May be NULL if not required.
Further information
1. The user can obtain a reference to the object mapping column names to indices for a problem bycalling XPRSgetnamelistobject (p.210 of the Optimizer Reference Manual ) with type 2. Passing
this object down to XPRS_msp_readslxsol means that only solutions in the .slx file with column
names contained in the mapping are loaded into the MIP solution pool. The loaded solutions will
have the same column count as the mapping. The values for any columns that do not have anentry in the .slx file for a solution are set to zero.
2. If col_name_list is passed as NULL then all solutions are read into the MIP solution pool using theposition of the solution value in the file section as the solution index.
Related topics
XPRS_msp_writeslxsol.

Fair Isaac Corporation Confidential and Proprietary Information

42

MSP Functions

XPRS_msp_removecbmsghandler
PurposeRemoves an output callback function previously added by XPRS_msp_addcbmsghandler. The
specified callback function will no longer be called after it has been removed.
Synopsis
int XPRS_CC XPRS_msp_removecbmsghandler(XPRSmipsolpool msp, int (XPRS_CC*f_msghandler)(XPRSobject vXPRSObject, void * vUserContext, void * vSystemThreadId, const
char * sMsg, int iMsgType, int iMsgNumber), void* object);Arguments
msp
The current MIP solution pool.
f_msghandler The callback function to remove. If NULL then all output callback functions addedwith the given user-defined object value will be removed.
objectThe object value that the callback was added with. If NULL, then the object value will
not be checked and all variable branching callbacks with the function pointerf_chgbranch will be removed.
Related topics
XPRS_msp_addcbmsghandler.

Fair Isaac Corporation Confidential and Proprietary Information

43

MSP Functions

XPRS_msp_setcbmsghandler
Purpose
Declares an output callback function, called every time a line of message text is output by a MIP
solution pool object.
Synopsis
int XPRS_CC XPRS_msp_setcbmsghandler(XPRSmipsolpool msp, int (XPRS_CC*f_msghandler)(XPRSobject vXPRSObject, void * vUserContext, void *vSystemThreadId, const char * sMsg, int iMsgType, int iMsgCode), void * p)
Arguments
msp
The current MIP solution pool.
f_msghandler The callback function which takes six arguments, vXPRSObject, vUserContext,
vSystemThreadId, sMsg, iMsgType and iMsgCode. Use a NULL value to cancel a callback
function.
vXPRSObject A generic pointer to the msp object sending the message.
vUserContext The user-defined object passed to the callback function.
vSystemThreadId The system id of the thread sending the message caste to a void *.
sMsg
A null terminated character array (string) containing the message, which may simply
be a new line. When the callback is called for the first time sMsg will be a NULL
pointer.
iMsgType Indicates the type of output message:
1
information messages;
2(not used);3
warning messages;
4
error messages.
A negative value means the callback is being called for the first time.
iMsgCode
The code associated with the message. If the message is an error or a warning then
you can look up the code in Chapter 11 of the Optimizer Reference Manual for advice
on what it means and how to resolve the associated issue.
p
A user-defined object to be passed to the callback function.
Further information
1. To send all messages to a log file the built in message handler XPRSlogfilehandler can be used.
This can be done with:
XPRS_msp_setcbmsghandler(msp, XPRSlogfilehandler, "log.txt");

2. The return value for this callback is ignored.
Related topics
None.

Fair Isaac Corporation Confidential and Proprietary Information

44

MSP Functions

XPRS_msp_setdblcontrol
PurposeSets the value of a given double control parameter.
Synopsis
int XPRS_CC XPRS_msp_setdblcontrol(XPRSmipsolpool msp, const int iControlId, const
double Val)
Arguments
msp
The current MIP solution pool.
iControlId Id of control whose value is to be set. A full list of all available controls may befound in Chapter 3, or from the list in the xprs.h header file.
Val
Value to which the control parameter is to be set.
Related topics
XPRS_msp_getdblcontrol, XPRS_msp_setintcontrol, XPRS_msp_getintcontrol.

Fair Isaac Corporation Confidential and Proprietary Information

45

MSP Functions

XPRS_msp_setdblcontrolsol
PurposeSets the value of a given double control parameter.
Synopsis
int XPRS_CC XPRS_msp_setdblcontrolsol(XPRSmipsolpool msp, int iSolutionId, int *iSolutionIdStatus, const int iControlId, const double Val)
Arguments
msp
The current MIP solution pool.
iSolutionId The id of the solution for which the control is to be set.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
iControlId Id of control whose value is to be set. A full list of all available controls may befound in Chapter 3, or from the list in the xprs.h header file.
Val
Value to which the control parameter is to be set.
Related topics
XPRS_msp_getdblcontrolsol, XPRS_msp_setintcontrolsol, XPRS_msp_getintcontrolsol.

Fair Isaac Corporation Confidential and Proprietary Information

46

MSP Functions

XPRS_msp_setintcontrol
PurposeSets the value of a given integer control parameter.
Synopsis
int XPRS_CC XPRS_msp_setintcontrol(XPRSmipsolpool msp, const int iControlId, const int
Val)
Arguments
msp
The current MIP solution pool.
iControlId Id of control whose value is to be set. A full list of all available controls may befound in Chapter 3, or from the list in the xprs.h header file.
Val
Value to which the control parameter is to be set.
Related topics
XPRS_msp_getintcontrol, XPRS_msp_setdblcontrol, XPRS_msp_getdblcontrol.

Fair Isaac Corporation Confidential and Proprietary Information

47

MSP Functions

XPRS_msp_setintcontrolsol
PurposeSets the value of a given integer control parameter.
Synopsis
int XPRS_CC XPRS_msp_setintcontrolsol(XPRSmipsolpool msp, int iSolutionId, int *iSolutionIdStatus, const int iControlId, const int Val)
Arguments
msp
The current MIP solution pool.
iSolutionId The id of the solution for which the control is to be set.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
iControlId Id of control whose value is to be set. A full list of all available controls may befound in Chapter 3, or from the list in the xprs.h header file.
Val
Value to which the control parameter is to be set.
Related topics
XPRS_msp_getintcontrolsol, XPRS_msp_getdblcontrolsol, XPRS_msp_setdblcontrolsol.

Fair Isaac Corporation Confidential and Proprietary Information

48

MSP Functions

XPRS_msp_setsolname
PurposeChanges the name of a solution stored in the MIP solution pool.
Synopsis
int XPRS_CC XPRS_msp_setsolname(XPRSmipsolpool msp, const int iSolutionId, const char*sNewSolutionBaseName, int * const gbNameModifiedForUniqueness, int * const
iSolutionIdStatus)
Arguments
msp
The current MIP solution pool.
iSolutionId Id of the solution whose name is to be changed.
sNewSolutionBaseName The new name to use to identify the solution. If the given name alreadyexists and is used by another solution then the name to be stored will have characters
appended to ensure the resulting name is unique among the stored solutions. If
sNewSolutionBaseName is passed as NULL then a unique name will be generated
automatically for the solution.
bNameModifiedForUniqueness Pointer to an integer returning 1 if it was necessary for the given
solution name sNewSolutionBaseName to be modified to maintain uniqueness ofsolution names; 0 otherwise.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
Further information
The user will obtain the solution id iSolutionId from interaction with the MIP solution pool via
functions such as XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme and XPRS_msp_getsollist.
Related topics
XPRS_msp_getsolname, XPRS_msp_findsolbyname, XPRS_msp_getdblattribprobextreme,
XPRS_msp_getintattribprobextreme, XPRS_msp_getsollist.

Fair Isaac Corporation Confidential and Proprietary Information

49

MSP Functions

XPRS_msp_writeslxsol
PurposeCreates an ASCII solution file (.slx) using a similar format to MPS files. The file can contain one
or more solutions. These files can be read back into a MIP solution pool using the
XPRS_msp_readslxsol function.
Synopsis
int XPRS_CC XPRS_msp_writeslxsol(XPRSmipsolpool msp, XPRSprob prob_context, int
iSolutionId, int * iSolutionIdStatus, const char * sFileName, const char *sFlags)Arguments
msp
The current MIP solution pool.
prob_context Pointer to a problem. Can be NULL. See table below for interpretation in terms offunction behaviour.
iSolutionId The id of a solution to write; otherwise a flag. See table below for interpretationin terms of function behaviour.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
sFileName Null terminated string containing the file name to which the solution(s) is to be
written.
sFlagsFlags for XPRS_msp_writeslxsol:p
use full precision for numerical values;x
use hexadecimal format to write values.
Further information
This table defines the interpretation of the values of arguments prob_context and iSolutionId interms of the behaviour of XPRS_msp_writeslxsol.
prob_context
iSolutionId
Behaviour
Non-NULL
0
Write out all feasible solutions to prob_context. Use
the column names in prob_context.
Non-NULL
0
Write out a feasible solution to prob_context with thebest objective (given the OBJSENSE (p.478 of the Optimizer Reference Manual ) value of prob_context). Use
the column names in prob_context.
Non-NULL>0
Write out the solution with ID iSolutionId. It is anerror if the solution does not have the same numberof columns as prob_context. Use the column names inprob_context.
NULL≤0Write out all solutions. Use automatically generated
column names.
NULL>0Write out the solution with ID iSolutionId. Use automatically generated column names.
Related topics
XPRS_msp_readslxsol.

Fair Isaac Corporation Confidential and Proprietary Information

50

C HAPTER 3

MSP Control Parameters
MSP_DEFAULTUSERSOLFEASTOL This is the zero tolerance on the value of integer, semi-continuous,partial and semi-continuos integer variables and SOS variables. If oneof these is less than or equal to FEASTOL in absolute value, it is treatedas zero.
p. 51
MSP_DEFAULTUSERSOLMIPTOL This is the tolerance within which a decision variable’s value isconsidered to be integral. It is the default value for the tolerance
MSP_SOL_MIPTOL when a solution is added by the user via routines
XPRS_msp_loadsol and XPRS_msp_readslxsol.
p. 52
MSP_DUPLICATESOLUTIONSPOLICY
p. 52

Policy to use when handling storage of duplicate solutions.

MSP_INCLUDEPROBNAMEINLOGGING Controls whether or not the MIP solution pool logging uses the
problem name when a message references a problem.
p. 52
MSP_SOL_BITFIELDSUSR

A user-definable bit map to be stored with a solution. This bit map canbe used to define subsets of solutions returned by the
XPRS_msp_getsollist2 function.
p. 52

MSP_SOL_FEASTOL

This is the zero tolerance on the value of integer, semi-continuous,partial and semi-continuos integer variables and SOS variables. If oneof these is less than or equal to FEASTOL in absolute value, it is treatedas zero.
p. 53

MSP_SOL_MIPTOLThis is the tolerance within which a decision variable’s value isconsidered to be integral.

p. 53

MSP_DEFAULTUSERSOLFEASTOL
Description

This is the zero tolerance on the value of integer, semi-continuous, partial andsemi-continuos integer variables and SOS variables. If one of these is less than or equal
to FEASTOL (p.402 of the Optimizer Reference Manual ) in absolute value, it is treated as
zero.

Type

DoubleDefault value

1.0E-06

Fair Isaac Corporation Confidential and Proprietary Information

51

MSP Control Parameters

MSP_DEFAULTUSERSOLMIPTOL
Description

This is the tolerance within which a decision variable’s value is considered to be integral.
It is the default value for the tolerance MSP_SOL_MIPTOL when a solution is added by theuser via routines XPRS_msp_loadsol and XPRS_msp_readslxsol.

Type

DoubleDefault value

5.0E-06

MSP_DUPLICATESOLUTIONSPOLICY
Description

Policy to use when handling storage of duplicate solutions.

Type

Integer

Values0
1
2

3
Default value

Keep all: All solutions are kept including duplicates.
Continuous: All variables are compared with an exact match. Duplicate
solutions are discarded.
Discrete and continuous separate: Both the discrete component of a solution
pair and the continuous solution variables are compared. The continuous
variables are compared with an exact match. Duplicate solutions are discarded.
Discrete only: Only the discrete component of a solution pair is compared.
Duplicate solutions are discarded.

3

MSP_INCLUDEPROBNAMEINLOGGING
Description

Controls whether or not the MIP solution pool logging uses the problem name when amessage references a problem.

Type

Integer

Values0
1

Default value

1

The problem name is not included.
The problem name is included.

MSP_SOL_BITFIELDSUSR
Description

A user-definable bit map to be stored with a solution. This bit map can be used todefine subsets of solutions returned by the XPRS_msp_getsollist2 function.

Type

Integer

Default value

0

Fair Isaac Corporation Confidential and Proprietary Information

52

MSP Control Parameters

Affects routines

XPRS_msp_getintcontrolsol, XPRS_msp_setintcontrolsol.

See also

XPRS_msp_getsollist2.

MSP_SOL_FEASTOL
Description

This is the zero tolerance on the value of integer, semi-continuous, partial andsemi-continuos integer variables and SOS variables. If one of these is less than or equal
to FEASTOL (p.402 of the Optimizer Reference Manual ) in absolute value, it is treated as
zero.

Type

DoubleDefault value

1.0E-06

MSP_SOL_MIPTOL
Description

This is the tolerance within which a decision variable’s value is considered to be integral.

Type

DoubleDefault value

5.0E-06

Fair Isaac Corporation Confidential and Proprietary Information

53

C HAPTER 4

MSP Attributes
MSP_PRB_FEASIBLESOLS

Number of feasible solutions for the problem.

p. 56

MSP_PRB_VALIDSOLS

Number of solutions with the same number of columns as the
problem.

p. 57

MSP_SOL_BITFIELDSSYS

A bit map with fields containing the logical attribute values for thesolution e.g., MSP_SOL_ISREPROCESSEDUSERSOLUTION and
MSP_SOL_ISUSERSOLUTION.
p. 65

MSP_SOL_COLS

Number of columns in the solution.

p. 65

MSP_SOL_ISREPROCESSEDUSERSOLUTION Whether or not the solution arises from a user solution(i.e., passed in by the user via XPRS_msp_loadsol or
XPRS_msp_readslxsol) being loaded into an attached problem and theresulting "cleaned up" solution being loaded back into the MIP
solution pool.
p. 65
MSP_SOL_ISUSERSOLUTION

Whether or not the solution was passed in by the user (via
XPRS_msp_loadsol or XPRS_msp_readslxsol) or whether the solution
was loaded internally from an attached problem.
p. 65

MSP_SOL_NONZEROS

Number of non-zeros in the solution.

MSP_SOLPRB_INFCNT_BIN

Number of binary variable MIP infeasibilities for the solution withrespect to the problem.
p. 57

MSP_SOLPRB_INFCNT_COLUMN Number of column bound infeasibilities for the solution withrespect to the problem.

p. 65

p. 57

MSP_SOLPRB_INFCNT_DELAYEDROW Number of delayed row infeasibilities for the solution withrespect to the problem.
p. 57
MSP_SOLPRB_INFCNT_INT

Number of integer variable MIP infeasibilities for the solution withrespect to the problem.
p. 57

MSP_SOLPRB_INFCNT_MIP

Number of MIP infeasibilities that the solution has with respect to the
problem.
p. 57

MSP_SOLPRB_INFCNT_PI

Number of partial integer variable MIP infeasibilities for the solution
with respect to the problem.
p. 58

MSP_SOLPRB_INFCNT_PRIMAL Number of primal infeasibilities that the solution has with respect tothe problem. This count includes the column bound infeasibilities andboth the row and delayed row infeasibilities.
p. 58
MSP_SOLPRB_INFCNT_SC

Number of semi-continuous variable MIP infeasibilities for the solution
with respect to the problem.
p. 58

Fair Isaac Corporation Confidential and Proprietary Information

54

MSP Attributes

MSP_SOLPRB_INFCNT_SET1

Number of SOS1 set MIP infeasibilities for the solution with respect tothe problem.
p. 58

MSP_SOLPRB_INFCNT_SET2

Number of SOS2 set MIP infeasibilities for the solution with respect tothe problem.
p. 58

MSP_SOLPRB_INFCNT_SI

Number of semi-continuous integer variable MIP infeasibilities for thesolution with respect to the problem.
p. 58

MSP_SOLPRB_INFCNT_SLACK

Number of rows of the problem that are violated for the solution.
p. 59

MSP_SOLPRB_INFEASCOUNTThe sum of the MIP and primal infeasibility counts for the solution
with respect to the problem.
p. 59

MSP_SOLPRB_INFMAX_BIN

Maximum binary variable MIP infeasibility for the solution with respect
to the problem.
p. 59

MSP_SOLPRB_INFMAX_COLUMN Maximum column bound infeasibility for the solution with respect
to the problem.
p. 59
MSP_SOLPRB_INFMAX_DELAYEDROW Maximum delayed row infeasibility for the solution withrespect to the problem.

p. 59

MSP_SOLPRB_INFMAX_INTMaximum integer variable MIP infeasibility for the solution withrespect to the problem.
p. 59

MSP_SOLPRB_INFMAX_PI

Maximum partial integer variable MIP infeasibility for the solution
with respect to the problem.
p. 60

MSP_SOLPRB_INFMAX_SC

Maximum semi-continuous variable MIP infeasibility for the solution
with respect to the problem.
p. 60

MSP_SOLPRB_INFMAX_SET1

Maximum variable value causing a SOS1 set MIP infeasibility.

p. 60

MSP_SOLPRB_INFMAX_SET2

Maximum variable value causing a SOS2 set MIP infeasibility.

p. 60

MSP_SOLPRB_INFMAX_SI

Maximum semi-continuous integer variable MIP infeasibility for thesolution with respect to the problem.
p. 60

MSP_SOLPRB_INFMAX_SLACK

Maximum row infeasibility for the solution with respect to the
problem.

p. 60

Index of a column achieving the maximum binary variable MIP
infeasibility for the solution with respect to the problem.

p. 61

MSP_SOLPRB_INFMXI_BIN

MSP_SOLPRB_INFMXI_COLUMN Index of a column achieving the maximum column boundinfeasibility for the solution with respect to the problem.

p. 61

MSP_SOLPRB_INFMXI_DELAYEDROW Index of a delayed row achieving the maximum delayed row
infeasibility for the solution with respect to the problem.
p. 61
MSP_SOLPRB_INFMXI_INT

Index of a column achieving the maximum integer variable MIP
infeasibility for the solution with respect to the problem.

p. 61

MSP_SOLPRB_INFMXI_PI

Index of a column achieving the maximum partial integer variable MIP
infeasibility for the solution with respect to the problem.
p. 61

MSP_SOLPRB_INFMXI_SC

Index of a column achieving the maximum semi-continuous variable
MIP infeasibility for the solution with respect to the problem.
p. 61

MSP_SOLPRB_INFMXI_SET1

Index of a set that has the maximum SOS1 set MIP infeasibility.

Fair Isaac Corporation Confidential and Proprietary Information

p. 62

55

MSP Attributes

MSP_SOLPRB_INFMXI_SET2

Index of a set that has the maximum SOS2 set MIP infeasibility.

p. 62

MSP_SOLPRB_INFMXI_SI

Index of a column achieving the maximum semi-continuous integer
variable MIP infeasibility for the solution with respect to the problem.
p. 62

MSP_SOLPRB_INFMXI_SLACK

Index of a row achieving the maximum row infeasibility for thesolution with respect to the problem.
p. 62

MSP_SOLPRB_INFSUM_BIN

Sum of binary variable MIP infeasibilities for the solution with respect
to the problem.
p. 62

MSP_SOLPRB_INFSUM_COLUMN Sum of column bound infeasibilities for the solution with respect tothe problem.
p. 62
MSP_SOLPRB_INFSUM_DELAYEDROW Sum of delayed row infeasibilities for the solution with respect
to the problem.
p. 63
MSP_SOLPRB_INFSUM_INT

Sum of integer variable MIP infeasibilities for the solution with respect
to the problem.
p. 63

MSP_SOLPRB_INFSUM_MIP

Sum of MIP infeasibilities that the solution has with respect to the
problem.
p. 63

MSP_SOLPRB_INFSUM_PI

Sum of partial integer variable MIP infeasibilities for the solution withrespect to the problem.
p. 63

MSP_SOLPRB_INFSUM_PRIMAL Sum of primal infeasibilities that the solution has with respect to the
problem. This sum includes the column bound infeasibilities and both
the row and delayed row infeasibilities.
p. 63
MSP_SOLPRB_INFSUM_SC

Sum of semi-continuous variable MIP infeasibilities for the solution
with respect to the problem.
p. 63

MSP_SOLPRB_INFSUM_SET1

Sum of SOS1 set MIP infeasibilities for the solution with respect to the
problem.
p. 64

MSP_SOLPRB_INFSUM_SET2

Sum of SOS2 set MIP infeasibilities for the solution with respect to the
problem.
p. 64

MSP_SOLPRB_INFSUM_SI

Sum of semi-continuous integer variable MIP infeasibilities for thesolution with respect to the problem.
p. 64

MSP_SOLPRB_INFSUM_SLACK

Sum of row infeasibilities for the solution with respect to the
problem.

p. 64

MSP_SOLPRB_OBJ

Objective value of the solution with the problem.

p. 64

MSP_SOLUTIONSThe number of solutions stored by the MIP solution pool.

p. 64

MSP_PRB_FEASIBLESOLS
Description

Number of feasible solutions for the problem.

Type

Integer

Fair Isaac Corporation Confidential and Proprietary Information

56

MSP Attributes

MSP_PRB_VALIDSOLS
Description

Number of solutions with the same number of columns as the problem.

Type

Integer

MSP_SOLPRB_INFCNT_BIN
Description

Number of binary variable MIP infeasibilities for the solution with respect to the
problem.

Type

Integer

MSP_SOLPRB_INFCNT_COLUMN
Description

Number of column bound infeasibilities for the solution with respect to the problem.

Type

Integer

MSP_SOLPRB_INFCNT_DELAYEDROW
Description

Number of delayed row infeasibilities for the solution with respect to the problem.

Type

Integer

MSP_SOLPRB_INFCNT_INT
Description

Number of integer variable MIP infeasibilities for the solution with respect to the
problem.

Type

Integer

MSP_SOLPRB_INFCNT_MIP
Description

Number of MIP infeasibilities that the solution has with respect to the problem.

Type

Integer

Fair Isaac Corporation Confidential and Proprietary Information

57

MSP Attributes

MSP_SOLPRB_INFCNT_PI
Description

Number of partial integer variable MIP infeasibilities for the solution with respect to the
problem.

Type

Integer

MSP_SOLPRB_INFCNT_PRIMAL
Description

Number of primal infeasibilities that the solution has with respect to the problem. Thiscount includes the column bound infeasibilities and both the row and delayed row
infeasibilities.

Type

Integer

MSP_SOLPRB_INFCNT_SC
Description

Number of semi-continuous variable MIP infeasibilities for the solution with respect tothe problem.

Type

Integer

MSP_SOLPRB_INFCNT_SET1
Description

Number of SOS1 set MIP infeasibilities for the solution with respect to the problem.

Type

Integer

MSP_SOLPRB_INFCNT_SET2
Description

Number of SOS2 set MIP infeasibilities for the solution with respect to the problem.

Type

Integer

MSP_SOLPRB_INFCNT_SI
Description

Number of semi-continuous integer variable MIP infeasibilities for the solution withrespect to the problem.

Type

Integer

Fair Isaac Corporation Confidential and Proprietary Information

58

MSP Attributes

MSP_SOLPRB_INFCNT_SLACK
Description

Number of rows of the problem that are violated for the solution.

Type

Integer

MSP_SOLPRB_INFEASCOUNT
Description

The sum of the MIP and primal infeasibility counts for the solution with respect to the
problem.

Type

Integer

MSP_SOLPRB_INFMAX_BIN
Description

Maximum binary variable MIP infeasibility for the solution with respect to the problem.

Type

DoubleMSP_SOLPRB_INFMAX_COLUMN
Description

Maximum column bound infeasibility for the solution with respect to the problem.

Type

DoubleMSP_SOLPRB_INFMAX_DELAYEDROW
Description

Maximum delayed row infeasibility for the solution with respect to the problem.

Type

DoubleMSP_SOLPRB_INFMAX_INTDescription

Maximum integer variable MIP infeasibility for the solution with respect to the problem.

Type

DoubleFair Isaac Corporation Confidential and Proprietary Information

59

MSP Attributes

MSP_SOLPRB_INFMAX_PI
Description

Maximum partial integer variable MIP infeasibility for the solution with respect to the
problem.

Type

DoubleMSP_SOLPRB_INFMAX_SC
Description

Maximum semi-continuous variable MIP infeasibility for the solution with respect to the
problem.

Type

DoubleMSP_SOLPRB_INFMAX_SET1
Description

Maximum variable value causing a SOS1 set MIP infeasibility.

Type

DoubleMSP_SOLPRB_INFMAX_SET2
Description

Maximum variable value causing a SOS2 set MIP infeasibility.

Type

DoubleMSP_SOLPRB_INFMAX_SI
Description

Maximum semi-continuous integer variable MIP infeasibility for the solution withrespect to the problem.

Type

DoubleMSP_SOLPRB_INFMAX_SLACK
Description

Maximum row infeasibility for the solution with respect to the problem.

Type

DoubleFair Isaac Corporation Confidential and Proprietary Information

60

MSP Attributes

MSP_SOLPRB_INFMXI_BIN
Description

Index of a column achieving the maximum binary variable MIP infeasibility for thesolution with respect to the problem.

Type

Integer

MSP_SOLPRB_INFMXI_COLUMN
Description

Index of a column achieving the maximum column bound infeasibility for the solution
with respect to the problem.

Type

Integer

MSP_SOLPRB_INFMXI_DELAYEDROW
Description

Index of a delayed row achieving the maximum delayed row infeasibility for thesolution with respect to the problem.

Type

Integer

MSP_SOLPRB_INFMXI_INTDescription

Index of a column achieving the maximum integer variable MIP infeasibility for thesolution with respect to the problem.

Type

Integer

MSP_SOLPRB_INFMXI_PI
Description

Index of a column achieving the maximum partial integer variable MIP infeasibility forthe solution with respect to the problem.

Type

Integer

MSP_SOLPRB_INFMXI_SC
Description

Index of a column achieving the maximum semi-continuous variable MIP infeasibility forthe solution with respect to the problem.

Fair Isaac Corporation Confidential and Proprietary Information

61

MSP Attributes

Type

Integer

MSP_SOLPRB_INFMXI_SET1
Description

Index of a set that has the maximum SOS1 set MIP infeasibility.

Type

Integer

MSP_SOLPRB_INFMXI_SET2
Description

Index of a set that has the maximum SOS2 set MIP infeasibility.

Type

Integer

MSP_SOLPRB_INFMXI_SI
Description

Index of a column achieving the maximum semi-continuous integer variable MIP
infeasibility for the solution with respect to the problem.

Type

Integer

MSP_SOLPRB_INFMXI_SLACK
Description

Index of a row achieving the maximum row infeasibility for the solution with respect tothe problem.

Type

Integer

MSP_SOLPRB_INFSUM_BIN
Description

Sum of binary variable MIP infeasibilities for the solution with respect to the problem.

Type

DoubleMSP_SOLPRB_INFSUM_COLUMN
Description

Sum of column bound infeasibilities for the solution with respect to the problem.

Type

DoubleFair Isaac Corporation Confidential and Proprietary Information

62

MSP Attributes

MSP_SOLPRB_INFSUM_DELAYEDROW
Description

Sum of delayed row infeasibilities for the solution with respect to the problem.

Type

DoubleMSP_SOLPRB_INFSUM_INTDescription

Sum of integer variable MIP infeasibilities for the solution with respect to the problem.

Type

DoubleMSP_SOLPRB_INFSUM_MIP
Description

Sum of MIP infeasibilities that the solution has with respect to the problem.

Type

DoubleMSP_SOLPRB_INFSUM_PI
Description

Sum of partial integer variable MIP infeasibilities for the solution with respect to the
problem.

Type

DoubleMSP_SOLPRB_INFSUM_PRIMAL
Description

Sum of primal infeasibilities that the solution has with respect to the problem. This sum
includes the column bound infeasibilities and both the row and delayed row
infeasibilities.

Type

DoubleMSP_SOLPRB_INFSUM_SC
Description

Sum of semi-continuous variable MIP infeasibilities for the solution with respect to the
problem.

Type

DoubleFair Isaac Corporation Confidential and Proprietary Information

63

MSP Attributes

MSP_SOLPRB_INFSUM_SET1
Description

Sum of SOS1 set MIP infeasibilities for the solution with respect to the problem.

Type

DoubleMSP_SOLPRB_INFSUM_SET2
Description

Sum of SOS2 set MIP infeasibilities for the solution with respect to the problem.

Type

DoubleMSP_SOLPRB_INFSUM_SI
Description

Sum of semi-continuous integer variable MIP infeasibilities for the solution with respect
to the problem.

Type

DoubleMSP_SOLPRB_INFSUM_SLACK
Description

Sum of row infeasibilities for the solution with respect to the problem.

Type

DoubleMSP_SOLPRB_OBJ
Description

Objective value of the solution with the problem.

Type

DoubleNote

For infeasible solutions, the objective value returned is infinity. Calling XPRSfixglobals(p.168 of the Optimizer Reference Manual ) will invalidate a solution in the pool if anyof the global variables in the solution are rounded and if this happens the objective will
be returned as infinity.

MSP_SOLUTIONS
Description

The number of solutions stored by the MIP solution pool.

Type

Integer

Fair Isaac Corporation Confidential and Proprietary Information

64

MSP Attributes

MSP_SOL_BITFIELDSSYS
Description

A bit map with fields containing the logical attribute values for the solution e.g.,
MSP_SOL_ISREPROCESSEDUSERSOLUTION and MSP_SOL_ISUSERSOLUTION.

Type

Integer

MSP_SOL_COLS
Description

Number of columns in the solution.

Type

Integer

MSP_SOL_ISREPROCESSEDUSERSOLUTION
Description

Whether or not the solution arises from a user solution (i.e., passed in by the user via
XPRS_msp_loadsol or XPRS_msp_readslxsol) being loaded into an attached problem andthe resulting "cleaned up" solution being loaded back into the MIP solution pool.

Type

Integer

Values0
1

The solution was not derived from a user solution i.e., it is a user solution or it isa solution found by an attached XPRSprob problem.
The solution was derived from a user solution.

MSP_SOL_ISUSERSOLUTION
Description

Whether or not the solution was passed in by the user (via XPRS_msp_loadsol or
XPRS_msp_readslxsol) or whether the solution was loaded internally from an attachedproblem.

Type

Integer

Values0
1

The solution was loaded internally from an attached problem.
The solution was loaded by the user via XPRS_msp_loadsol or
XPRS_msp_readslxsol.

MSP_SOL_NONZEROS
Description

Number of non-zeros in the solution.

Type

Integer

Fair Isaac Corporation Confidential and Proprietary Information

65

II. MIP Solution Enumerator

C HAPTER 5

Introduction
5.1

Overview
The MIP solution enumerator (XPRSmipsolenum) runs a customized MIP search on a user provided
problem (XPRSprob). The search is customized such that nodes are not cut-off by bounding andinteger solution nodes are branched. The MIP solution enumerator marshals the solutions foundto storage in a user provided MIP solution pool (XPRSmipsolpool).
In general the MIP solution enumerator is useful for generating a set of solutions for a problem.
In particular, the MIP solution enumerator can be used to generate the n-best solutions to a
problem. The user will typically be interested in such a set when there are constraints and/or costs
not reflected in the problem and the user wants a set of solutions from which a final solution canbe selected that best meets the external constraints and objective.

5.2

Applications: N-Best Solutions Example
A typical use of the MIP solution enumerator is to generate the set of n-best solutions. The
following example shows how this can be done:#include <stdio.h>#include "xprs.h"#include "xprs_mse_defaulthandler.h"
int main(int argc, char **argv){
XPRSprob prob;
XPRSmipsolpool msp;
XPRSmipsolenum mse;
int nMaxSols;
int i, j, nSols, nCols, iSolutionId, iSolutionIdStatus;
double dObj, dSol;
int iPresolveOps;
const char *sProblem = argv[1];
XPRSinit(NULL);
XPRScreateprob(&prob);
XPRSreadprob(prob, sProblem, "");XPRS_msp_create(&msp);
XPRS_mse_create(&mse);
XPRSgetintattrib(prob, XPRS_COLS, &nCols);/* Disable heuristics to avoid duplicate solutions being stored */XPRSsetintcontrol(prob, XPRS_HEURSTRATEGY, 0);

Fair Isaac Corporation Confidential and Proprietary Information

67

Introduction

XPRSgetintcontrol(prob, XPRS_PRESOLVEOPS, &iPresolveOps);
iPresolveOps &= ~(1 << 3); /* Disable dual reduction operations */iPresolveOps &= ~(1 << 5); /* Disable duplicate column removal */XPRSsetintcontrol(prob, XPRS_PRESOLVEOPS, iPresolveOps);/* Run the enumeration */nMaxSols = 10;
XPRS_mse_maxim(mse, prob, msp, XPRS_mse_defaulthandler, NULL, &nMaxSols);/* Print out the solutions found */XPRS_mse_getintattrib(mse, XPRS_MSE_SOLUTIONS, &nSols);for(i = 1; i <= nSols; i++) {XPRS_mse_getsollist(mse, XPRS_MSE_METRIC_MIPOBJECT, i, i, &iSolutionId, NULL, NULL);XPRS_mse_getsolmetric(mse, iSolutionId, &iSolutionIdStatus, XPRS_MSE_METRIC_MIPOBJECT, &dObj);
printf("--------\n%3i = %12.5f\n", i, dObj);
for(j = 0; j < nCols; j++) {XPRS_msp_getsol(msp, iSolutionId, &iSolutionIdStatus, &dSol, j, j, NULL);
printf("%3i = %12.5f\n", j, dSol);}}XPRS_msp_destroy(msp);
XPRSdestroyprob(prob);
XPRS_mse_destroy(mse);
XPRSfree();}In the example we use the XPRS_mse_defaulthandler function to manage the storage of at mostnMaxSols ( = 10) solutions. The code for the XPRS_mse_defaulthandler callback is provided in the
FICO Xpress Optimizer. Using the default control settings when a solution is found and there are
nMaxSols ( = 10) solutions stored the XPRS_mse_defaulthandler callback will either reject thecurrent solution or delete the worst existing solution depending on their objective values (whenthere is a tie the current solution is rejected). In this way the MIP solution enumerator will
generate the set of n-best solutions.
It is important to note that duplicate solutions can potentially be stored in the cases where the
MIP solution pool contains initial solutions prior to the enumeration run or if heuristics areactivated in the XPRSprob. In the example we have disabled heuristics and the MIP solution pool
does not contain any solutions prior to the enumeration run so there is no need to check for
duplicates. The management of duplicate solutions is left to the MIP solution pool functionality
which is discussed in Duplicate Solutions.
It is also important to note that it is sometimes necessary to disable certain FICO Xpress Optimizerpresolve operations (i.e., setting the integer control PRESOLVEOPS in the example) to avoid
spurious deletion of solutions from the enumeration search space. This is discussed in thefollowing section Presolve considerations.
In the event that initial solutions are contained in the MIP solution pool prior to the enumeration
run the MIP solution enumerator will load the set of feasible solutions (with the same number ofcolumns as the XPRSprob) from the initial set of solutions as if they were found during the MIP
search on the XPRSprob. Note that new versions of these solutions are created and the original
versions are deleted from the MIP solution pool.
Once the enumeration run terminates the example demonstrates simple retrieval of the solution
information. Note that the solution values are stored in the MIP solution pool and the metric
information for the solutions is stored in the MIP solution enumerator.

5.3

Presolve considerations
The default control settings of the FICO Xpress Optimizer presolver assume that the user isFair Isaac Corporation Confidential and Proprietary Information

68

Introduction

satisfied if the MIP search finds a single solution with the best objective. The choice of the default
presolve settings attempts to improve the efficiency of this type of search by cutting off MIP
solutions from the feasible region that are either degenerate (i.e., that have equivalent
representations with different feasible values of the variables) or dominated (i.e., that can be
deduced to be worse than solutions contained in the remaining feasible region) or symmetric toanother solution. The user must take care to disable these default presolve operations whensolutions may be removed from the enumeration search space that are of interest. Also, the user
should be aware that disabling these presolve operations can significantly increase theenumeration runtime.
Presolve operations removing dominated MIP solutions are collectively referred to as dual
reduction operations. To disable duplicate column detection the user must unset bit 5 of theinteger control PRESOLVEOPS. To disable all dual reduction operations the user must unset bit 3 of
PRESOLVEOPS. See the Applications: N-Best Solutions Example for an example of how to unset
these bits.
To disable FICO Xpress Optimizer from removing symmetric solutions, set the SYMMETRY control to
0.

5.4

Basic customization
By customizing the controls for the XPRS_mse_defaulthandler callback (i.e., setting
MSE_CALLBACKCULLSOLS_MIPOBJECT and/or MSE_CALLBACKCULLSOLS_DIVERSITY) the user can modify
the behavior of the callback when the number of solutions exceeds the maximum. The user candelete p solutions based on the MIP objective values and then delete q of the remaining nMaxSols- p solutions based on the diversity metric (see below). The current solution will be rejected if it is
no better than any of the solutions that were deleted. In this way the user has simple control of
how the solution set is generated.
In addition to the MIP objective the MIP solution enumerator provides a metric for solutions
based on the ’diversity’ of the solution with respect to the other stored solutions. The diversity
metric for a solution is the sum of difference metrics between the solution and the other stored
solutions. By default the difference value between two solutions is calculated by the MIP solution
enumerator using a simple difference metric that considers only the MIP entities in the solution.
Note that for the MIP solution enumerator to calculate the diversity metrics a problem needs to
be attached to the MIP solution pool (see ’Duplicate solutions’). This is because the global
structure of the solution variables is required for the difference metric calculation. The user will
typically attach to the MIP solution pool the XPRSprob to be used to run the enumeration. Finally,note that the user can provide their own difference metric calculation for solution pairs in a
callback defined with a call to XPRS_mse_setcbgetsolutiondiff (in this case there does not need
to be a problem attached to the MIP solution pool).

5.5

Advanced customization
By providing a customized version of the XPRS_mse_defaulthandler the user can define amodified objective value for solutions. Typically this value reflects the ’true’ objective of thesolution in cases where the MIP objective does not completely model the user’s problem. The
modified objective value is stored with the solution and can be used to obtain a ranked order ofsolutions in the case where the user wishes to delete solutions based on this metric (seeXPRS_mse_getcullchoice). Also with a customized callback the user is able to arbitrarily accept or
reject the current solution. Typically the user will want to do this in cases where the constraints
and/or objective of the MIP problem do not completely model the user’s problem.
From the customized XPRS_mse_defaulthandler callback the user is able to set a return value that

Fair Isaac Corporation Confidential and Proprietary Information

69

Introduction

causes the MIP solution enumerator to set the cut-off for the search to the worst MIP objective of
the active solutions. This can be useful to improve the run time of the enumeration. Note thatthe default n-best search uses this to improve the enumeration performance.

5.6

Data Model
The following UML diagram outlines the relationships the XPRSmipsolenum has with some otherdata entities.

Figure 5.1:

Starting from the top left the diagram shows the XPRSprob referenced by the XPRSmipsolenum inthe top middle. The XPRSmipsolenum references the XPRSprob only for the duration of theenumeration-run routines XPRS_mse_minim, XPRS_mse_maxim and XPRS_mse_opt. The
XPRSmipsolenum sets certain controls on the XPRSprob, registers an internal callback to receive
solutions found during the enumeration and calls the relevant optimization function to execute
the enumeration.
Moving to the top right the diagram shows the XPRSmipsolpool referenced by the
XPRSmipsolenum. The XPRSmipsolenum references the XPRSmipsolpool only for the duration of theenumeration-run routines (in the same way as the XPRSprob).
While running the enumeration the XPRSmipsolenum maintains storage of additional informationfor each solution found that cannot be stored by the XPRSmipsolpool. The additional informationis the MIP objective value (MIPObject) of the solution, any user-defined objective function value(ModObject) for the solution and a diversity-metric (Diversity) for the solution that measures
how different the solution is with respect to the other solutions in storage. As indicated by thedashed line in the diagram, the solution ID is used to link the information stored separately in the
XPRSmipsolenum and the XPRSmipsolpool.
Since a parallel storage of solution information is required the XPRSmipsolenum marshals thestorage of solutions to the XPRSmipsolpool. To do this the XPRSmipsolenum registers an internal
callback with the XPRSmipsolpool to track when solutions are deleted by the user from the
XPRSmipsolpool. It is also necessary that the XPRSmipsolenum loads the solutions found during theenumeration directly into the XPRSmipsolpool overriding the automatic loading of solutions fromthe XPRSprob to XPRSmipsolpool in the situation where the user has attached the XPRSprob to the
XPRSmipsolpool prior to the enumeration run.
Once the enumeration run terminates the MIP solutions are stored in the XPRSmipsolpool and the
additional information for the solutions is stored in the XPRSmipsolenum. At this point thesolution information is linked only by the solution ID.

Fair Isaac Corporation Confidential and Proprietary Information

70

C HAPTER 6

MSE Functions
XPRS_mse_addcbmsghandler Declares an output callback function, called every time a line ofmessage text is output by the MIP solution enumerator. This callback
function will be called in addition to any output callbacks already
added by XPRS_mse_addcbmsghandler.
p. 73
XPRS_mse_create

Sets up a new MIP solution enumerator object.

XPRS_mse_defaulthandler

A routine defined in xprs_mse_defaulthandler.h intended only to bepassed as a callback into the enumeration-run routines
XPRS_mse_minim, XPRS_mse_maxim and XPRS_mse_opt. When used torun an enumeration this routine is called each time a solution is foundin the enumeration. This routine provides simple functionality to
manage common strategies for keeping a ’good’ set of solutions foundduring enumeration and controlling the enumeration run e.g., n-bestsolutions. The user may wish to base any customized version of thecallback on the contents of this routine.
p. 75

XPRS_mse_destroy

Destroys a MIP solution enumerator object and its resources. The
object will generally be created by a call to the function
XPRS_mse_create.
p. 76

XPRS_mse_getcbmsghandler Get the output callback function, as set by
XPRS_mse_setcbmsghandler.

p. 74

p. 77

XPRS_mse_getcullchoice

Generates a list of solution ids for solutions recommended to be
dropped assuming that the given number of solutions are required tobe dropped and the solutions are to be compared with each otherwith respect to the given metric. This function also decides whether agiven, new solution defined by its metric value (or its solution values)
should also be dropped given that the returned list of solutions arerecommended to be dropped.
p. 78

XPRS_mse_getdblattrib

Provides read access to the values of double attributes associated with
the MIP solution enumerator.
p. 79

XPRS_mse_getdblcontrol

Retrieves the value of a given double control parameter.

XPRS_mse_getintattrib

Provides read access to the values of integer attributes associated with
the MIP solution enumerator.
p. 81

XPRS_mse_getintcontrol

Retrieves the value of a given integer control parameter.

p. 82

XPRS_mse_getlasterror

Gets the last error message.

p. 83

XPRS_mse_getsolbasename

Gets the name currently used as a prefix for solutions found during
the enumeration run.
p. 84

Fair Isaac Corporation Confidential and Proprietary Information

p. 80

71

MSE Functions

XPRS_mse_getsollist

Returns a list of solution ids of solutions found during theenumeration. The list is sorted by the value of some attribute of thesolutions e.g., the MIP objective value.
p. 85

XPRS_mse_getsolmetricGets the value of a metric for a solution.

XPRS_mse_maxim

One of three routines to run the enumeration. This routine starts theenumeration run on the problem by calling XPRSmaxim.
p. 87

XPRS_mse_minim

One of three routines to run the enumeration. This routine starts theenumeration run on the problem by calling XPRSminim.
p. 88

XPRS_mse_opt

One of three routines to run the enumeration. This routine starts theenumeration run on the problem by calling XPRSmipoptimize.
p. 89

p. 86

XPRS_mse_removecbmsghandler Removes an output callback function previously added by
XPRS_mse_addcbmsghandler. The specified callback function will nolonger be called after it has been removed.
p. 90
XPRS_mse_setcbgetsolutiondiff Declares a user-defined solution difference calculation routine,
called each time a new pair of solutions are required to have a
difference metric calculated. This functionality is required when the
MSE_METRIC_DIVERSITY metric is applied to the set of stored solutions
with a call to XPRS_mse_getcullchoice and XPRS_mse_getsolmetric.
p. 91
XPRS_mse_setcbmsghandler Declares an output callback function, called every time a line ofmessage text is output by a MIP solution enumerator object.
p. 93
XPRS_mse_setdblcontrol Sets the value of a given double control parameter.

p. 94

XPRS_mse_setintcontrol Sets the value of a given integer control parameter.

p. 95

XPRS_mse_setsolbasename

Sets the name to be used as a prefix for solutions found during theenumeration run.
p. 96

Fair Isaac Corporation Confidential and Proprietary Information

72

MSE Functions

XPRS_mse_addcbmsghandler
Purpose
Declares an output callback function, called every time a line of message text is output by the MIP
solution enumerator. This callback function will be called in addition to any output callbacks
already added by XPRS_mse_addcbmsghandler.
Synopsis
int XPRS_CC XPRS_mse_addcbmsghandler(XPRSmipsolenum mse, int (XPRS_CC *f_msghandler)(XPRSobject vXPRSObject, void * vUserContext, void * vSystemThreadId, const
char * sMsg, int iMsgType, int iMsgNumber), void * p, int priority);
Arguments
mse
The current MIP solution enumerator
f_msghandler The callback function which takes six arguments, vXPRSObject, vUserContext,
vSystemThreadId, sMsg, iMsgType and iMsgNumber. Use a NULL value to cancel a
callback function.
vXPRSObject The object sending the message. Use XPRSgetobjecttypename (p.213 of the
Optimizer Reference Manual ) to get the name of the object type.
vUserContext The user-defined object passed to the callback function.
vSystemThreadId The system id of the thread sending the message caste to a void *.
sMsg
A null terminated character array (string) containing the message, which may simply
be a new line. When the callback is called for the first time sMsg will be a NULL
pointer.
iMsgType Indicates the type of output message:
1
information messages;
2(not used);3
warning messages;
4
error messages.
A negative value means the callback is being called for the first time.
iMsgNumber The number associated with the message. If the message is an error or a warningthen you can look up the number in the section Optimizer Error and Warning
Messages for advice on what it means and how to resolve the associated issue.
p
A user-defined object to be passed to the callback function.
priority An integer that determines the order in which multiple output callbacks will be
invoked. The callback added with a higher priority will be called before a callbackwith a lower priority. Set to 0 if not required.
Further information
To send messages to a log file the built in message handler XPRSlogfilehandler can be used. Thiscan be done with:
XPRS_mse_addcbmsghandler(msp, XPRSlogfilehandler, "log.txt");

Related topics
XPRS_mse_removecbmsghandler,XPRSgetobjecttypename (p.213 of the Optimizer Reference Manual).

Fair Isaac Corporation Confidential and Proprietary Information

73

MSE Functions

XPRS_mse_create
PurposeSets up a new MIP solution enumerator object.
Synopsis
int XPRS_CC XPRS_mse_create(XPRSmipsolenum * mse)
Argument
mse

Pointer to a variable holding the new MIP solution enumerator.

Further information
1. Calls to XPRS_mse_create must be made after the call to XPRSinit (p.252 of the Optimizer
Reference Manual ).
2. All MIP solution enumerators created using a call to XPRS_mse_create should be disposed of witha call to XPRS_mse_destroy.
Related topics
XPRSinit (p.252 of the Optimizer Reference Manual ), XPRS_mse_destroy.

Fair Isaac Corporation Confidential and Proprietary Information

74

MSE Functions

XPRS_mse_defaulthandler
PurposeA routine defined in xprs_mse_defaulthandler.h intended only to be passed as a callback into theenumeration-run routines XPRS_mse_minim, XPRS_mse_maxim and XPRS_mse_opt. When used to run
an enumeration this routine is called each time a solution is found in the enumeration. Thisroutine provides simple functionality to manage common strategies for keeping a ’good’ set ofsolutions found during enumeration and controlling the enumeration run e.g., n-best solutions.
The user may wish to base any customized version of the callback on the contents of this routine.
Synopsis
int XPRS_CC XPRS_mse_defaulthandler(XPRSmipsolenum mse, XPRSprob prob, XPRSmipsolpool
msp, void *ctx, int *const nMaxSols, const double *const x, const int nCols,
const double dMipObject, double *const dModifiedObject, int *const bRejectSoln,int *const bUpdateMipAbsCutOffOnCurrentSet)
Arguments
mse
prob
msp
ctx

The current MIP solution enumerator.
The problem used to enumerate solutions.
The MIP solution pool used to store the solutions found during enumeration.
The user-defined object passed into the enumeration-run routine that started this run(i.e., XPRS_mse_minim, XPRS_mse_maxim or XPRS_mse_opt).
nMaxSols The integer pointer passed into the enumeration-run routine that started this run(i.e., XPRS_mse_minim, XPRS_mse_maxim or XPRS_mse_opt). Note that this pointer is onlyused by the callback and is intended to store the maximum number of solutions theuser is prepared to capture during the enumeration.
x
A dense solution array of doubles containing the nCols solution values of the new
solution.
nCols
The number elements in x. This is the same as the column dimension of the problem
when the enumeration was started.
dMipObject A double with the value of the MIP objective of the solution.
dModifiedObject A pointer to a double that contains, on entry to the routine, the MIP objective.
The user can assign it a new value that reflects the ’true’ objective of the solution incases where the MIP objective does not completely model the user’s problem. The
returned value is stored as the MSE_METRIC_MODOBJECT metric of the solution.
bRejectSoln A pointer to an integer that is at value zero on entry to the routine. The solution
will not be stored if the user returns this variable at a non-zero value.
bUpdateMipAbsCutOffOnCurrentSet A pointer to an integer that is at value zero on entry to theroutine. If the user returns this variable with a non-zero value then the MIP solution
enumerator will update the MIPABSCUTOFF (p.422 of the Optimizer Reference Manual )of the problem to reflect the worst MIP objective of the stored solutions (including
the new solution if it is not rejected).

Further information
This simple routine uses only four different API function calls. These calls are to the MIP solution
enumerator routines XPRS_mse_getcullchoice, XPRS_mse_getintattrib and
XPRS_mse_getintcontrol and the MIP solution pool routine XPRS_msp_delsol.
Related topics
XPRS_mse_minim, XPRS_mse_maxim, XPRS_mse_opt, XPRS_mse_getcullchoice,
XPRS_mse_getintattrib, XPRS_mse_getintcontrol, XPRS_msp_delsol.

Fair Isaac Corporation Confidential and Proprietary Information

75

MSE Functions

XPRS_mse_destroy
PurposeDestroys a MIP solution enumerator object and its resources. The object will generally be createdby a call to the function XPRS_mse_create.
Synopsis
int XPRS_CC XPRS_mse_destroy(XPRSmipsolenum mse)
Argumentmse

MIP solution enumerator to be destroyed.

Related topics
XPRS_mse_create.

Fair Isaac Corporation Confidential and Proprietary Information

76

MSE Functions

XPRS_mse_getcbmsghandler
PurposeGet the output callback function, as set by XPRS_mse_setcbmsghandler.
Synopsis
int XPRS_CC XPRS_mse_getcbmsghandler(XPRSmipsolenum mse, int (XPRS_CC**r_f_msghandler)(XPRSobject vXPRSObject, void * vUserContext, void * vSystemThreadId, const
char * sMsg, int iMsgType, int iMsgNumber), void **object);Arguments
mse
The current MIP solution enumerator
r_f_msghandler Pointer to the memory where the callback function will be returned.
Related topics
XPRS_mse_setcbmsghandler.

Fair Isaac Corporation Confidential and Proprietary Information

77

MSE Functions

XPRS_mse_getcullchoicePurposeGenerates a list of solution ids for solutions recommended to be dropped assuming that the given
number of solutions are required to be dropped and the solutions are to be compared with eachother with respect to the given metric. This function also decides whether a given, new solution
defined by its metric value (or its solution values) should also be dropped given that the returned
list of solutions are recommended to be dropped.
Synopsis
int XPRS_CC XPRS_mse_getcullchoice(XPRSmipsolenum mse, int iMetricId, int
cull_sol_id_list[], int nMaxSolsToCull, int * nSolsToCull, double
dNewSolMetric, const double x[], int nCols, int * bRejectSoln)
Arguments
mse
The current MIP solution enumerator.
iMetricId Id of metric for which the solutions should be compared e.g., the MIP objective value
is used when MSE_METRIC_MIPOBJECT is passed down. A full list of all available metrics
may be found in Chapter 8, or from the list in the xprs.h header file.
cull_sol_id_list Integer array where the solution ids will be returned. May be NULL if not
required.
nMaxSolsToCull The maximum number of solutions required to be returned incull_sol_id_list.
nSolsToCull Pointer to an integer where the number of solution ids that were written to
cull_sol_id_list is returned. May be NULL if not required.
dNewSolMetric The metric value for the new solution for the metric identified by iMetricId. It is
assumed that the user wishes to decide whether or not to keep the new solution giventhat solutions in the returned list cull_sol_id_list are recommended to be dropped.
x
The solution values of the new solution. The diversity metric (MSE_METRIC_DIVERSITY)
requires the solution values in order to calculate the new solution’s metric withrespect to the currently stored solutions. Other metrics simply use dNewSolMetric anddo not require the solution values. May be NULL if not required.
nCols
The number of columns in the solution array x. This must be the same as the numberof (initial) columns in the enumeration problem.
bRejectSoln If this is passed down as NULL or if its value is non-zero then the given new
solution is ignored.
Further information
1. If cull_sol_id_list is NULL or nMaxSolsToCull is zero or nSolsToCull is NULL (i.e., a list of
solution ids cannot be returned) then the routine simply decides whether or not to reject the new
solution based on the assumption that no currently existing solutions are to be dropped.
2. The user can drop solutions by calling XPRS_msp_delsol on the MIP solution pool being used by
the enumerator.
3. To call the routine ignoring the new solution the user can pass the argument bRejectSoln as
NULL. Note that if the new solution is not to be ignored then the user must pass bRejectSoln as
non-NULL with an initial value of zero.
Related topics
XPRS_msp_delsol.

Fair Isaac Corporation Confidential and Proprietary Information

78

MSE Functions

XPRS_mse_getdblattrib
Purpose
Provides read access to the values of double attributes associated with the MIP solution
enumerator.
Synopsis
int XPRS_CC XPRS_mse_getdblattrib(XPRSmipsolenum mse, int iAttribId, double * Val)
Arguments
mse
The current MIP solution enumerator.
iAttribId
Id of attribute whose value is to be returned. A full list of all available attributes
may be found in Chapter 8, or from the list in the xprs.h header file.
Val
Pointer to an double where the value of the attribute will be returned.
Related topics
XPRS_mse_getintattrib.

Fair Isaac Corporation Confidential and Proprietary Information

79

MSE Functions

XPRS_mse_getdblcontrol
PurposeRetrieves the value of a given double control parameter.
Synopsis
int XPRS_CC XPRS_mse_getdblcontrol(XPRSmipsolenum mse, int iControlId, double * Val)
Arguments
mse
The current MIP solution enumerator.
iControlId Id of control whose value is to be returned. A full list of all available controls may
be found in Chapter 7, or from the list in the xprs.h header file.
Val
Pointer to a double where the value of the control will be returned.
Related topics
XPRS_mse_getintcontrol, XPRS_mse_setdblcontrol, XPRS_mse_setintcontrol.

Fair Isaac Corporation Confidential and Proprietary Information

80

MSE Functions

XPRS_mse_getintattrib
Purpose
Provides read access to the values of integer attributes associated with the MIP solution
enumerator.
Synopsis
int XPRS_CC XPRS_mse_getintattrib(XPRSmipsolenum mse, int iAttribId, int * Val)
Arguments
mse
The current MIP solution enumerator.
iAttribId
Id of attribute whose value is to be returned. A full list of all available attributes
may be found in Chapter 8, or from the list in the xprs.h header file.
Val
Pointer to an integer where the value of the attribute will be returned.
Related topics
XPRS_mse_getdblattrib.

Fair Isaac Corporation Confidential and Proprietary Information

81

MSE Functions

XPRS_mse_getintcontrol
PurposeRetrieves the value of a given integer control parameter.
Synopsis
int XPRS_CC XPRS_mse_getintcontrol(XPRSmipsolenum mse, int iControlId, int * Val)
Arguments
mse
The current MIP solution enumerator.
iControlId Id of control whose value is to be returned. A full list of all available controls may
be found in Chapter 7, or from the list in the xprs.h header file.
Val
Pointer to a integer where the value of the control will be returned.
Related topics
XPRS_mse_getdblcontrol, XPRS_mse_setdblcontrol, XPRS_mse_setintcontrol.

Fair Isaac Corporation Confidential and Proprietary Information

82

MSE Functions

XPRS_mse_getlasterror
PurposeGets the last error message.
Synopsis
int XPRS_CC XPRS_mse_getlasterror(XPRSmipsolenum mse, int * iMsgNumber, char * msg,
int iStringBufferBytes, int * iBytesInInternalString)Arguments
mse
The current MIP solution enumerator.
iMsgNumber
A pointer to an integer to return the number of the last error message. Can be
NULL if not required. Refer to Chapter 11 of the Optimizer Reference Manual for a listof possible error numbers, the errors and warnings that they indicate, and advice on
what they mean and how to resolve them.
msg
A character buffer of length at least iStringBufferBytes to return the error message.
Can be NULL if not required.
iStringBufferBytes The length of the msg buffer.
iBytesInInternalString A pointer to an integer to return the number of bytes required tostore the error message. Can be NULL if not required.
Related topics
Chapter 11 of the Optimizer Reference Manual , XPRS_mse_setcbmsghandler.

Fair Isaac Corporation Confidential and Proprietary Information

83

MSE Functions

XPRS_mse_getsolbasename
PurposeGets the name currently used as a prefix for solutions found during the enumeration run.
Synopsis
int XPRS_CC XPRS_mse_getsolbasename(XPRSmipsolenum mse, char * sname, int
iStringBufferBytes, int * iBytesInInternalString)Arguments
mse
sname

The current MIP solution enumerator.
A character buffer of length at least iStringBufferBytes to return the name. Can be
NULL if not required.
iStringBufferBytes
The length of the sname buffer.
iBytesInInternalString
A pointer to an integer to return the number of bytes required tostore the name. Can be NULL if not required.

Related topics
XPRS_mse_setsolbasename.

Fair Isaac Corporation Confidential and Proprietary Information

84

MSE Functions

XPRS_mse_getsollist
PurposeReturns a list of solution ids of solutions found during the enumeration. The list is sorted by thevalue of some attribute of the solutions e.g., the MIP objective value.
Synopsis
int XPRS_CC XPRS_mse_getsollist(XPRSmipsolenum mse, int iMetricId, int
iRankFirstIndex, int iRankLastIndex, int iSolutionIds[], int * nReturnedSolIds,
int * nSols)
Arguments
mse
The current MIP solution enumerator.
iMetricId
Id of the attribute whose value is used to rank the solution ids returned in theiSolutionIds array e.g., the MIP objective value is used when MSE_METRIC_MIPOBJECT ispassed down. A full list of all available attributes may be found in Chapter 8, or fromthe list in the xprs.h header file.
iRankFirstIndex Index (one-based) in the rank order of solutions for which the associatedsolution’s id number, if there is a solution at this index, is to be returned in the firstelement of array iSolutionIds. If iRankLastIndex > iRankFirstIndex then any
subsequent solutions in the rank ordering are to have their solution ids written to thesubsequent elements of iSolutionIds.
iRankLastIndex If iSolutionIds is non-NULL then at most iRankLastIndex iRankFirstIndex + 1 solution ids will be written to iSolutionIds. There will be fewer
solution ids written if iRankLastIndex is greater than the number of solutions
registered in the MIP solution enumerator.
iSolutionIds Integer array where the solution ids will be returned. May be NULL if not
required.
nReturnedSolIds Pointer to an integer where the number of solution ids that were available tobe written is returned. This number will always be less than or equal toiRankLastIndex - iRankFirstIndex + 1. A value is returned for this parameter
regardless of whether iSolutionIds is passed as NULL. May be NULL if not required.
nSols
Pointer to an integer where the total number of solution ids that could possibly be
written is returned. May be NULL if not required.
Related topics
XPRS_mse_opt, XPRS_mse_minim, XPRS_mse_maxim.

Fair Isaac Corporation Confidential and Proprietary Information

85

MSE Functions

XPRS_mse_getsolmetricPurposeGets the value of a metric for a solution.
Synopsis
int XPRS_CC XPRS_mse_getsolmetric(XPRSmipsolenum mse, int iSolutionId, int *iSolutionIdStatus, int iMetricId, double * dMetric)
Arguments
mse
The current MIP solution enumerator.
iSolutionId The id of the solution for which the metric is to be returned.
iSolutionIdStatus Pointer to an int where the status of the iSolutionId will be returned. The
returned value is one of:-2
Solution id does not exist;-1
Solution with the given id is already deleted;0
Solution id was for an active solution.
iMetricId
Id of metric whose value is to be returned. A full list of all available metrics may befound in Chapter 8, or from the list in the xprs.h header file.
dMetric
Pointer to a double where the value of the metric will be returned.
Further information
1. The user will obtain the solution id iSolutionId from interaction with the MIP solution
enumerator via functions such as XPRS_mse_getsollist and XPRS_mse_getcullchoice.
2. If iSolutionId is passed in as less than or equal to zero then the routine returns the worst valueof the metric for the current set of solutions.
Related topics
XPRS_mse_getsollist, XPRS_mse_getcullchoice.

Fair Isaac Corporation Confidential and Proprietary Information

86

MSE Functions

XPRS_mse_maxim
PurposeOne of three routines to run the enumeration. This routine starts the enumeration run on the
problem by calling XPRSmaxim (p.285 of the Optimizer Reference Manual ).
Synopsis
int XPRS_CC XPRS_mse_maxim(XPRSmipsolenum mse, XPRSprob prob, XPRSmipsolpool msp, int(XPRS_CC * f_mse_handler)(XPRSmipsolenum mse, XPRSprob prob, XPRSmipsolpool
msp, void *ctx, int * const nMaxSols, const double * const x, const int nCols,
const double dMipObject, double * const dModifiedObject, int * const
bRejectSoln, int * const bUpdateMipAbsCutOffOnCurrentSet), void * p, int *nMaxSols)
Further information
See XPRS_mse_minim for details.
Related topics
XPRSmaxim (p.285 of the Optimizer Reference Manual ), XPRS_mse_minim, XPRS_mse_opt.

Fair Isaac Corporation Confidential and Proprietary Information

87

MSE Functions

XPRS_mse_minim
PurposeOne of three routines to run the enumeration. This routine starts the enumeration run on the
problem by calling XPRSminim (p.285 of the Optimizer Reference Manual ).
Synopsis
int XPRS_CC XPRS_mse_minim(XPRSmipsolenum mse, XPRSprob prob, XPRSmipsolpool msp, int(XPRS_CC * f_mse_handler)(XPRSmipsolenum mse, XPRSprob prob, XPRSmipsolpool
msp, void *ctx, int * const nMaxSols, const double * const x, const int nCols,
const double dMipObject, double * const dModifiedObject, int * const
bRejectSoln, int * const bUpdateMipAbsCutOffOnCurrentSet), void * p, int *nMaxSols)
Arguments
mse
The current MIP solution enumerator.
prob
The problem used to enumerate solutions.
msp
The MIP solution pool used to store the solutions found during enumeration.
f_mse_handler A callback function to handle the event that a MIP feasible solution is found in
the enumeration.
p
The user-defined object to be passed to the callback function f_mse_handler.
nMaxSols A pointer to an integer to be passed to the callback function f_mse_handler (and used
only by the callback function) that is intended to store the maximum number ofsolutions the user is prepared to capture during the enumeration.
Further information
1. Although the callback function f_mse_handler may be user-defined a simple version(XPRS_mse_defaulthandler) is provided in the FICO Xpress Optimizer that can be used to manage
common strategies for keeping a ’good’ set of solutions found during enumeration andcontrolling the enumeration run e.g., n-best solutions.
2. Any MIP feasible solutions to prob stored in the MIP solution pool prior to the enumeration run
are passed through the callback f_mse_handler as if they were found during the MIP search on
the prob. Note that new versions of these solutions are created and the original versions aredeleted from the MIP solution pool.
3. The integer pointer nMaxSols is used only by the callback function f_mse_handler.
Related topics
XPRSminim (p.285 of the Optimizer Reference Manual ), XPRS_mse_maxim, XPRS_mse_opt,
XPRS_mse_defaulthandler.

Fair Isaac Corporation Confidential and Proprietary Information

88

MSE Functions

XPRS_mse_opt
PurposeOne of three routines to run the enumeration. This routine starts the enumeration run on the
problem by calling XPRSmipoptimize (p.287 of the Optimizer Reference Manual ).
Synopsis
int XPRS_CC XPRS_mse_opt(XPRSmipsolenum mse, XPRSprob prob, XPRSmipsolpool msp, int(XPRS_CC * f_mse_handler)(XPRSmipsolenum mse, XPRSprob prob, XPRSmipsolpool
msp, void *ctx, int * const nMaxSols, const double * const x, const int nCols,
const double dMipObject, double * const dModifiedObject, int * const
bRejectSoln, int * const bUpdateMipAbsCutOffOnCurrentSet), void * p, int *nMaxSols)
Further information
See XPRS_mse_minim for details.
Related topics
XPRSmipoptimize (p.287 of the Optimizer Reference Manual ), XPRS_mse_minim, XPRS_mse_maxim.

Fair Isaac Corporation Confidential and Proprietary Information

89

MSE Functions

XPRS_mse_removecbmsghandler
PurposeRemoves an output callback function previously added by XPRS_mse_addcbmsghandler. The
specified callback function will no longer be called after it has been removed.
Synopsis
int XPRS_CC XPRS_mse_removecbmsghandler(XPRSmipsolenum mse, int (XPRS_CC*f_msghandler)(XPRSobject vXPRSObject, void * vUserContext, void * vSystemThreadId, const
char * sMsg, int iMsgType, int iMsgNumber), void* object);Arguments
mse
The current MIP solution enumerator
f_msghandler The callback function to remove. If NULL then all output callback functions addedwith the given user-defined object value will be removed.
objectThe object value that the callback was added with. If NULL, then the object value will
not be checked and all variable branching callbacks with the function pointerf_chgbranch will be removed.
Related topics
XPRS_mse_addcbmsghandler.

Fair Isaac Corporation Confidential and Proprietary Information

90

MSE Functions

XPRS_mse_setcbgetsolutiondiff
Purpose
Declares a user-defined solution difference calculation routine, called each time a new pair ofsolutions are required to have a difference metric calculated. This functionality is required when
the MSE_METRIC_DIVERSITY metric is applied to the set of stored solutions with a call to
XPRS_mse_getcullchoice and XPRS_mse_getsolmetric.
Synopsis
int XPRS_CC XPRS_mse_setcbgetsolutiondiff(XPRSmipsolenum mse, int (XPRS_CC *f_mse_getsolutiondiff)(XPRSmipsolenum mse, void * vContext, int nCols, int
iSolutionId_1, int iElemCount_1, double dMipObj_1, const double * Vals_1, const
int * iSparseIndices_1, int iSolutionId_2, int iElemCount_2, double dMipObj_2,
const double * Vals_2, const int * iSparseIndices_2, double * dDiffMetric),
void * p)
Arguments
mse
The current MIP solution enumerator.
f_mse_getsolutiondiff The callback function which takes 14 arguments, mse, vContext, nCols,
iSolutionId_1, iElemCount_1, dMipObj_1, Vals_1, iSparseIndices_1, iSolutionId_2,
iElemCount_2, dMipObj_2, Vals_2, iSparseIndices_2 and dDiffMetric. Use a NULL
value to cancel a callback function.
mse
The current MIP solution enumerator.
vContext The user-defined object passed to the callback function.
nCols
The number of columns in the solutions. This is the same as the column dimension of
the problem when the enumeration was started.
iSolutionId_1 The solution id of the first of the solution pair. This may be -1 in which case thesolution has not yet be stored in the MIP solution pool. This happens when the user
passes a new solution to XPRS_mse_getcullchoice using the diversity metric(MSE_METRIC_DIVERSITY).
iElemCount_1 The number of non-zero elements in the first solution.
dMipObj_1 The MIP objective value of the first solution.
Vals_1
A sparse array of doubles of length iElemCount_1 containing the first solution’s
solution values.
iSparseIndices_1 A sparse array of integers of length iElemCount_1 containing the firstsolution’s column indices.
iSolutionId_2 The solution id of the second of the solution pair.
iElemCount_2 The number of non-zero elements in the second solution.
dMipObj_2 The MIP objective value of the second solution.
Vals_2
A sparse array of doubles of length iElemCount_2 containing the second solution’s
solution values.
iSparseIndices_2 A sparse array of integers of length iElemCount_2 containing the second
solution’s column indices.
dDiffMetric A pointer to a double to return the metric of the difference between the twosolutions.
p
A user-defined object to be passed to the callback function.
Further information
If the user does not provide this callback function then the MIP solution enumerator uses a simple
difference metric that considers only the MIP entities in the solution.

Fair Isaac Corporation Confidential and Proprietary Information

91

MSE Functions

Related topics
XPRS_mse_getcullchoice, XPRS_mse_getsolmetric.

Fair Isaac Corporation Confidential and Proprietary Information

92

MSE Functions

XPRS_mse_setcbmsghandler
Purpose
Declares an output callback function, called every time a line of message text is output by a MIP
solution enumerator object.
Synopsis
int XPRS_CC XPRS_mse_setcbmsghandler(XPRSmipsolenum mse, int (XPRS_CC*f_msghandler)(XPRSobject vXPRSObject, void * vUserContext, void *vSystemThreadId, const char * sMsg, int iMsgType, int iMsgNumber), void * p)
Arguments
mse
The current MIP solution enumerator.
f_msghandler The callback function which takes six arguments, vXPRSObject, vUserContext,
vSystemThreadId, sMsg, iMsgType and iMsgNumber. Use a NULL value to cancel a
callback function.
vXPRSObject A generic pointer to the mse object sending the message.
vUserContext The user-defined object passed to the callback function.
vSystemThreadId The system id of the thread sending the message caste to a void *.
sMsg
A null terminated character array (string) containing the message, which may simply
be a new line. When the callback is called for the first time sMsg will be a NULL
pointer.
iMsgType Indicates the type of output message:
1
information messages;
2(not used);3
warning messages;
4
error messages.
A negative value means the callback is being called for the first time.
iMsgNumber
The number associated with the message. If the message is an error or a warningthen you can look up the number in Chapter 11 of the Optimizer Reference Manual
for advice on what it means and how to resolve the associated issue.
p
A user-defined object to be passed to the callback function.
Further information
To send all messages to a log file the built in message handler XPRSlogfilehandler can be used.
This can be done with:
XPRS_mse_setcbmsghandler(mse, XPRSlogfilehandler, "log.txt");

Related topics
None.

Fair Isaac Corporation Confidential and Proprietary Information

93

MSE Functions

XPRS_mse_setdblcontrol
PurposeSets the value of a given double control parameter.
Synopsis
int XPRS_CC XPRS_mse_setdblcontrol(XPRSmipsolenum mse, int iControlId, double Val)
Arguments
mse
The current MIP solution enumerator.
iControlId Id of control whose value is to be set. A full list of all available controls may befound in Chapter 7, or from the list in the xprs.h header file.
Val
Value to which the control parameter is to be set.
Related topics
XPRS_mse_getdblcontrol, XPRS_mse_setintcontrol, XPRS_mse_getintcontrol.

Fair Isaac Corporation Confidential and Proprietary Information

94

MSE Functions

XPRS_mse_setintcontrol
PurposeSets the value of a given integer control parameter.
Synopsis
int XPRS_CC XPRS_mse_setintcontrol(XPRSmipsolenum mse, int iControlId, int Val)
Arguments
mse
The current MIP solution enumerator.
iControlId Id of control whose value is to be set. A full list of all available controls may befound in Chapter 7, or from the list in the xprs.h header file.
Val
Value to which the control parameter is to be set.
Related topics
XPRS_mse_getintcontrol, XPRS_mse_setdblcontrol, XPRS_mse_getdblcontrol.

Fair Isaac Corporation Confidential and Proprietary Information

95

MSE Functions

XPRS_mse_setsolbasename
PurposeSets the name to be used as a prefix for solutions found during the enumeration run.
Synopsis
int XPRS_CC XPRS_mse_setsolbasename(XPRSmipsolenum mse, const char *sSolutionBaseName)
Arguments
mse
The current MIP solution enumerator.
sSolutionBaseName A null terminated string containing the name to use as a prefix for thesolution names.
Related topics
XPRS_mse_getsolbasename.

Fair Isaac Corporation Confidential and Proprietary Information

96

C HAPTER 7

MSE Controls
MSE_CALLBACKCULLSOLS_DIVERSITY This control is used only by the callback passed to theenumeration-run routines XPRS_mse_minim, XPRS_mse_maxim and
XPRS_mse_opt. If the user passes the default callback
XPRS_mse_defaulthandler then the control is used to decide how manysolutions to discard based on the diversity metric values. See
XPRS_mse_defaulthandler for details of how the control is used. If theuser provides a customized version of XPRS_mse_defaulthandler to use
in the enumeration-run then the user is free to interpret this control
value.
p. 97
MSE_CALLBACKCULLSOLS_MIPOBJECT This control is used only by the callback passed to theenumeration-run routines XPRS_mse_minum, XPRS_mse_maxim and
XPRS_mse_opt. If the user passes the default callback
XPRS_mse_defaulthandler then the control is used to decide how manysolutions to discard based on the MIP objective values. See
XPRS_mse_defaulthandler for details of how the control is used. If theuser provides a customized version of XPRS_mse_defaulthandler to use
in the enumeration-run then the user is free to interpret this control
value.
p. 98
MSE_CALLBACKCULLSOLS_MODOBJECT This control is used only by the callback passed to theenumeration-run routines XPRS_mse_minim, XPRS_mse_maxim and
XPRS_mse_opt. If the user passes the default callback
XPRS_mse_defaulthandler then the control is used to decide how manysolutions to discard based on the user’s modified objective values. See
XPRS_mse_defaulthandler for details of how the control is used. If theuser provides a customized version of XPRS_mse_defaulthandler to use
in the enumeration-run then the user is free to interpret this control
value.
p. 98
MSE_OPTIMIZEDIVERSITY

Controls whether or not the values returned by
XPRS_mse_getcullchoice for the diversity metric are defined by simply
sorting the diversity values or if an optimization-based heuristic is to
be used.
p. 98

MSE_OUTPUTTOL

Zero tolerance on print values.

p. 99

MSE_CALLBACKCULLSOLS_DIVERSITY
Description

This control is used only by the callback passed to the enumeration-run routines
XPRS_mse_minim, XPRS_mse_maxim and XPRS_mse_opt. If the user passes the default

Fair Isaac Corporation Confidential and Proprietary Information

97

MSE Controls

callback XPRS_mse_defaulthandler then the control is used to decide how manysolutions to discard based on the diversity metric values. See XPRS_mse_defaulthandler
for details of how the control is used. If the user provides a customized version of
XPRS_mse_defaulthandler to use in the enumeration-run then the user is free tointerpret this control value.
Type

Integer

Default value-1

Affects routines

XPRS_msp_getintcontrol, XPRS_msp_setintcontrol.

See also

MSE_METRIC_DIVERSITY

MSE_CALLBACKCULLSOLS_MIPOBJECT
Description

This control is used only by the callback passed to the enumeration-run routines
XPRS_mse_minum, XPRS_mse_maxim and XPRS_mse_opt. If the user passes the default
callback XPRS_mse_defaulthandler then the control is used to decide how manysolutions to discard based on the MIP objective values. See XPRS_mse_defaulthandler for
details of how the control is used. If the user provides a customized version of
XPRS_mse_defaulthandler to use in the enumeration-run then the user is free tointerpret this control value.

Type

Integer

Default value-1

Affects routines

XPRS_msp_getintcontrol, XPRS_msp_setintcontrol

See also

XPRS_mse_defaulthandler, XPRS_mse_getcullchoice, MSE_METRIC_MODOBJECT.

MSE_CALLBACKCULLSOLS_MODOBJECT
Description

This control is used only by the callback passed to the enumeration-run routines
XPRS_mse_minim, XPRS_mse_maxim and XPRS_mse_opt. If the user passes the default
callback XPRS_mse_defaulthandler then the control is used to decide how manysolutions to discard based on the user’s modified objective values. See
XPRS_mse_defaulthandler for details of how the control is used. If the user provides acustomized version of XPRS_mse_defaulthandler to use in the enumeration-run then theuser is free to interpret this control value.

Type

Integer

Default value-1

MSE_OPTIMIZEDIVERSITY
Description

Controls whether or not the values returned by XPRS_mse_getcullchoice for thediversity metric are defined by simply sorting the diversity values or if an
optimization-based heuristic is to be used.

Fair Isaac Corporation Confidential and Proprietary Information

98

MSE Controls

Type

Integer

Values0
1

Default value0

Affects routines

XPRS_msp_getintcontrol, XPRS_msp_setintcontrol

See also

MSE_METRIC_DIVERSITY, XPRS_mse_getcullchoice.

Sorting is used.
An optimization-based heuristic is used.

MSE_OUTPUTTOL
Description

Zero tolerance on print values.

Type

DoubleDefault value

1.0E-05

Fair Isaac Corporation Confidential and Proprietary Information

99

C HAPTER 8

MSE Attributes
MSE_DIVERSITYSUM

Sum of diversity metrics for the current set of solutions.

p. 100MSE_METRIC_DIVERSITY

The diversity metric for a solution is the sum of difference metrics
between the solution and all others in the current set. The difference
value between two solutions is either calculated internally by the MIP
solution enumerator (using a simple difference metric that considers
only the MIP entities in the solution) or else by the user in a callback
defined with a call to XPRS_mse_setcbgetsolutiondiff.
p. 100MSE_METRIC_MIPOBJECTMIP objective value.

MSE_METRIC_MODOBJECT

User-defined modified objective. The user can assign a solution withan objective value that reflects the ’true’ objective of the solution incases where the MIP objective does not completely model the user’s
problem. The user needs to return this value from a callback passed tothe enumeration-run routines XPRS_mse_minim, XPRS_mse_maximand XPRS_mse_opt. This routine will be some customized version of
the XPRS_mse_defaulthandler routine provided with the FICO Xpress
Optimizer.
p. 101

MSE_SOLUTIONSThe number of solutions found and currently stored by the MIP
solution enumerator.
p. 101

p. 101

MSE_DIVERSITYSUM
Description

Sum of diversity metrics for the current set of solutions.

Type

DoubleSet by routines

XPRS_msp_getdblattrib

See also

MSE_METRIC_DIVERSITY

MSE_METRIC_DIVERSITY
Description

The diversity metric for a solution is the sum of difference metrics between the solution
and all others in the current set. The difference value between two solutions is either
calculated internally by the MIP solution enumerator (using a simple difference metric

Fair Isaac Corporation Confidential and Proprietary Information

100

MSE Attributes

that considers only the MIP entities in the solution) or else by the user in a callback
defined with a call to XPRS_mse_setcbgetsolutiondiff.
Type

DoubleSet by routines

XPRS_msp_getsolmetric

See also

XPRS_mse_setcbgetsolutiondiff

MSE_METRIC_MIPOBJECT
Description

MIP objective value.

Type

DoubleMSE_METRIC_MODOBJECT
Description

User-defined modified objective. The user can assign a solution with an objective valuethat reflects the ’true’ objective of the solution in cases where the MIP objective does
not completely model the user’s problem. The user needs to return this value from acallback passed to the enumeration-run routines XPRS_mse_minim, XPRS_mse_maxim and
XPRS_mse_opt. This routine will be some customized version of the
XPRS_mse_defaulthandler routine provided with the FICO Xpress Optimizer.

Type

DoubleSet by routines

XPRS_msp_getsolmetric

See also

XPRS_mse_defaulthandler, XPRS_mse_minim, XPRS_mse_maxim, XPRS_mse_opt.

MSE_SOLUTIONS
Description

The number of solutions found and currently stored by the MIP solution enumerator.

Type

Integer

Set by routines

XPRS_msp_getintattrib

See also

XPRS_mse_defaulthandler

Fair Isaac Corporation Confidential and Proprietary Information

101

Appendix

A PPENDIX A

Error codes
Following an error exit from a function call to the MIP solution pool or the MIP solution
enumerator library users may access the error code and a short string description of the error
using the functions XPRS_msp_getlasterror or XPRS_mse_getlasterror. The following sections list
the error codes returned by calls to the MIP solution pool and MIP solution enumerator functions.
The main Optimizer Reference manual contains the list of error codes returned by the rest of the
API.

A.1

MIP Solution Pool errors
800

First index outside bounds: <col_index>not in [0,<num_cols>- 1]
The index col_index of the first column passed to XPRS_msp_getsol is outside the range [0,<num_cols>- 1]

801

First index greater than last
The index of the first column passed to XPRS_msp_getsol is greater than the index of thelast column.

802

Attempt to attach problem more than one XPRSmipsolpool: Attach failed
A problem cannot be attached to more than one MIP solution pool.

804

Unable to check if loaded sol is dupld: No global model avail
A check if the solution being loaded is a duplicate of an existing solution cannot be madesince no global model is available. No model is available because no problem has been
attached to the MIP solution pool.

805

Unable to check if loaded sol is dupld: Memory allocation failure
A check if the solution being loaded is a duplicate of an existing solution failed because ofa memory allocation failure.

806

Unable to check if loaded sol is dupld: Incompat src prob
A check if the solution being loaded is a duplicate of an existing solution cannot be madebecause the problem from which the solution originates does not match the global model
used for duplicate checking.

807

Unable to check if loaded sol is dupld: Global model unreliable
A check if the solution being loaded is a duplicate of an existing solution cannot be madebecause a required update of the global model could not be made reliably.

808

Unable to check if loaded sol is dupld: Global model reqd but inaccessible
A check if the solution being loaded is a duplicate of an existing solution cannot be madebecause a required update of the global model could not be made.

Fair Isaac Corporation Confidential and Proprietary Information

103

Error codes

809

Duplicate sol chck may not work: Global model inaccessible in attaching prob
A check if the solution being loaded is a duplicate of an existing solution cannot be madebecause a required capture of the global model could not be made from the problem
being attached.

810

Destroying XPRSmipsolpool with problems still attached: Probs detached automatically
The MIP solution pool is being destroyed and problems are still attached. This should be ok
although the user should be aware. This message can be avoided by detaching theattached problems before destroying the MIP solution pool.

812

Compl duplicate sol chck: Failed
A reset operation for the duplicate solution information failed. The duplicate solution
checking may now not work reliably.

814

Failed to capture solution information
Failure calculating the information for a solution with respect to a problem.

815

Failed to generate solution check sum
A check of the problem state information failed when trying to calculate a check sum.

816

Failed to capture solution
An unexpected failure when attempting to capture a solution.

817

Failure in internal event registration
An object failed to register to receive system events.

818

Failure in internal event deregistration
An object failed to deregister the receipt of system events.

821

Unrecoverable memory allocation failure
A call made by the user failed because of a memory allocation failure.

822

Recoverable memory allocation failure: <operation_attempted>
A memory allocation failed when attempting the operation <operation_attempted >. The
system may still continue to function normally.

826

Soln col count does not match prob: <prob_id_string>: <solution_id>
The numbers of columns of solution <solution_id>and of problem <prob_id_string>arerequired to be the equal (but they are not).

827

Soln is deleted and no longer available: <solution_id>
The user has attempted to access information for the solution with id <solution_id>but thesolution has been deleted.

829

Soln id does not exist: <solution_id>
The user has attempted to access information for the solution with id <solution_id>but theid is for a solution that does not exist.

830

Unable to make a reliable list of sols for prob: <prob_id_string>: Unable to access probstate
An attempt to make a list of solutions that relate to problem <prob_id_string>failed
because state information of the problem could not be reliably accessed.

831

Unrecognized attribute id <attribute_id>: Solutions will not be sorted
The user seems to want a list of solutions sorted by some attribute but the attribute id is
not recognized.

Fair Isaac Corporation Confidential and Proprietary Information

104

Error codes

835

Column count does not match prob: <num_solution_cols>: <num_prob_cols>
The numbers of columns of a given solution vector and of a given problem are required tobe the equal (but they are not).

836

Failure writing solution to file: <file_name>
An unexpected failure was encountered writing solution(s) to file <file_name>.

837

Failure opening file for writing: <file_name>
An unexpected failure was encountered opening file <file_name>for writing.

838

Failure opening file for reading: <file_name>
An unexpected failure was encountered opening file <file_name>for reading.

839

Loading sol failed : <prob_id_string>: id=<solution_id><message>
A failure occurred when loading solution <solution_id>into problem <prob_id_string>. The
failure is described in string <message>.

842

Loading sol interrupted: <prob_id_string>: id=<solution_id>
Loading was interrupted of solution <solution_id>into problem <prob_id_string>.

851

Unrecognized duplicate solution policy id: <policy_id>
The user has attempted to set an unrecognized value <policy_id>for the control
MSP_DUPLICATESOLUTIONSPOLICY.

852

Reading solution skipped: ‘<solution_name>’
The solution named <solution_name>was skipped while reading solutions from file. A
previous message describes why the solution could not be read.

853

Error detected in debug duplicate solution check: <message>
A rigorous duplicate solution checking routine found an anomaly described in <message>.

855

Changing <tolerance_name>for solution ‘<solution_name>’ captured from problem:<system_tol_value>-><user_tol_value>
A warning that the user is changing the tolerance <tolerance_name>(MIPTOL or FEASTOL)
for a solution from the value it was set to by the system <system_tol_value>to a different
value <user_tol_value>.

859

No solutions written
No solutions were written in a call to XPRS_msp_writeslxsol.

868<operation_name>is only allowed for attached problems
The operation <operation_name>is only allowed for problems attached to the MIP solution
pool.

869

Soln is deleted and no longer available: <solution_id>
The user has attempted to access information for the solution with id <solution_id>but thesolution seems to have been deleted.

870

Soln id does not exist: <solution_id>
The user has attempted to access information for the solution with id <solution_id>but theid is for a solution that has not yet been encountered.

871

Unrecoverable memory allocation failure
A call made by the user failed because of a memory allocation failure.

Fair Isaac Corporation Confidential and Proprietary Information

105

Error codes874

Unrecognized solution metric id: <metric_id>
The metric id <metric_id>passed by the user is unrecognized.

875

No solutions available
The user is attempting to access information about the stored solutions but the solution
storage is empty.

876

Enumerator is already running
The user is attempting to run the enumeration while the enumeration is already running.

875

Failed to access XPRSmipsolpool state: <access_operation>
The MIP solution enumerator failed accessing the MIP solution pool state with access
operation <access_operation>.

878

Failed to access XPRSprob state: <access_operation>
The MIP solution enumerator failed accessing the problem state with access operation<access_operation>.

879

Failed to allocate memory
The MIP solution enumerator failed to allocate memory.

882

Missing required arguments for running enumerator
Arguments passed to the enumeration-run routine (e.g., XPRS_mse_minim) were required
to be non-NULL but were passed as NULL.

883

Problem no longer has the same number of columns
The column dimension of the problem used by the MIP solution enumerator was changed
by user.

885

Failure storing solution with memory allocation failure
A memory allocation failure meant that a solution could not be captured.

886

Failure storing solution(s) with failed access to XPRSmipsolpool state: <access_operation>
A solution could not be captured because of a failure accessing the state of the MIP
solution pool with access operation <access_operation>.

887

Failure storing solution(s) with failed access to XPRSprob state: <access_operation>
A solution could not be captured because of a failure accessing the state of the problem
with access operation <access_operation>.

1000 Invalid parameter access : <error_message>(<routine_name>)
Access to a parameter with a call to routine <routine_name>failed because of error
described in <error_message>.
1006 Failed to capture solution information from problem
Failure calculating the information for a solution with respect to a problem.
1012 Problem <prob_id_string>detached unexpectedly
A problem <prob_id_string>attached to the MIP solution pool was unexpectedly detachedby the user.
1013 Cannot attach thread problem to MIP solution pool
The user has attempted to attach an internal problem being solved by the parallel MIP
search to a MIP solution pool.

Fair Isaac Corporation Confidential and Proprietary Information

106Error codes

1014 Column count mismatch: <num_solution_cols>!= <num_row_vector_cols>
A row vector of length <num_row_vector_cols>passed to the MIP solution pool forevaluation against a solution does not contain the same number of columns as the solution<num_solution_cols>.

A.2

MIP Solution Enumerator errors
869

Soln is deleted and no longer available: <solution_id>
The user has attempted to access information for the solution with id <solution_id>but thesolution seems to have been deleted.

870

Soln id does not exist: <solution_id>
The user has attempted to access information for the solution with id <solution_id>but theid is for a solution that has not yet been encountered.

871

Unrecoverable memory allocation failure
A call made by the user failed because of a memory allocation failure.

874

Unrecognized solution metric id: <metric_id>
The metric id <metric_id>passed by the user is unrecognized.

875

No solutions available
The user is attempting to access information about the stored solutions but the solution
storage is empty.

876

Enumerator is already running
The user is attempting to run the enumeration while the enumeration is already running.

877

Failed to access XPRSmipsolpool state: <access_operation>
The MIP solution enumerator failed accessing the MIP solution pool state with access
operation <access_operation>.

878

Failed to access XPRSprob state: <access_operation>
The MIP solution enumerator failed accessing the problem state with access operation<access_operation>.

879

Failed to allocate memory
The MIP solution enumerator failed to allocate memory.

882

Missing required arguments for running enumerator
Arguments passed to the enumeration-run routine (e.g., XPRS_mse_minim) were required to
be non-NULL but were passed as NULL.

883

Problem no longer has the same number of columns
The column dimension of the problem used by the MIP solution enumerator was changed
by user.

885

Failure storing solution with memory allocation failure
A memory allocation failure meant that a solution could not be captured.

886

Failure storing solution(s) with failed access to XPRSmipsolpool state: <access_operation>
A solution could not be captured because of a failure accessing the state of the MIP
solution pool with access operation <access_operation>.

Fair Isaac Corporation Confidential and Proprietary Information

107

Error codes

887

Failure storing solution(s) with failed access to XPRSprob state: <access_operation>
A solution could not be captured because of a failure accessing the state of the problem
with access operation <access_operation>.

1000 Invalid parameter access : <error_message>(<routine_name>)
Access to a parameter with a call to routine <routine_name>failed because of error
described in <error_message>.
1007 Unexpected failure evaluating solution difference metric
An unexpected failure occurred while evaluating difference metrics for solutions.
1008 Solution difference metric value is reserved : -1.7976931348623158e+308
The double value -1.7976931348623158e+308 to be assigned for a difference metricbetween two solutions is reserved by the system.
1009 Unexpected failure evaluating solution differences
An unexpected error occurred while evaluating the diversity of the stored solutions.
1010 User signaled failure in solution difference metric callback
The user signaled a failure in the callback defined by a call to
XPRS_mse_setcbgetsolutiondiff.
1011 Cannot evaluate diversity of new solution: Column number mismatch:<num_solution_cols>!= <num_prob_cols>
The solution passed down to XPRS_mse_getcullchoice for the diversity metric does nothave the same number of columns as the problem used in the enumeration run.
1015 Destroying while enumeration running
The user is attempting to destroy the MIP solution enumerator while it is running.
1016 Failed to update MIPABSCUTOFF
The MIP solution enumerator failed to update the MIPABSCUTOFF (p.422 of the Optimizer
Reference Manual ) on the problem running the enumeration.
1017 Unable to check if loaded sol is dupld: Sol cols (num_solution_cols) does not match global
model (num_global_model_cols)
A check if the solution being loaded is a duplicate of an existing solution cannot be madebecause the solution array does not have the same number of columns as the global model
used for duplicate checking.
1018 Global model unavailable for diversity: <reason_string>
The MIP solution enumerator is setup such that internal solution diversity calculations may
be made although this will fail because it requires that an appropriate problem is attachedto the MIP solution pool (see <reason_string> for details).
1019 Cannot handle diversity: <reason_string>
The user has called a function that requires solution diversity calculations to be madeinternally by the MIP solution enumerator and this has failed because it requires that an
appropriate problem is attached to the MIP solution pool (see <reason_string> for details).

Fair Isaac Corporation Confidential and Proprietary Information

108

A PPENDIX B

Contacting FICO
FICO provides clients with support and services for all our products. Refer to the following
sections for more information.

Product support
FICO offers technical support and services ranging from self-help tools to direct assistance with a
FICO technical support engineer. Support is available to all clients who have purchased a FICO
product and have an active support or maintenance contract. You can find support contact
information on the Product Support home page (www.fico.com/support).
On the Product Support home page, you can also register for credentials to log on to FICO Online
Support, our web-based support tool to access Product Support 24x7 from anywhere in the world.
Using FICO Online Support, you can enter cases online, track them through resolution, findarticles in the FICO Knowledge Base, and query known issues.
Please include ’Xpress’ in the subject line of your support queries.

Product education
FICO Product Education is the principal provider of product training for our clients and partners.
Product Education offers instructor-led classroom courses, web-based training, seminars, andtraining tools for both new user enablement and ongoing performance support. For additional
information, visit the Product Education homepage at www.fico.com/en/product-training or
email producteducation@fico.com.

Product documentation
FICO continually looks for new ways to improve and enhance the value of the products andservices we provide. If you have comments or suggestions regarding how we can improve thisdocumentation, let us know by sending your suggestions to techpubs@fico.com.

Fair Isaac Corporation Confidential and Proprietary Information

109

Contacting FICO

Sales and maintenanceUSA, CANADA AND ALL AMERICASEmail: XpressSalesUS@fico.com
WORLDWIDE
Email: XpressSalesUK@fico.com
Tel: +44 207 940 8718
Fax: +44 870 420 3601
Xpress Optimization, FICO
FICO HouseInternational Square
Starley Way
Birmingham B37 7GN
UK

Related services
Strategy Consulting: Included in your contract with FICO may be a specified amount ofconsulting time to assist you in using FICO Optimization Modeler to meet your business needs.
Additional consulting time can be arranged by contract.
Conferences and Seminars: FICO offers conferences and seminars on our products and services.
For announcements concerning these events, go to www.fico.com or contact your FICO accountrepresentative.

About FICO
FICO (NYSE:FICO) delivers superior predictive analytics solutions that drive smarter decisions. The
company’s groundbreaking use of mathematics to predict consumer behavior has transformed
entire industries and revolutionized the way risk is managed and products are marketed. FICO’sinnovative solutions include the FICO® Score—the standard measure of consumer credit risk in
the United States—along with industry-leading solutions for managing credit accounts,
identifying and minimizing the impact of fraud, and customizing consumer offers with pinpoint
accuracy. Most of the world’s top banks, as well as leading insurers, retailers, pharmaceuticalcompanies, and government agencies, rely on FICO solutions to accelerate growth, control risk,
boost profits, and meet regulatory and competitive demands. FICO also helps millions ofindividuals manage their personal credit health through www.myfico.com. Learn more atwww.fico.com. FICO: Make every decision countTM .

Fair Isaac Corporation Confidential and Proprietary Information

110IndexNumbers
800, 103
801, 103
802, 103
804, 103
805, 103
806, 103
807, 103
808, 103
809, 104
810, 104
812, 104
814, 104
815, 104
816, 104
817, 104
818, 104
821, 104
822, 104
826, 104
827, 104
829, 104
830, 104
831, 104
835, 105
836, 105
837, 105
838, 105
839, 105
842, 105
851, 105
852, 105
853, 105
855, 105
859, 105
868, 105
869, 105, 107
870, 105, 107871, 105, 107874, 106, 107875, 106, 107876, 106, 107877, 107
878, 106, 107
879, 106, 107882, 106, 107883, 106, 107885, 106, 107
886, 106, 107
887, 106, 108
1000, 106, 108
1006, 106

Fair Isaac Corporation Confidential and Proprietary Information

1007, 108
1008, 108
1009, 108
1010, 108
1011, 108
1012, 106
1013, 106
1014, 1071015, 108
1016, 108
1017, 108
1018, 108
1019, 108
M
MSE_CALLBACKCULLSOLS_DIVERSITY, 97
MSE_CALLBACKCULLSOLS_MIPOBJECT, 98
MSE_CALLBACKCULLSOLS_MODOBJECT, 98
MSE_DIVERSITYSUM, 100
MSE_METRIC_DIVERSITY, 100
MSE_METRIC_MIPOBJECT, 101
MSE_METRIC_MODOBJECT, 101
MSE_OPTIMIZEDIVERSITY, 98
MSE_OUTPUTTOL, 99
MSE_SOLUTIONS, 101
MSP_DEFAULTUSERSOLFEASTOL, 51
MSP_DEFAULTUSERSOLMIPTOL, 52
MSP_DUPLICATESOLUTIONSPOLICY, 52
MSP_INCLUDEPROBNAMEINLOGGING, 52
MSP_PRB_FEASIBLESOLS, 56
MSP_PRB_VALIDSOLS, 57
MSP_SOL_BITFIELDSSYS, 65
MSP_SOL_BITFIELDSUSR, 52
MSP_SOL_COLS, 65
MSP_SOL_FEASTOL, 53
MSP_SOL_ISREPROCESSEDUSERSOLUTION, 65
MSP_SOL_ISUSERSOLUTION, 65
MSP_SOL_MIPTOL, 53
MSP_SOL_NONZEROS, 65
MSP_SOLPRB_INFCNT_BIN, 57
MSP_SOLPRB_INFCNT_COLUMN, 57
MSP_SOLPRB_INFCNT_DELAYEDROW, 57
MSP_SOLPRB_INFCNT_INT, 57
MSP_SOLPRB_INFCNT_MIP, 57
MSP_SOLPRB_INFCNT_PI, 58
MSP_SOLPRB_INFCNT_PRIMAL, 58
MSP_SOLPRB_INFCNT_SC, 58
MSP_SOLPRB_INFCNT_SET1, 58
MSP_SOLPRB_INFCNT_SET2, 58
MSP_SOLPRB_INFCNT_SI, 58
MSP_SOLPRB_INFCNT_SLACK, 59
MSP_SOLPRB_INFEASCOUNT, 59

111

IndexMSP_SOLPRB_INFMAX_BIN, 59
MSP_SOLPRB_INFMAX_COLUMN, 59
MSP_SOLPRB_INFMAX_DELAYEDROW, 59
MSP_SOLPRB_INFMAX_INT, 59
MSP_SOLPRB_INFMAX_PI, 60
MSP_SOLPRB_INFMAX_SC, 60
MSP_SOLPRB_INFMAX_SET1, 60
MSP_SOLPRB_INFMAX_SET2, 60
MSP_SOLPRB_INFMAX_SI, 60
MSP_SOLPRB_INFMAX_SLACK, 60
MSP_SOLPRB_INFMXI_BIN, 61
MSP_SOLPRB_INFMXI_COLUMN, 61
MSP_SOLPRB_INFMXI_DELAYEDROW, 61
MSP_SOLPRB_INFMXI_INT, 61
MSP_SOLPRB_INFMXI_PI, 61
MSP_SOLPRB_INFMXI_SC, 61
MSP_SOLPRB_INFMXI_SET1, 62
MSP_SOLPRB_INFMXI_SET2, 62
MSP_SOLPRB_INFMXI_SI, 62
MSP_SOLPRB_INFMXI_SLACK, 62
MSP_SOLPRB_INFSUM_BIN, 62
MSP_SOLPRB_INFSUM_COLUMN, 62
MSP_SOLPRB_INFSUM_DELAYEDROW, 63
MSP_SOLPRB_INFSUM_INT, 63
MSP_SOLPRB_INFSUM_MIP, 63
MSP_SOLPRB_INFSUM_PI, 63
MSP_SOLPRB_INFSUM_PRIMAL, 63
MSP_SOLPRB_INFSUM_SC, 63
MSP_SOLPRB_INFSUM_SET1, 64
MSP_SOLPRB_INFSUM_SET2, 64
MSP_SOLPRB_INFSUM_SI, 64
MSP_SOLPRB_INFSUM_SLACK, 64
MSP_SOLPRB_OBJ, 64
MSP_SOLUTIONS, 64
X
XPRS_mse_addcbmsghandler, 73
XPRS_mse_create, 74
XPRS_mse_defaulthandler, 75
XPRS_mse_destroy, 76
XPRS_mse_getcbmsghandler, 77
XPRS_mse_getcullchoice, 78
XPRS_mse_getdblattrib, 79
XPRS_mse_getdblcontrol, 80
XPRS_mse_getintattrib, 81
XPRS_mse_getintcontrol, 82
XPRS_mse_getlasterror, 83
XPRS_mse_getsolbasename, 84
XPRS_mse_getsollist, 85
XPRS_mse_getsolmetric, 86
XPRS_mse_maxim, 87
XPRS_mse_minim, 88
XPRS_mse_opt, 89
XPRS_mse_removecbmsghandler, 90
XPRS_mse_setcbgetsolutiondiff, 91
XPRS_mse_setcbmsghandler, 93
XPRS_mse_setdblcontrol, 94
XPRS_mse_setintcontrol, 95
XPRS_mse_setsolbasename, 96
XPRS_msp_addcbmsghandler, 12

Fair Isaac Corporation Confidential and Proprietary Information

XPRS_msp_create, 13
XPRS_msp_delsol, 14
XPRS_msp_destroy, 15
XPRS_msp_findsolbyname, 16
XPRS_msp_getcbmsghandler, 17
XPRS_msp_getdblattrib, 18
XPRS_msp_getdblattribprob, 19
XPRS_msp_getdblattribprobextreme, 20
XPRS_msp_getdblattribprobsol, 21
XPRS_msp_getdblattribsol, 22
XPRS_msp_getdblcontrol, 23
XPRS_msp_getdblcontrolsol, 24
XPRS_msp_getintattrib, 25
XPRS_msp_getintattribprob, 26
XPRS_msp_getintattribprobextreme, 27
XPRS_msp_getintattribprobsol, 28
XPRS_msp_getintattribsol, 29
XPRS_msp_getintcontrol, 30
XPRS_msp_getintcontrolsol, 31
XPRS_msp_getlasterror, 32
XPRS_msp_getsol, 33
XPRS_msp_getsollist, 34
XPRS_msp_getsollist2, 36
XPRS_msp_getsolname, 38
XPRS_msp_loadsol, 39
XPRS_msp_probattach, 40
XPRS_msp_probdetach, 41
XPRS_msp_readslxsol, 42
XPRS_msp_removecbmsghandler, 43
XPRS_msp_setcbmsghandler, 44
XPRS_msp_setdblcontrol, 45
XPRS_msp_setdblcontrolsol, 46
XPRS_msp_setintcontrol, 47
XPRS_msp_setintcontrolsol, 48
XPRS_msp_setsolname, 49
XPRS_msp_writeslxsol, 50

112