scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturns
_presolve(lp, rr, rr_method, tol=1e-09)

Parameters

lp : A `scipy.optimize._linprog_util._LPProblem` consisting of the following fields:

c

c

A_ub

A_ub

b_ub

b_ub

A_eq

A_eq

b_eq

b_eq

bounds

bounds

x0

x0

rr : bool

If True attempts to eliminate any redundant rows in A_eq . Set False if A_eq is known to be of full row rank, or if you are looking for a potential speedup (at the expense of reliability).

rr_method : string

Method used to identify and remove redundant rows from the equality constraint matrix after presolve.

tol : float

The tolerance which determines when a solution is "close enough" to zero in Phase 1 to be considered a basic feasible solution or close enough to positive to serve as an optimal solution.

Returns

lp : A `scipy.optimize._linprog_util._LPProblem` consisting of the following fields:

c

c

A_ub

A_ub

b_ub

b_ub

A_eq

A_eq

b_eq

b_eq

bounds

bounds

x0

x0

c0 : 1D array

Constant term in objective function due to fixed (and eliminated) variables.

x : 1D array

Solution vector (when the solution is trivial and can be determined in presolve)

revstack: list of functions

the functions in the list reverse the operations of _presolve() the function signature is x_org = f(x_mod), where x_mod is the result of a presolve step and x_org the value at the start of the step (currently, the revstack contains only one function)

complete: bool

Whether the solution is complete (solved or determined to be infeasible or unbounded in presolve)

status : int

An integer representing the exit status of the optimization:

0 : Optimization terminated successfully
1 : Iteration limit reached
2 : Problem appears to be infeasible
3 : Problem appears to be unbounded
4 : Serious numerical difficulties encountered
message : str

A string descriptor of the exit status of the optimization.

Given inputs for a linear programming problem in preferred format, presolve the problem: identify trivial infeasibilities, redundancies, and unboundedness, tighten bounds where possible, and eliminate fixed variables.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/optimize/_linprog_util.py#454
type: <class 'function'>
Commit: