Initializing help system before first use

Results Processing

Once the optimization algorithms have completed, either a solution will be available, or else the problem will have been identified as infeasible or unbounded. In the latter case, the user might want to know what caused this particular outcome and take steps to correct it. How to identify the causes of infeasibility and unboundedness are discussed in Chapter Infeasibility, Unboundedness and Instability. In the former case, however, the user typically wants to retrieve the solution information into the required format.

The FICO Xpress Optimizer provides a number of functions for accessing solution information. An ASCII solution file can be obtained by XPRSwriteslxsol (WRITESLXSOL). The .slx format is similar format to the .mps format for MIP models and to the .sol format. Files in .slx format can be read back into the optimizer using the XPRSreadslxsol function. An extended solution file with additional information per column may be obtained as an ASCII file using either of XPRSwritesol (WRITESOL) or XPRSwriteprtsol(WRITEPRTSOL).

Library interface users may additionally access the current LP, QP or QCQP solution information via memory using XPRSgetlpsol. By calling XPRSgetlpsol the user can obtain copies of the double precision values of the decision variables, the slack variables, dual values and reduced costs. Library interface users can obtain the last MIP solution information with the XPRSgetmipsol function.

In addition to the arrays of solution information provided by the Optimizer, summary solution information is also available through problem attributes. These are named scalar values that can be accessed by their id number using the library functions XPRSgetintattrib, XPRSgetdblattrib and XPRSgetstrattrib. Examples of attributes include LPOBJVAL and MIPOBJVAL, which return the objective function values for the current LP, QP or QCQP solution and the last MIP solution, respectively. A full list of attributes may be found in Chapter Problem Attributes.

When the optimization routine returns it is recommended that the user check the status of the run to ensure the results are interpreted correctly. For continuous optimization runs (started with XPRSlpoptimize) the status is available using the LPSTATUS integer problem attribute. For MIP optimization runs (started with XPRSmipoptimize) the status is available using the MIPSTATUS integer problem attribute. See the attribute's reference section for the definition of their values.

{
  XPRSprob prob;
  int nCols;
  double *x;
  XPRScreateprob(&prob);
  XPRSsetlogfile(prob, "logfile.log");
  XPRSreadprob(prob, "hpw15", "");
  XPRSgetintattrib(prob, XPRS_COLS, &nCols);
  XPRSsetintcontrol(prob, XPRS_MAXNODE, 20000);
  XPRSmipoptimize(prob, "");
  XPRSgetintattrib(prob, XPRS_MIPSTATUS, &iStatus);
  if(iStatus == XPRS_MIP_SOLUTION || iStatus == XPRS_MIP_OPTIMAL) {
    x = (double *) malloc(sizeof(double) * nCols);
    XPRSgetmipsol(prob, x, NULL);
  }
  XPRSdestroyprob(prob);
}

Note that, unlike for LP, QP or QCQP solutions, dual solution information is not provided with the call to XPRSgetmipsol and is not automatically generated with the MIP solutions. Only the decision and slack variable values for a MIP solution are obtained when calling XPRSgetmipsol. The reason for this is that MIP problems do not satisfy the theoretical conditions by which dual information is derived (i.e., Karush–Kuhn–Tucker conditions). In particular, this is because the MIP constraint functions are, in general, not continuously differentiable (indeed, the domains of integer variables are not continuous).

Despite this, some useful dual information can be generated if a MIP has continuous variables and we solve the resulting LP problem generated by fixing the non–continuous component of the problem to their solution values. Because this process can be expensive it is left to the user to perform this in a post solving phase where the user will simply call the function XPRSfixglobals followed with a call to the optimization routine XPRSlpoptimize.