Initializing help system before first use

Solving a problem

Simply call solve() to solve an optimization problem that was either built or read from a file. The type of solver is determined based on the type of problem: if at least one integer variable was declared, then the problem will be solved as a mixed integer (linear, quadratically constrained, or nonlinear) problem, while if all variables are continuous the problem is solved as a continuous optimization problem. If the problem is nonlinear in that it contains non-quadratic, non-conic nonlinear constraints, then the appropriate nonlinear solver of the Xpress Optimization suite will be called. Note that in case of a nonconvex quadratic problem, the Xpress Nonlinear solver will be applied as the Xpress Optimizer solver cannot handle such problems.

m.solve ()

The status of a problem after solution can be inquired via the functions getProbStatus() and getProbStatusString() as follows:

import xpress as xp

m = xp.problem()
m.read("example3.lp")
m.solve()

print("problem status:            ", m.getProbStatus())
print("problem status, explained: ", m.getProbStatusString())

The meaning of the returned value is explained in the Optimizer's reference manual. Note that the value and string returned by the above functions reflect the type of problem as input by the user, not the way the problem was last solved. If the user creates a MILP and then solves it as an LP with the flag "l", then both getProbStatus() and getProbStatusString() yield the status of the MILP rather than the LP relaxation. At all effects, the call p.getProbStatus() returns p.attributes.lpstatus if p has continuous variables and p.attributes.mipstatus if p has integer variables.

The output of the solver when reading and solving a problem is the same as with other interfaces of the Xpress Optimizer. The verbosity level is determined by the control outputlog, which is 1 by default. To turn off the solver's output, it should be set to zero (see Chapter Controls and Attributes for how to set a control).

© 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.