Skip to main content

Module linear_programming

Module linear_programming 

Source
Expand description

Linear programming by the two-phase simplex method.

Solves minimise cᵀx subject to

  • A_ub x <= b_ub (inequalities),
  • A_eq x = b_eq (equalities), and
  • per-variable bounds lower <= x <= upper (default 0 <= x < ∞; use f64::NEG_INFINITY / f64::INFINITY for free sides).

The problem is converted to standard form (shifting or splitting variables as the bounds require, adding slack variables), phase one finds a feasible basis with artificial variables, and phase two optimises. Pivoting uses Bland’s rule, so the method cannot cycle on degenerate problems; it is reliable rather than fast, and is intended for problems of up to a few hundred variables and constraints. To maximise, negate the objective.

See the book entry Linear programming.

Structs§

LinearProgram
A linear program (see the module docs). Build with LinearProgram::new and the with_* methods.
LpSolution
The solution of a linear program. x and objective are meaningful only when status is LpStatus::Optimal.

Enums§

LpStatus
The outcome class of a solve.