Purpose
This function begins a search for the optimal solution of the problem. The direction of optimization is given by
OBJSENSE.
Topic area
Solution Process
Synopsis
solvestatus, solstatus = problem.optimize(flags="")
Argument
|
flags
|
Flags to pass to
problem.optimize. The default is
"" or
None. If the argument includes:
|
s
|
solve the problem to local optimality;
|
|
x
|
solve the problem to global optimality;
|
|
l
|
if a branch and bound search is necessary to solve the problem, stop after solving the root node.
|
|
Return value
|
solvestatus
|
The solve status after termination. Takes the same values as
SOLVESTATUS
|
|
solstatus
|
The solution status after termination. Takes the same values as
SOLSTATUS
|
Further information
2.
problem.optimize automatically selects the optimization method based on the problem type. If the problem contains nonlinear formulas or a non-convex quadratic constraint or objective function, it is equivalent to calling
problem.nlpOptimize, except that the
g flag will be applied by default. Otherwise, for a problem identified as a MIP, it is equivalent to calling
problem.mipOptimize and for all other problems it is equivalent to calling
problem.lpOptimize. To determine which method was selected check the
OPTIMIZETYPEUSED attribute. If the value is
xpress.OptimizeType.LOCAL, then you can check the
LOCALSOLVERSELECTED attribute to determine which local solver was selected.
3. Passing the
s flag is equivalent to setting the
NLPSOLVER control to
xpress.constants.NLPSOLVER_LOCAL. Passing the
x flag is equivalent to setting the
NLPSOLVER control to
xpress.constants.NLPSOLVER_GLOBAL. If neither flag is passed, and if the
NLPSOLVER control is
xpress.constants.NLPSOLVER_AUTOMATIC, then this decision will be made based on problem attributes, including convexity and the presence of user functions, and which features are authorized by the license file.
5. If there is a solve in progress,
problem.optimize will always try to continue that solve (similar to
problem.mipOptimize but unlike
problem.nlpOptimize, which would only do so if the
-c flag was given).
6. The method used to solve the problem is stored in the
OPTIMIZETYPEUSED attribute.
7. Regarding the
l flag, a branch and bound search is required when a problem is identified as a MIP, or when the global solver is selected. This includes a problem with non-linear formulas that can be reformulated as a MIP (for example, if the formulas contain only piecewise linear functions, min/max functions or convex quadratic constraints). In these cases, passing the
l flag will cause the Optimizer to stop after solving the initial LP relaxation.
Related topics
© 2001-2025 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.