Initializing help system before first use

problem.getlpsol

Purpose
Used to obtain the LP solution values following optimization.
Synopsis
problem.getlpsol(x, slack, duals, djs)
Arguments
Array to store the values of the primal variables. May be None if not required.
slack 
Array to store the values of the slack variables. May be None if not required.
duals 
Array to store the values of the dual variables ( cBTB-1). May be None if not required.
djs 
Array to store the reduced cost for each variable ( cT-cBTB-1A). May be None if not required.
Example
The following sequence of function calls will get the LP solution ( x) at the top node of a MIP and the optimal MIP solution ( y):
p.mipoptimize("l") # only solve the LP relaxation
x = []
p.getlpsol(x)
print("root LP solution:", x)
p.mipoptimize() # solve the MIP problem
x = p.getSolution()
print("final MIP solution", x)
Further information
1. After solving an LP, it is recommended to use problem.getSolution to retrieve the solution.
2. When an integer solution is found during a tree search, it is always set up as a solution to the current node; therefore the integer solution is available as the current node. It is recommended to retrieved the solution with problem.getCallbackSolution and problem.getCallbackPresolveSolution.
3. If the problem is modified after calling lpoptimize, then the solution will no longer be available.
4. If the problem has been presolved, then getlpsol returns the solution to the original problem. The only way to obtain the presolved solution is to call the related function, problem.getpresolvesol.
Related topics

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