Professional Documents
Culture Documents
Linear Programming
• Extreme solutions
• Simplex method
Problem constraints
Non-negative variables
Let S1 be the selling price of wheat, and S2 the price of barley, and
denote the area planted with wheat and barley as x1 and x2 respectively.
The optimal number of square kilometers to plant with wheat vs. barley
can be expressed as a linear programming problem.
A
x1 x2
Example 1 cont.
Maximize S1x1 + S2x2 (the revenue – this is the “objective function”)
subject to x1 +x2 < A (limit on total area)
F 1 x1 + F 2 x2 < F (limit on fertilizer)
P 1 x2 + P 2 x2 < P (limit on insecticide)
x1 >= 0, x2 > 0 (cannot plant a negative area)
maximize
subject to
Example 2: Max flow
Given: a weighted directed graph, source s,
destination t
Minimize amount
of time
(positive lengths)
LP – why is it important?
We have seen examples of:
• allocating limited resources
• network flow
• shortest path
Others include:
• matching
• assignment …
It is a widely applicable problem-solving model because:
• non-negativity is the usual constraint on any variable that represents
an amount of something
• one is often interested in bounds imposed by limited resources.
Dominates world of industry
Linear Programming – 2D example
Cost function:
Inequality constraints:
Example – feasible region from inequalities
1.8
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Feasible Region
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Feasible Region
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Feasible Region
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Feasible Region
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Feasible Region
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Feasible Region
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Feasible Region
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
LP example
Cost function:
extreme point
LP example
1.4
1.2
Inequality constraints: 1
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
feasible region
LP example – change of cost function
1.8
Cost function:
1.6
extreme point
1.4
contour lines
1.2
Inequality constraints:
1
0.8
0.6 c
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
feasible region
Linear Programming – optima at vertices
• The key point is that for any (linear) objective function the optima only
occur at the corners (vertices) of the feasible polygonal region (never on
the interior region).
15
10 extreme point
-5
-5 0 5 10 15 feasible region
Sketch solutions for optimization methods
1. Simplex method
• Tableau exploration of vertices based on linear algebra
1.8
b
• the others (which are vertices 1.2
0.6
c
0.4
0.2
0
e d
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Worst complexity …
1.8
1.6
a
1.4
1.2
b
1 f
0.8
0.6
c
0.4
0.2
0
e d
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
The Simplex Algorithm
c
Barrier function method
Approximation via logarithmic barrier functon
Algorithm for Interior Point Method
Example: interior point algorithm
agents 1 2 3 4 5
tasks 1 2 3 4 5
Objective:
• assign n agents to n tasks to minimize total cost
Assignment constraints:
• each agent assigned to one task only
• each task assigned to one agent only
Example: assignment problem
agents 1 2 3 4 5
tasks 1 2 3 4 5
Objective:
• assign n agents to n tasks to minimize total cost
Assignment constraints:
• each agent assigned to one task only
• each task assigned to one agent only
cost matrix
tasks tasks
a a
g g
e e
n n
t t
s s
Example: assignment problem
tasks j
Example solution for xij
a 0 1 0 0 0
g
each agent i assigned to one task only 0 0 0 1 0
e
• only one entry in each row n 0 0 1 0 0
t
each task j assigned to one agent only s 0 0 0 0 1
• only one entry in each column i
1 0 0 0 0
Example: assignment problem
tasks j
a
0 1 0 0 0
g
Linear Programme formulation e 0 0 0 1 0
n
0 0 1 0 0
t
s 0 0 0 0 1
i 1 0 0 0 0
Agents to tasks assignment problem Optimal agents to tasks assignment cost: 11.735499
1.5 1.5
agents agents
tasks tasks
1 1
0.5 0.5
0 0
-0.5 -0.5
-1 -1
-1.5 -1.5
-2 -2
-1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
Multiple Object Tracking using Flow Linear Programming, Berclaz, Fleuret & Fua, 2009
Example application: tracking pedestrians
Multiple Object Tracking using Flow Linear Programming, Berclaz, Fleuret & Fua, 2009
What is next?
• Stochastic algorithms