Professional Documents
Culture Documents
ci(x) = 0, i = 1, , p
ci(x) 0, i = p+1, , m
General Form LP
min cT x
s.t.
aiT x bi ,
i {1,2,..., p}
aiT x bi ,
i { p 1, p 2,..., m}
Standard Form LP
A standard form LP is in the following format:
T
min c x
s.t.
Ax b
x0
where
mn
,b , c
m
Standard Form LP
In a standard form LP, the coefficient
matrix A is assumed to have full row rank
That is, the rows of A are linearly independent
You cannot find a linear combination of rows of A
that is equal to zero vector
Standard Form LP
Used while implementing Simplex Method to
solve an LP
A general form LP can be converted to a
standard form LP
How?
Objective function? (max -> min)
Multiply by -1
Inequalities?
Add slack or excess (surplus) variables
xi xi xi
xi , xi 0
Example
max 3 x1 5 x2
s.t
x1 4
2 x1 x2 12
3 x1 2 x2 18
x1 0, x2 free
Example
min 3 x1 5 x 5 x
s.t
x1 s1 4
2 x1 x2 x2 12
3 x1 2 x2 2 x2 e1 18
x1 , x , x , s1 , e1 0
Some Definitions
An LP is feasible if the feasible region of the
problem is not empty, or equivalently, if there is a
vector x which satisfies all the constraints
x is called a feasible solution if it satisfies all the
constraints
x is an optimal solution if it is a feasible solution and
minimizes the objective function value among all
feasible solutions
c x
T
Some Definitions
If an LP is feasible but not unbounded, then it
has an optimal solution
In summary, there are three alternatives for an
LP
It can be feasible and has an optimal solution
It can be unbounded
It can be infeasible
Feasible region is empty
Duality
Associated with every (primal) LP, there is
another LP called dual LP
Main idea behind duality:
To find a bound on the optimal solution of the
primal problem
Duality
Consider the following LP
max 4 x1 x2 3 x3
s.t.
x1 4 x2 1
3 x1 x2 x3 3
x1 , x2 , x3 0
Duality
Any feasible solution to this LP provides a
lower bound on the optimal objective
function value
(x1,x2,x3) = (1,0,0)
Optimal objective function value 4
(x1,x2,x3) = (0,0,3)
Optimal objective function value 9
How good is this bound?
Is it close to the optimal value?
Duality
To answer these questions, we have to
find an upper bound
In the given example
Multiply the first constraint by 2 and multiply
the second constraint by 3 and sum those two
inequalities
Duality
x1 4 x2 1
(multiply by 2)
3x1 x2 x3 3
(multiply by 3)
11x1 5 x2 3x3 11
Duality
What is the best upper bound that can be found
using this method?
x1 4 x2 1
3x1 x2 x3 3
(multiply by y1 )
(multiply by y2 )
( y1 3 y2 ) x1 (4 y1 y2 ) x2 ( y2 ) x3 y1 3 y2
To use this inequality for finding an upper bound,
coefficient of xis should be at least as large as
the corresponding coefficient in the objective
function
Duality
And, we want to minimize the right hand side of
the inequality to find the best upper bound
min y1 3 y 2
s.t.
y1 3 y 2 4
4 y1 y 2 1
y2 3
y1 , y 2 0
Dual LP
min c x
s.t.
max b y
s.t.
Ax b
x0
A yc
y free
Primal LP
Dual LP
Duality
We can interpret the optimal dual prices yi
as the marginal cost of changing the right
hand side of the ith equation
Why?
Economic Interpretation
The dual prices, or shadow prices allow us to put
a value on resources
Alternatively, they allow us to consider the
sensitivity of the optimal solution value to
changes in the input
By examining the dual variable for each
constraint, we can determine the value of an
extra unit of the corresponding resource
We can then determine the maximum amount
we would be willing to pay to have a unit of that
resource
Proof?
x 0 and c - ATy 0
Check the inner product of these two vectors
Complementary Slackness
x Rn is an optimal solution for the primal
LP if and only if
x is primal feasible: Ax = b, x 0
and there exists y Rm such that y is dual
feasible: s:= c - ATy 0
and we have xisi = 0 for each i {1,2,,n}
(This is equivalent to the last condition of the
optimality conditions due to strong duality)
Example
Consider the following LP
Solving an LP
Simplex method
Moves on the boundary of the feasible region
from one corner (extreme) point to another
one
{x n Bx d }
for some matrix B, and vector d
Let a be a vector of dimension n and b is a real
number, then {x n aT x b} is called a
halfspace
A polyhedron is an intersection of halfspaces
min c x
s.t.
Ax b
x0
where A is a matrix of dimension mn, b is a
vector of dimension m, and c is a vector of
dimension n
Recall that A has full row rank, i.e., m n
S {x Ax b, x 0}
n
xB
x
xN
Then, we have B xB + N xN = b
Setting xN= 0, we have xB = B-1b
xB B 1b
x
is called basic solution
x N 0
Basic Theorem of LP
Basic Theorem of LP: Consider a
standard form LP. If the feasible
region (S) has at least one extreme
point and there exists an optimal
solution, then there exists an optimal
solution that is an extreme point
A B N
xB
x
xN
z cT x cBT xB cTN xN
Ax Bx B Nx N b xB B 1b B 1 Nx N
z cBT ( B 1b B1 Nx N ) cTN xN
cBT B 1b (cTN cBT B 1 N ) xN
A B N
xB
x
xN
z cT x cBT xB cTN xN
Ax Bx B Nx N b xB B 1b B 1 Nx N
z cBT ( B 1b B1 Nx N ) cTN xN
cBT B 1b (cTN cBT B 1 N ) xN
A B N
xB
x
xN
z cT x cBT xB cTN xN
Ax Bx B Nx N b xB B 1b B 1 Nx N
z cBT ( B 1b B1 Nx N ) cTN xN
cBT B 1b (cTN cBT B 1 N ) xN
A B N
xB
x
xN
z cT x cBT xB cTN xN
Ax Bx B Nx N b xB B 1b B 1 Nx N
z cBT ( B 1b B1 Nx N ) cTN xN
cBT B 1b (cTN cBT B 1 N ) xN
xB B b B Nx N
1
z c B b (c c B N ) x N
T
B
T
N
T
B
xB B b B a x j
1
z c B b (c j c B a ) x j
T
B
T
B
T 1 j
c
c
If j
B B a 0 , then increasing the value of
c
Observation: Choose a variable with j
BB a 0
Also called the entering variable
min 7 x1 2 x2
s.t
x1 2 x2 4
5 x1 x2 20
2 x1 2 x2 7
x1 , x2 0
min 7 x1 2 x2
s.t
x1 2 x2 x3 4
5 x1 x2 x4 20
2 x1 2 x2 x5 7
x1 , x2 , x3 , x4 , x5 0
x x3 15
2
x4 5
x5 2
0
8
4
40
min{
,
}
x3 leaves the basis
11 / 5 1 / 5 11
Graphical Illustration
Optimization Software
Excel Solver
CPLEX
GAMS
Matlab
min 7 x1 2 x2
s.t
x1 2 x2 x3 4
5 x1 x2 x4 20
2 x1 2 x2 x5 7
x1 , x2 , x3 , x4 , x5 0
Solve it using Excel Solver
Another Example
A bond portfolio manager has $100,000 to allocate to two
different bonds; one corporate and one government bond.
The corporate bond has a yield of 4%, a maturity of 3 years
and an A rating from Moody's that is translated into a
numerical rating of 2 for computational purposes. In contrast,
the government bond has a yield of 3%, a maturity of 4 years
and rating of Aaa with the corresponding numerical rating of
1 (lower numerical ratings correspond to higher quality
bonds). The portfolio manager would like to allocate her
funds so that the average rating for the portfolio is no worse
than Aa (numerical equivalent 1.5) and average maturity of
the portfolio is at most 3.6 years. Any amount not invested in
the two bonds will be kept in a cash account that is assumed
to earn no interest for simplicity and does not contribute to
the average rating or maturity computations. How should the
manager allocate her funds between these two bonds to
achieve her objective of maximizing the yield from this
investment?
Linear?