scipy 1.8.0 Pypi GitHub Homepage
Other Docs
AttributesNotes

Attributes

c : 1D array

The coefficients of the linear objective function to be minimized.

A_ub : 2D array, optional

The inequality constraint matrix. Each row of A_ub specifies the coefficients of a linear inequality constraint on x .

b_ub : 1D array, optional

The inequality constraint vector. Each element represents an upper bound on the corresponding value of A_ub @ x .

A_eq : 2D array, optional

The equality constraint matrix. Each row of A_eq specifies the coefficients of a linear equality constraint on x .

b_eq : 1D array, optional

The equality constraint vector. Each element of A_eq @ x must equal the corresponding element of b_eq .

bounds : various valid formats, optional

The bounds of x , as min and max pairs. If bounds are specified for all N variables separately, valid formats are: * a 2D array (N x 2); * a sequence of N sequences, each with 2 values. If all variables have the same bounds, the bounds can be specified as a 1-D or 2-D array or sequence with 2 scalar values. If all variables have a lower bound of 0 and no upper bound, the bounds parameter can be omitted (or given as None). Absent lower and/or upper bounds can be specified as -numpy.inf (no lower bound), numpy.inf (no upper bound) or None (both).

x0 : 1D array, optional

Guess values of the decision variables, which will be refined by the optimization algorithm. This argument is currently used only by the 'revised simplex' method, and can only be used if :None:None:`x0` represents a basic feasible solution.

Notes

This namedtuple supports 2 ways of initialization: >>> lp1 = _LPProblem(c=[-1, 4], A_ub=[[-3, 1], [1, 2]], b_ub=[6, 4]) >>> lp2 = _LPProblem([-1, 4], [[-3, 1], [1, 2]], [6, 4])

Note that only c is a required argument here, whereas all other arguments A_ub , b_ub , A_eq , b_eq , bounds , x0 are optional with default values of None. For example, A_eq and b_eq can be set without A_ub or b_ub : >>> lp3 = _LPProblem(c=[-1, 4], A_eq=[[2, 1]], b_eq=[10])

Represents a linear-programming problem.

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#None
type: <class 'type'>
Commit: