ASCII Solution Files
Solution information is available from the Optimizer in a number of different file formats depending on the intended use. The XPRSwritesol (WRITESOL) command produces two files, problem_name .hdr and problem_name.asc, whose output has comma separated fields and is primarily intended for input into another program. By contrast, the command XPRSwriteprtsol (WRITEPRTSOL) produces fixed format output intended to be sent directly to a printer, the file problem_name.prt. All three of these files are described below.
Solution Header .hdr Files
This file only contains one line of characters comprising header information which may be used for controlling the reading of the .asc file (which contains data on each row and column in the problem). The single line is divided into fourteen fields, separated by commas, as follows:
Field | Type | Width | Description |
---|---|---|---|
1 | string | 10 | matrix name; |
2 | integer | 4 | number of rows in problem; |
3 | integer | 6 | number of structural columns in problem; |
4 | integer | 4 | sequence number of the objective row; |
5 | string | 3 | problem status (see notes below); |
6 | integer | 4 | direction of optimization (0=none, 1=min, 2=max); |
7 | integer | 6 | number of iterations taken; |
8 | integer | 4 | final number of infeasibilities; |
9 | real | 12 | final object function value; |
10 | real | 12 | final sum of infeasibilities; |
11 | string | 10 | objective row name; |
12 | string | 10 | right hand side row name; |
13 | integer | 1 | flag: integer solution found (1), otherwise 0; |
14 | integer | 4 | matrix version number. |
- Character fields contain character strings enclosed in double quotes.
- Integer fields contain right justified decimal digits.
- Fields of type real contain a decimal character representation of a real number, right justified, with six digits to the right of the decimal point.
- The status of the problem (field 5) is a single character as follows:
C | optimization interrupted (like ctrl-c); |
O | optimal; |
N | infeasible; |
S | stability problems; |
U | unbounded; |
Z | unfinished. |
CSV Format Solution .asc Files
The bulk of the solution information is contained in this file. One line of characters is used for each row and column in the problem, starting with the rows, ordered according to input sequence number. Each line contains ten fields, separated by commas, as follows:
Field | Type | Width | Description |
---|---|---|---|
1 | integer | 6 | input sequence number of variable; |
2 | string | 10 | variable (row or column vector) name; |
3 | string | 3 | variable type (C=column; N, L, G, E for rows); |
4 | string | 4 | variable status (LL, BS, UL, EQ or **); |
5 | real | 12 | value of activity; |
6 | real | 12 | slack activity (rows) or input cost (columns;) |
7 | real | 12 | lower bound (-1000000000 if none); |
8 | real | 12 | upper bound (1000000000 if none); |
9 | real | 12 | dual activity (rows) or reduced cost (columns); |
10 | real | 12 | right hand side value (rows) or blank (columns). |
- The field Type is as for the .hdr file.
- The variable type (field 3) is defined by:
C structural column;
N N type row;
L L type row;
G G type row;
E E type row; - The variable status (field 4) is defined by:
LL non-basic at lower bound;
** basic and infeasible;
BS basic and feasible;
UL non-basic at upper bound;
EQ equality row;
SB variable is super-basic;
?? unknown.
Fixed Format Solution (.prt) Files
This file is the output of the XPRSwriteprtsol (WRITEPRTSOL) command and has the same format as is displayed to the console by PRINTSOL. The format of the display is described below by way of an example, for which the simple example of the FICO Xpress Getting Started manual will be used.
The first section contains summary statistics about the solution process and the optimal solution that has been found. It gives the matrix (problem) name (simple) and the names of the objective function and right hand sides that have been used. Then follows the number of rows and columns, the fact that it was a maximization problem, that it took two iterations (simplex pivots) to solve and that the best solution has a value of 171.428571.
Problem Statistics Matrix simple Objective *OBJ* RHS *RHS* Problem has 3 rows and 2 structural columns Solution Statistics Maximization performed Optimal solution found after 3 iterations Objective function value is 171.428571
Next, the Rows Section presents the solution for the rows, or constraints, of the problem.
Rows Section Number Row At Value Slack Value Dual Value RHS N 1 *OBJ* BS 171.428571 -171.428571 .000000 .000000 L 2 second UL 200.000000 .000000 .571429 200.000000 L 3 first UL 400.000000 .000000 .142857 400.000000
The first column shows the constraint type: L means a 'less than or equal to' constrain; E indicates an 'equality' constraint; G refers to a 'greater than or equal to' constraint; N means a 'nonbinding' constraint -- this is the objective function.
The sequence numbers are in the next column, followed by the name of the constraint. The At column displays the status of the constraint. A UL indicator shows that the row is at its upper limit. In this case a ≤ row is hard up against the right hand side that is constraining it. BS means that the constraint is not active and could be removed from the problem without changing the optimal value. If there were ≥ constraints then we might see LL indicators, meaning that the constraint was at its lower limit. Other possible values include:
** | basic and infeasible; |
EQ | equality row; |
?? | unknown. |
The RHS column is the right hand side of the original constraint and the Slack Value is the amount by which the constraint is away from its right hand side. If we are tight up against a constraint (the status is UL or LL) then the slack will be 0.
The Dual Value is a measure of how tightly a constraint is acting. If a row is hard up against a ≤ constraint then it might be expected that a greater profit would result if the constraint were relaxed a little. The dual value gives a precise numerical measure to this intuitive feeling. In general terms, if the right hand side of a ≤ row is increased by 1 then the profit will increase by the dual value of the row. More specifically, if the right hand side increases by a sufficiently small δ then the profit will increase by δx dual value, since the dual value is a marginal concept. Dual values are sometimes known as shadow prices.
Finally, the Columns Section gives the solution for the columns, or variables.
Columns Section Number Column At Value Input Cost Reduced Cost C 4 a BS 114.285714 1.000000 .000000 C 5 b BS 28.571429 2.000000 .000000
The first column contains a C meaning column (compare with the rows section above). The number is a sequence number. The name of the decision variable is given under the Column heading. Under At is the status of the column: BS means it is away from its lower or upper bound, LL means that it is at its lower bound and UL means that the column is limited by its upper bound. Other possible values include:
** | basic and infeasible; |
EQ | equality row; |
SB | variable is super-basic; |
?? | unknown. |
The Value column gives the optimal value of the variable. For instance, the best value for the variable a is 114.285714 and for variable b it is 28.571429. The Input Cost column tells you the coefficient of the variable in the objective function.
The final column in the solution print gives the Reduced Cost of the variable, which is always zero for variables that are away from their bounds -- in this case, away from zero. For variables which are zero, it may be assumed that the per unit contribution is not high enough to make production viable. The reduced cost shows how much the per unit profitability of a variable would have to increase before it would become worthwhile to produce this product. Alternatively, and this is where the name reduced cost comes from, the cost of production would have to fall by this amount before any production could include this without reducing the best profit.
ASCII Solution (.slx) Files
These files provide an easy to read format for storing solutions. An .slx file has a header NAME containing the name of the matrix the solution belongs to. Each line contains three fields as follows:
Field | Type | Width | Description |
---|---|---|---|
1 | char | 1 | variable type; |
2 | string | variable | name of variable; |
3 | real | variable | value of activity. |
The variable type (field 1) is defined by:
C structural column;
S LP solution only: slack variables;
D LP solution only: dual variables;
R LP solution only: reduced costs.
The file is closed by ENDATA.
It is possible to store multiple solutions in the same .slx file by repeating the NAME field following by the additional solution information.
Example
NAME solution 1 C x1 0 C x2 1 NAME solution 2 C x1 1 C x2 0 ENDATA
© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.