1) Linear Programming
1) Linear Programming
LUISS
1/18
(LUISS) Linear Programming 1 / 18
Contents of the week
2/18
(LUISS) Linear Programming 2 / 18
Linear Programming
Definition
A linear program consists in maximizing or minimizing a linear function under a
set of linear equality and inequality constraints
3/18
(LUISS) Linear Programming 3 / 18
Linear Programming
4/18
(LUISS) Linear Programming 4 / 18
Linear Programming
4/18
(LUISS) Linear Programming 4 / 18
Linear Programming
max 50 xA + 40 xB
s.t. xA + 2 xB ≤ 120
xA + xB ≤ 70
2 xA + xB ≤ 100
xA ≥ 0
xB ≥ 0
5/18
(LUISS) Linear Programming 5 / 18
Linear Programming
max 50 xA + 40 xB
s.t. xA + 2 xB ≤ 120
xA + xB ≤ 70
2 xA + xB ≤ 100
xA ≥ 0
xB ≥ 0
5/18
(LUISS) Linear Programming 5 / 18
Linear Programming
Given a set of foods with their nutrient information and cost per serving,
determine the number of meal servings that satisfy a set of nutritional
requirements at minimum cost.
Food Calories [cal] Vitamin A [mcg] Cost [e]
Carrots 40 450 0.12
Milk 63 150 0.15
Chicken 220 5 2.00
6/18
(LUISS) Linear Programming 6 / 18
Linear Programming
Given a set of foods with their nutrient information and cost per serving,
determine the number of meal servings that satisfy a set of nutritional
requirements at minimum cost.
Food Calories [cal] Vitamin A [mcg] Cost [e]
Carrots 40 450 0.12
Milk 63 150 0.15
Chicken 220 5 2.00
Suppose that the maximum number of servings is 10 for each food, and there are
restrictions on the daily calories (between 1600 and 2500 [cal]) and the amount of
Vitamin A (between 800 and 1100 [mcg]).
6/18
(LUISS) Linear Programming 6 / 18
Linear Programming
min 0.12 x1 + 0.15 x2 + 2.0 x3
s.t. 1600 ≤ 40 x1 + 63 x2 + 220 x3 ≤ 2500
800 ≤ 450 x1 + 150 x2 + 5 x3 ≤ 1100
0 ≤ x1 , x2 , x3 ≤ 10
7/18
(LUISS) Linear Programming 7 / 18
Linear Programming
min 0.12 x1 + 0.15 x2 + 2.0 x3
s.t. 1600 ≤ 40 x1 + 63 x2 + 220 x3 ≤ 2500
800 ≤ 450 x1 + 150 x2 + 5 x3 ≤ 1100
0 ≤ x1 , x2 , x3 ≤ 10
Optimal solution: x1∗ = 0.0 (carrot) / x2∗ = 7.16 (milk) / x3∗ = 5.22 (chicken)
Minimum cost is e 11.519
Total number of Calories is 1600
Total amount of Vitamin A is 1100
7/18
(LUISS) Linear Programming 7 / 18
Linear Programming
8/18
(LUISS) Linear Programming 8 / 18
Linear Programming
8/18
(LUISS) Linear Programming 8 / 18
Linear Programming
max c t x
Ax ≤ b
9/18
(LUISS) Linear Programming 9 / 18
Linear Programming
10/18
(LUISS) Linear Programming 10 / 18
Linear Programming
There are several forms of linear programs, each of which can be transformed into
another equivalent form by using the following simple tricks:
11/18
(LUISS) Linear Programming 11 / 18
Linear Programming
There are several forms of linear programs, each of which can be transformed into
another equivalent form by using the following simple tricks:
11/18
(LUISS) Linear Programming 11 / 18
Linear Programming
There are several forms of linear programs, each of which can be transformed into
another equivalent form by using the following simple tricks:
11/18
(LUISS) Linear Programming 11 / 18
Linear Programming
There are several forms of linear programs, each of which can be transformed into
another equivalent form by using the following simple tricks:
11/18
(LUISS) Linear Programming 11 / 18
Linear Programming
There are several forms of linear programs, each of which can be transformed into
another equivalent form by using the following simple tricks:
11/18
(LUISS) Linear Programming 11 / 18
Linear Programming
There are several forms of linear programs, each of which can be transformed into
another equivalent form by using the following simple tricks:
11/18
(LUISS) Linear Programming 11 / 18
Linear Programming
With these simple transformations every linear program can be stated in any of
the following forms, for appropriately defined A, b, and c.
max c t x
Compact Form
Ax ≤ b
max c t x
Canonical Form Ax ≤ b
x ≥0
max c t x
Standard Form Ax = b
x ≥0
12/18
(LUISS) Linear Programming 12 / 18
Linear Programming
The set of vectors satisfying the equalities and inequalities of a linear program is
called its feasible set.
These are a special class of convex sets called polyhedra. When they are bounded
they are called polytopes.
Example:
2x1 + x2 ≥ 1
13/18
(LUISS) Linear Programming 13 / 18
Linear Programming
The set of vectors satisfying the equalities and inequalities of a linear program is
called its feasible set.
These are a special class of convex sets called polyhedra. When they are bounded
they are called polytopes.
Example: x2
2x1 + x2 ≥ 1
x1
13/18
(LUISS) Linear Programming 13 / 18
Linear Programming
The set of vectors satisfying the equalities and inequalities of a linear program is
called its feasible set.
These are a special class of convex sets called polyhedra. When they are bounded
they are called polytopes.
Example: x2
2x1 + x2 ≥ 1
x1 + 3x2 ≥ 2
x1
13/18
(LUISS) Linear Programming 13 / 18
Linear Programming
The set of vectors satisfying the equalities and inequalities of a linear program is
called its feasible set.
These are a special class of convex sets called polyhedra. When they are bounded
they are called polytopes.
Example: x2
2x1 + x2 ≥ 1
x1 + 3x2 ≥ 2
− 3x1 + x2 ≥ −3
x1
13/18
(LUISS) Linear Programming 13 / 18
Linear Programming
The set of vectors satisfying the equalities and inequalities of a linear program is
called its feasible set.
These are a special class of convex sets called polyhedra. When they are bounded
they are called polytopes.
Example: x2
2x1 + x2 ≥ 1
x1 + 3x2 ≥ 2
− 3x1 + x2 ≥ −3
3x1 − 2x2 ≥ −3
x1
13/18
(LUISS) Linear Programming 13 / 18
Linear Programming
The set of vectors satisfying the equalities and inequalities of a linear program is
called its feasible set.
These are a special class of convex sets called polyhedra. When they are bounded
they are called polytopes.
Example: x2
2x1 + x2 ≥ 1
x1 + 3x2 ≥ 2
− 3x1 + x2 ≥ −3
3x1 − 2x2 ≥ −3
− 2x1 − 3x2 ≥ −6
x1
Observe the corners !
13/18
(LUISS) Linear Programming 13 / 18
Linear Programming
x2
Example:
min x1
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1 + 2x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1 + 2x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1 + 2x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1 + 2x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1 + 2x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1 + 2x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
x2
Example:
min x1 + 2x2
x ∈P P
x1
14/18
(LUISS) Linear Programming 14 / 18
Linear Programming
min c t x
Ax ≤ b
Theorem
A polytope P = {x ∈ Rn : Ax ≤ b} has finitely many BS.
min{c t x : x ∈ P} is attained at least at one BFS.
15/18
(LUISS) Linear Programming 15 / 18
Linear Programming
min c t x
Ax ≤ b
Theorem
A polytope P = {x ∈ Rn : Ax ≤ b} has finitely many BS.
min{c t x : x ∈ P} is attained at least at one BFS.
15/18
(LUISS) Linear Programming 15 / 18
Linear Programming
16/18
(LUISS) Linear Programming 16 / 18
Linear Programming
16/18
(LUISS) Linear Programming 16 / 18
Linear Programming
While the Simplex can be very slow in the worst case, it is extremely efficient in
most practical cases.
The Simplex method allows for unbounded polyhedra and is able to detect when
the problem is infeasible, when it has no optimal solutions, and when it does. In
the latter case it finds one optimal BFS.
In principle the method could cycle in degenerate cases (different basis defining
the same BFS) but there exist anti-cycling strategies.
17/18
(LUISS) Linear Programming 17 / 18
Linear Programming
While the Simplex can be very slow in the worst case, it is extremely efficient in
most practical cases.
The Simplex method allows for unbounded polyhedra and is able to detect when
the problem is infeasible, when it has no optimal solutions, and when it does. In
the latter case it finds one optimal BFS.
In principle the method could cycle in degenerate cases (different basis defining
the same BFS) but there exist anti-cycling strategies.
17/18
(LUISS) Linear Programming 17 / 18
Linear Programming
While the Simplex can be very slow in the worst case, it is extremely efficient in
most practical cases.
The Simplex method allows for unbounded polyhedra and is able to detect when
the problem is infeasible, when it has no optimal solutions, and when it does. In
the latter case it finds one optimal BFS.
In principle the method could cycle in degenerate cases (different basis defining
the same BFS) but there exist anti-cycling strategies.
17/18
(LUISS) Linear Programming 17 / 18
Linear Programming
18/18
(LUISS) Linear Programming 18 / 18