LinearProgramming
✖
LinearProgramming
finds a vector x that minimizes the quantity c.x subject to the constraints m.x≥b and x≥0.
finds a vector x that minimizes c.x subject to x≥0 and linear constraints specified by the matrix m and the pairs {bi,si}. For each row mi of m, the corresponding constraint is mi.x≥bi if si==1, or mi.x==bi if si==0, or mi.x≤bi if si==-1.
minimizes c.x subject to the constraints specified by m and b and x≥l.
minimizes c.x subject to the constraints specified by m and b and xi≥li.
minimizes c.x subject to the constraints specified by m and b and li≤xi≤ui.
takes the elements of x to be in the domain dom, either Reals or Integers.
takes xi to be in the domain domi.
Details and Options

- All entries in the vectors c and b and the matrix m must be real numbers.
- The bounds li and ui must be real numbers or Infinity or -Infinity.
- None is equivalent to specifying no bounds.
- LinearProgramming gives exact rational number or integer results if its input consists of exact rational numbers.
- LinearProgramming returns unevaluated if no solution can be found.
- LinearProgramming finds approximate numerical results if its input contains approximate numbers. The option Tolerance specifies the tolerance to be used for internal comparisons. The default is Tolerance->Automatic, which does exact comparisons for exact numbers, and uses tolerance
for approximate numbers.
- SparseArray objects can be used in LinearProgramming.
- With Method->"InteriorPoint", LinearProgramming uses interior point methods.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Minimize , subject to constraint
and implicit non-negative constraints:

https://wolfram.com/xid/0i1qy6weq-h12435

LinearProgramming has been superseded by LinearOptimization:

https://wolfram.com/xid/0i1qy6weq-zmihwg

Solve the problem with equality constraint and implicit non-negative constraints:

https://wolfram.com/xid/0i1qy6weq-hlzeu3

Use LinearOptimization to solve the problem:

https://wolfram.com/xid/0i1qy6weq-6tbtgn

Solve the problem with equality constraint and implicit non-negative constraints:

https://wolfram.com/xid/0i1qy6weq-465e7g

Use LinearOptimization to solve the problem:

https://wolfram.com/xid/0i1qy6weq-0opb4

Scope (6)Survey of the scope of standard use cases
Minimize , subject to constraint
and lower bounds
,
:

https://wolfram.com/xid/0i1qy6weq-4u7ro7

Minimize , subject to constraint
and bounds
,
:

https://wolfram.com/xid/0i1qy6weq-lyiasg

Minimize , subject to constraint
and upper bounds
,
:

https://wolfram.com/xid/0i1qy6weq-7ipnd7

Minimize , subject to constraint
and implicit non-negative constraints:

https://wolfram.com/xid/0i1qy6weq-yikwa7

Minimize subject to bounds
and
only:

https://wolfram.com/xid/0i1qy6weq-5wq1px

Solve the same kind of problem, but with both variables integers:

https://wolfram.com/xid/0i1qy6weq-5bf8jy

Solve the same problem, but with the first variable an integer:

https://wolfram.com/xid/0i1qy6weq-yu3u6t

Solve larger LPs, in this case 200,000 variables and 10,000 constraints:

https://wolfram.com/xid/0i1qy6weq-fw34id


https://wolfram.com/xid/0i1qy6weq-bgvwyr

Options (2)Common values & functionality for each option
Method (1)
Tolerance (1)
If an approximated solution is sufficient, a loose Tolerance option makes the solution process faster:

https://wolfram.com/xid/0i1qy6weq-bia08o


https://wolfram.com/xid/0i1qy6weq-5kr4qr

Properties & Relations (2)Properties of the function, and connections to other functions
A linear programming problem can also be solved using Minimize:

https://wolfram.com/xid/0i1qy6weq-1hjz1k


https://wolfram.com/xid/0i1qy6weq-vfps0s

NMinimize or FindMinimum can be used to solve inexact linear programming problems:

https://wolfram.com/xid/0i1qy6weq-d4j1il


https://wolfram.com/xid/0i1qy6weq-1jt1gv

Possible Issues (4)Common pitfalls and unexpected behavior
The integer programming algorithm is limited to the machine-number problems:

https://wolfram.com/xid/0i1qy6weq-1s04v2


The "InteriorPoint" method only works for machine numbers:

https://wolfram.com/xid/0i1qy6weq-kgidfc


The "InteriorPoint" method may return a solution in the middle of the optimal solution set:

https://wolfram.com/xid/0i1qy6weq-7op6n8

The "Simplex" method always returns a solution at a corner of the optimal solution set:

https://wolfram.com/xid/0i1qy6weq-6lgj4b

In this case the optimal solution set is the set of all points on the line segment between and
:

https://wolfram.com/xid/0i1qy6weq-c5p781

The "InteriorPoint" method may not always be able to tell if a problem is infeasible or unbounded:

https://wolfram.com/xid/0i1qy6weq-lxuygb


Neat Examples (1)Surprising or curious use cases
Wolfram Research (1991), LinearProgramming, Wolfram Language function, https://reference.wolfram.com/language/ref/LinearProgramming.html (updated 2007).
Text
Wolfram Research (1991), LinearProgramming, Wolfram Language function, https://reference.wolfram.com/language/ref/LinearProgramming.html (updated 2007).
Wolfram Research (1991), LinearProgramming, Wolfram Language function, https://reference.wolfram.com/language/ref/LinearProgramming.html (updated 2007).
CMS
Wolfram Language. 1991. "LinearProgramming." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/LinearProgramming.html.
Wolfram Language. 1991. "LinearProgramming." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/LinearProgramming.html.
APA
Wolfram Language. (1991). LinearProgramming. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LinearProgramming.html
Wolfram Language. (1991). LinearProgramming. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LinearProgramming.html
BibTeX
@misc{reference.wolfram_2025_linearprogramming, author="Wolfram Research", title="{LinearProgramming}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/LinearProgramming.html}", note=[Accessed: 07-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_linearprogramming, organization={Wolfram Research}, title={LinearProgramming}, year={2007}, url={https://reference.wolfram.com/language/ref/LinearProgramming.html}, note=[Accessed: 07-July-2025
]}