Linear Programming: Linear Programming CISC5835, Algorithms For Big Data CIS, Fordham Univ
Linear Programming: Linear Programming CISC5835, Algorithms For Big Data CIS, Fordham Univ
Linear Programming
• In a linear programming problem, there is a set of
variables, and we want to assign real values to
CISC5835, Algorithms for Big Data
them so as to
• satisfy a set of linear equations and/or linear
CIS, Fordham Univ. inequalities involving these variables, and
• maximize or minimize a given linear objective function.
Instructor: X. Zhang
It is a convex polygon.
3 4
Maximize Profit Maximize Profit (cont’d)
• Find point(s) in feasible region • All points that lie on line x1 + 6x2
(shaded part) at which objective = c (for some constant c) achieve
same profit c
function (x1+6x2) is maximized.
feasible region: a • As c increases, “profit line” moves
• feasible regions decided by polygon parallel to itself, up and to the right.
linear constraints
• To maximize c: move line as far
• Note: All points on line x1 + 6x2 up as possible, while still touching
= c (for some constant c) feasible region.
achieve same profit c • Optimum solution: very last
feasible point that profit lines sees
• e.g., points (0, 200), (200, 1000/6)
and must therefore be a vertex of
lie on x1 + 6x2 = 1200, both yield
polygon.
profit $1200 (0,200)
(200,1000/6)
• so are all points in the line
segment
5 6
• As c increases, “profit line” • In this way it does hill-climbing on vertices of the polygon, walking
from neighbor to neighbor so as to steadily increase profit along the
moves parallel to itself, up and way.
to the right.
• Upon reaching a vertex that has no better neighbor, simplex declares
• To maximize c: move line as it to be optimal and halts.
far up as possible, while still
touching feasible region. Why does this local test imply global optimality?
considering think of profit line passing through this vertex. Since all the
• Optimum solution: very last
vertex’s neighbors lie below the line, the rest of the feasible polygon must
feasible point that profit lines also lie below this line.
sees and must therefore be a
vertex of polygon.
7 8
A few comments A few comments
Simplex Method is a kind of hill climbing technique: • Linear programming: a special case of convex
• a mathematical optimization technique which belongs to the family of optimization.
local search. • Convex optimization: minimizing convex functions over
• It is an iterative algorithm that starts with an arbitrary solution to a convex sets.
problem, then attempts to find a better solution by incrementally • Simple ex: What if objective function is: maximize x12+x22 ?
changing a single element of the solution.
• What does the “profit” lines look like?
• If the change produces a better solution, an incremental change is
made to the new solution, repeating until no further improvements can
be found.
9 10
• slack form: (N, B, A, b, c, v) N: set of non-basic variables (those on the right hand sides, and in
object functions)
B: the set of basic variables
A: matrix (ai,j)
(bi): the vector
(ci): the coefficients in object function
15 16
Practice Higher Dimension
• Consider the following linear program: What if there is a third and even more exclusive line of chocolates,
called Pyramide Luxe. One box of these will bring in a profit of $13.
• plot the feasible region and find optimal • Nuit and Luxe require same packaging machinery, except that Luxe
solution uses it three times as much, which imposes another constraint x2 +
• What if objective is to minimize 5x+3y? 3x3 ≤ 600
17 18
19 20
Flow in Networks Max. Flow in Networks
• A shipping scheme/plan assign fe to each edge, • Input: G=(V,E), edge capacity ce
and has following properties • Output: fe of each edge (# of var = |E|)
• 0<=fe<=ce (capacity) • Linear Programming problem
• for all nodes u except s and t, amount of flow • constraints are all linear!
entering u equals amount leave u (conserved)
• maximize: f(d,t)+f(e,t)
A Network A flow in the network: value is 7 21 A Network A flow in the network: value is 7 22