Lecture 05
Lecture 05
Motivating example
Extreme points
Properties of LP problem
Simplex method for solving LP problem
Transformation into a linear programming problem
1 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Motivating example
Manufacturing Problem
m: number of types of resources.
bi : value of i th resource, i = 1, . . . , m
n: number of products
aij : units of i th resource to produce 1 unit of j th product
(i = 1, . . . , m, j = 1, . . . , n)
pj : price of 1 unit of j th product (j = 1, . . . , n)
Question: Construct the problem to find the number of each
product to maximize revenue.
2 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Motivating example
Problem
Let xj be units of j th product (j = 1, . . . n).
n
X
maximize pj xj
j =1
n
X
aij xj ≤ bi (i = 1, . . . , m),
j =1
x ≥ 0
(j = 1, . . . , n).
j
3 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
n
X
f (xx ) = cj xj → min(max)
i =1
n
X
aij xj ≤ bi i ∈ I1
j =1
n
X
aij xj ≥ bi
i ∈ I2
j =1 (1)
X n
aij xj = bi i ∈ I3
j =1
x ∈ Rn , bi ∈ R
(i ∈ I1 ∪ I2 ∪ I3 )
4 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Extreme points
Extreme points
6 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Extreme points
Example
Given a problem: f (xx ) = 2x1 − x2 + 3x3 → max
−x1 + 3x2 + 3x3 ≤4
2x1 − x2 − x3 =2
x1 + 3x2 ≥ −1 (2)
x1 − x2 + x3 ≥0
x1 , x3 ≥0
9 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Example 3
Given a linear programming problem:
Prove that the problem is solvable. Find the optimal value. Does
this problem has an optimal solution which is an extreme point?
10 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Explicit form
n
X
f (xx ) = cj xj → min(max)
j =1
n
X
aij xj = bi i = 1, m
j =1 (3)
x ≥ 0
j = 1, n
j
Matrix form
f (xx ) = c T x → min(max)
Ax = b (bb ∈ Rm )
x
x ≥0 (xx ∈ Rn )
11 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Vector form
f (xx ) = 〈c , x 〉 → min(max)
n
(bb ∈ Rm )
X
Aj xj = b
j =1 (4)
x ≥ 0 (xx ∈ Rn )
Theorem 1
Consider the vector form of a standard problem (4).
Let x 0 = (x10 , x20 , . . . , xn0 ) be a feasible solution.
Denote J = {j : xj0 > 0}, AJ = {Aj : j ∈ J }
The feasible solution x 0 is an extreme point if and only if the
column vectors AJ are linear independent.
12 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Canonical form
Given a linear programming problem and let x 0 be an extreme
point of the problem. Then we can always transform a standard
form of a LPP to its canonical form:
14 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Example 4
Given a problem:
15 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Simplex method
16 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Simplex method
Simplex method
Simplex method
xj = xj0 −
X
xjk xj , ∀j ∈ J0
k ∉J0
Simplex method
∆k =
X
cj xjk − ck , k ∉ J0 .
i ∈J0
20 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Simplex method
Remark
If ∆k > 0, ∀k ∉ J0 then x 0 is the unique optimal solution of the
problem.
If there exists ∆k = 0 then there is a sequence of feasible
solutions at which the objective function obtains its optimal
value.
21 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Simplex method
Theorem 3
If at the extreme point x 0 with basis J0 , the corresponding
cannonical problem has ∆k < 0 then x 0 is not the optimal solution,
and there are two cases:
If there exist index k with ∆k < 0 and xjk ≤ 0 ∀j ∈ J0 then there
exists a sequence of feasible solutions at which the objective
function is unbounded above or the problem is insolvable.
If for all ∆k < 0, there exists xjk > 0 then we can change from
x 0 to the feasible solution x 1 "better" than x 0 .
22 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Simplex algorithm
f (xx ) = 〈c , x 〉 → max
n
Aj xj = b (b ∈ Rm )
X
j =1
x ≥ 0 (x ∈ Rn )
Simplex algorithm
c1 c2 . . . cr . . . cm cm+1 . . . ck . . . cs . . . cn
Coef. Basis x1 x2 . . . xr . . . xm xm+1 . . . xk . . . xs . . . xn Sol
c1 x1 1 0 ... 0 ... 0 x1,m+1 . . . x1,k . . . x1,s . . . x1,n x10
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
cr xr 0 0 ... 1 ... 0 xr ,m+1 . . . xr ,k . . . [xr ,s ] . . . xr ,n xr0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
cm xm 0 0 ... 0 ... 1 0
xm,m+1 . . . xm,k . . . xm,s . . . xm,n xm
f (xx ) 0 0 ... 0 ... 0 ∆m+1 . . . ∆k . . . ∆s . . . ∆n f (xx
24 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Simplex algorithm
Simplex algorithm
Simplex algorithm
Example 5
Solve linear programming problem:
27 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Simplex algorithm
Example 6
Solve linear programming problem:
28 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
f (xx ) = c T x → max
Ax = b (bb ∈ Rm )
x
x ≥0 (xx ∈ Rn )
Recall that A ∈ Rm×n . We define the auxiliary LP:
29 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Phase I:
Find and apply simplex method on auxiliary LP with cost:
m
xa
X
min i
i =1
Example 7.
Given a linear programming problem:
f (xx ) = max a T
¡ ¢
i x + bi
i =1,...,m
f (x)
ai x + bi
32 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
minimize t
subject to a T
i x + bi ≤ t , i = 1, . . . , m
Matrix notation
minimize ceTxe
subject to A
e xe ≤ be
aT −1 −b1
1
" # " #
x 0 . ..
.
xe = , ce = , A ..
e = . , be = ..
t 1
aT
m −1 −bm
33 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Data-fitting example
Fit a linear function f (z) = x1 + x2 z to m data points (zi , fi ):
Approximation problem Ax ≈ b where:
1 z1 f
1
" #
..
..
x1 ..
A = . . , x= , b = .
x2
1 zm fm
To find x , the least squares method solves: minimize∥Ax − b ∥22
obtaining a closed-form solution x ∗ , but x ∗ is sensitive to outliers.
To find a solution that is more robust to outliers, solve the problem
minimizer∥Ax − b ∥1
1-norm approximation
minimizer∥Ax − b ∥1
ℓ∞ -norm approximation
minimize ∥Ax − b ∥∞
37 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Geometric intuition:
The ℓ1 constraint region has sharp corners (diamond shape).
The optimal point tends to lie on an axis ⇒ some xi = 0.
38 / 40
Motivating example Extreme point Properties of LP problem Simplex method Transformation into a LP problem
Intuition of SVM
SVM is a supervised learning algorithm.
Given the training set {(xx i , yi )}ni=1 , where x i ∈ Rd (feature
vectors) and yi ∈ {−1, +1} (labels).
SVM finds a hyperplane that separates two classes with the
maximum margin.
w ⊤x i + b) ≥ 1,
yi (w i = 1, . . . , n
Key Idea
Large margin ⇒ better generalization ⇒ more robust classifier.
Hard-margin SVM:
1
min ∥w ∥2
w ,b 2
w ⊤x i + b) ≥ 1, i = 1, . . . , n.
s.t. yi (w
40 / 40