0% found this document useful (0 votes)
7 views50 pages

EL6233 Lecture4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views50 pages

EL6233 Lecture4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

A Financial Engineering Problem

Goal:
How to use LP to model multi‐period cash
management in financial firms?

@2020 New York University Tandon


2/24/2020 123
School of Engineering
Problem Setting:
A firm, named Firm X, must determine investment
strategy for the firm during the next 3 years. At
present (time 0), $100K is available for investment.
Five investments named A, B, C, D and E are
available, with the cash flow per $1 investment as
follows:
year 0 1 2 3
A ‐$1 +$0.50 +$1 $0
B $0 ‐$1 +$0.50 +$1
C ‐$1 +$1.2 $0 $0
D ‐$1 $0 $0 +$1.9
E $0 $0 ‐$1 +$1.5

@2020 New York University Tandon


2/24/2020 124
School of Engineering
Hypotheses:
1. The maximum investment for each
category is $75K.
2. The firm is NOT allowed to borrow money
to invest.
3. The interest rate for uninvested money is
8%.

Objective:
Maximize cash on hand at the end of year 3.

@2020 New York University Tandon


2/24/2020 125
School of Engineering
Solution
Unknown Variables:
x1  $ amount invested in investment A;
x2  $ amount invested in investment B;

x5  $ amount invested in investment E;
St  $ amount invested in guaranteed 8%-return at time t.

Objective function:
P  x2  1.9 x4  1.5x5  1.08S2
@2020 New York University Tandon
2/24/2020 126
School of Engineering
Solution (cont’d)
Constraints:
0  xi  75K , i  1, 2, ,5;
0  St , t  0,1, 2;
x1  x3  x4  S0  100 K ; (year 0)
0.5 x1  1.2 x3  1.08S0  x2  S1 ; (year 1)
x1  0.5 x2  1.08S1  x5  S 2 (year 2).
(cash available) (cash invested)
@2020 New York University Tandon
2/24/2020 127
School of Engineering
Solution (cont’d)
Maximizing solution:
P  218,500; with
*

x  60, 000; x2  30, 000; x4  40, 000;


1
* * *

x  75, 000;
5
*

x  S0  S  S 2  0.
3
* *
1
* *

@2020 New York University Tandon


2/24/2020 128
School of Engineering
Exercise 1

Use the simplex method to find a basic and feasible solution


to the following system of linear inequalities:
2x1  3x2  2x3  3,

  x1  x2  x3  5,
x  0, i 1,2,3
i

@2020 New York University Tandon


2/24/2020 129
School of Engineering
Exercise 2

Use the two-phase method to solve the following LP problem:


min P  4 x1  2 x2  8 x3
2 x1  x2  3 x3  30,

 x1  2 x2  4 x3  40,
 x  0, i  1, 2,3
 i

@2020 New York University Tandon


2/24/2020 130
School of Engineering
Exercise 3
State the following LP problem in standard form and solve it
using the simplex method:
min P  2 x1  x2  5 x3 subject to
 x1  2 x2  x3  8,
3 x  2 x  18,
 1 2

2 x1  x2  2 x3  4
 xi  0

@2020 New York University Tandon


2/24/2020 131
School of Engineering
Duality
Goals:
• Reveal the Relationships between the Primal and
Dual LP Problems.
• Introduce the concept of “Shadow Price” and its
importance via solving the dual LP problem.
• Introduce the Dual Simplex Method (if time
permits)

@2020 New York University Tandon


2/24/2020 132
School of Engineering
Primal and Dual LP Problems
Primal LP Problem ("canonical form"):
min P  cT x
subject to Ax  b
x  0.

D ual LP P rob l e m : Goals:


m ax Pd  b T y • Make explicit the effects of changes in the
constraints on the cost
subject to A T y  c
• Develop the “interior-point” software via
y  0. combination of primal and dual info
@2020 New York University Tandon
2/24/2020 133
School of Engineering
Dual of a LP in Standard Form
First, notice that a linear program in standard form
can be rewritten as:

min P  c x T

subject to Ax  b
 Ax  b
x  0.
@2020 New York University Tandon
2/24/2020 134
School of Engineering
Dual of a LP in Standard Form (cont’d)
Then, its “canonical” dual LP is:

max Pd  u T b  vT b
subject to AT u  AT v  c
u0 Or,
v  0.
max Pd  bT 
subject to A   c T

u v  free variable!


@2020 New York University Tandon
2/24/2020 135
School of Engineering
An LP with Mixed Constraints
What is the “canonical” dual of the following LP:

min P  c x T

subject to A1 x  b1
A2 x  b2
A3 x  b3
x  0.
@2020 New York University Tandon
2/24/2020 136
School of Engineering
An LP with Mixed Constraints (cont’d)

The dual LP problem is:

max Pd  b1T y1  b2T y2  b3T y3


subject to A1T y1  A2T y2  A3T y3  c
y1  0, y2  0, y3 unrestricted.

@2020 New York University Tandon


2/24/2020 137
School of Engineering
Theorem 1 of Weak Duality
(on the standard form)
Consider the primal and dual problems:

Primal LP Problem Dual LP Problem


min P  c x T
max Pd  b T

subject to Ax  b subject to AT   c
x0  free variable
Then
P  c x  Pd  b 
T T
for any feasible x, .
@2020 New York University Tandon
2/24/2020 138
School of Engineering
Relation of primal and dual values:

Dual values Primal values P

@2020 New York University Tandon


2/24/2020 139
School of Engineering
Comments
1. If the dual is unbounded, then the primal is
infeasible.

2. If there is a pair of feasible solutions  x ,  


such that cT x  bT , then x and  are
optimal for their respective problems.

@2020 New York University Tandon


2/24/2020 140
School of Engineering
An Example
Consider the primal problem

min P  x1
subject to x1  1
 x1  1
x1  0.
What is its dual problem? Unbounded?
@2020 New York University Tandon
2/24/2020 141
School of Engineering
An Example (cont’d)
The dual problem is

max Pd  1   2
subject to 1   2  1
1 ,  2  0.

@2020 New York University Tandon


2/24/2020 142
School of Engineering
Theorem 2 of Strong Duality

Primal LP Problem Dual LP Problem


min P  cT x max Pd  bT 
subject to Ax  b subject to A   c
T

x0  free variable


If one problem has an optimal solution, then
the other problem also has an optimal solution. Plus

P  cT x  Pd  bT  for optimal x, .
@2020 New York University Tandon
2/24/2020 143
School of Engineering
Sketch of Proof
Let x* be an optimal basic feasible solution for the primal
x*  col  xB xN  .
Noting that A   B N  and c  col  cB cN  , then
xB  B 1b and the reduced costs cTN  cBT B 1 N  0.

It is direct to check that *  ( B 1 )T cB is feasible and optimal


for the dual and has the same optimal primal value,
as shown below.

@2020 New York University Tandon


2/24/2020 144
School of Engineering
Sketch of Proof (cont’d)
*  ( B 1 )T cB is feasible because

 
T
1 T 1 1
A *  A ( B ) cB  ( B A) cB  I B N
T T T
cB


 col cB (B 1 N )T cB   col(cB cN ) : c.

*  ( B 1 )T cB is optimal because
Pd  bT *  bT ( B 1 )T cB  ( B 1b)T cB  cT x*  P* .
 
xTB

@2020 New York University Tandon


2/24/2020 145
School of Engineering
An Equivalence Result
From the proof, we obtain:

Primal optimality condition cTN  cBT B 1 N  0


 The dual feasibility condition

 
T
1
A *  c, with *  B
T
cB

@2020 New York University Tandon


2/24/2020 146
School of Engineering
Complementary Slackness

Let x* be the optimal primal (in standard form) and


 * the optimal dual. Then, it holds:
x*T  c  AT  *   0.

@2020 New York University Tandon


2/24/2020 147
School of Engineering
An Example
Verify the strong duality theorem on the LP:

min P   x1  2 x2
subject to  2 x1  x2  2
 x1  2 x2  7
x1 3
x1 , x2  0.
@2020 New York University Tandon
2/24/2020 148
School of Engineering
A Practical Example
A baker produces two types of cakes:
x1  elaborate  and x2  simple  .

max P  24 x1  14x2
subject to 3x1  2 x2  1200 (basic ingredients)
4x1  x2  1000 (fancier ingredients)
2 x1  x2  700 (labor)
x1  0, x2  0.
@2020 New York University Tandon
2/24/2020 149
School of Engineering
A Practical Example (cont’d)
Its dual LP problem is:

min Pd  12001  1000 2  700 3


subject to 31  4 2  2 3  24 (elaborate cake)
21   2   3  14 (simple cake)
1  0,  2  0,  3  0.

@2020 New York University Tandon


2/24/2020 150
School of Engineering
Answers
P  8880, x1  160, x2  360
Pd  8880, 1  6.4,  2  1.2,  3  0.

1) For this problem, there are 20 hours of excess labor available,


as at the optimal solution 700  2 x1*  x2*  20. So,
additional labor has no value to the baker   3  0  .

@2020 New York University Tandon


2/24/2020 151
School of Engineering
Answers
P  8880, x1  160, x2  360
Pd  8880, 1  6.4,  2  1.2,  3  0.

2) In case the baker wants to purchase additional


quantities of the ingredients, each pound of basic
ingredients will be worth 1  6.4$ in profit,
while each pound of fancy ingredients will be
worth  2  1.2$. For these reasons, the dual variables
are called shadow prices.
@2020 New York University Tandon
2/24/2020 152
School of Engineering
Answers
P  8880, x1  160, x2  360
Pd  8880, 1  6.4,  2  1.2,  3  0.

3) The dual problem can also be understood as the "price"


a company should pay to take over the baker's business.

@2020 New York University Tandon


2/24/2020 153
School of Engineering
Sensitivity
Goal: Understand the effects of parameter
variations on the optimal solution.

@2020 New York University Tandon


2/24/2020 154
School of Engineering
Key Observations
• The current basis is feasible if
1
B b  0.

xB

• It is optimal if
1
c  c B N  0.
T
N
T
B

@2020 New York University Tandon


2/24/2020 155
School of Engineering
An Example
Consider the linear programming problem
min P   x1  2 x2
subject to  2 x1  x2  2,
 x1  2 x2  7,
x1  3,
x1 , x2  0.

@2020 New York University Tandon


2/24/2020 156
School of Engineering
From Lecture 3, the last step in applying the
Simplex Method yields (Optimal solution):

Basic rhs
x1 x2 x3 x4 x5
-P 0 0 0 1 2 13

x2 0 1 0 1/2 1/2 5
x1 1 0 0 0 1 3
x3 0 0 1 -1/2 3/2 3

@2020 New York University Tandon


2/24/2020 157
School of Engineering
Current Basis: xB   x2 , x1 , x3  , with
T

1 2 1  0 0.5 0.5 
  1  
B  2 1 0  , B   0 0 1 ,
0 1 0  1 0.5 1.5 
 
0 0  0.5 0.5 

N  1  , B 1 N   ,
0  0 1 
0 1   0.5 1.5 
 
cB   2  1 0  , cN   0 0  .
T T

@2020 New York University Tandon


2/24/2020 158
School of Engineering
Optimal primal variables:
xB   x2 , x1 , x3   B b   5 3 3 , 1
T T

Reduced costs:
c  c B N  1 2   (0 0)
1
T T T T
N B

Optimal dual variables:


*   B 
1 T
cB   0  1  2  .
T

@2020 New York University Tandon


2/24/2020 159
School of Engineering
An Example of Sensitivity Analysis
Consider the perturbed linear programming problem
min P   x1  2 x2
subject to  2 x1  x2  2,
 x1  2 x2  7  ,
x1  3,
x1 , x2  0.
Show that the optimal basis remains unchanged as long as
   10, 6 .

@2020 New York University Tandon


2/24/2020 160
School of Engineering
A Short Proof
 Observe that the optimality condition remains unchanged
for this special type of perturbations.

 The feasibility condition requires that


B (b  b)  0, with b   0  0 
1 T

Or equivalently,
 5   0.5 
   
B 1b   B 1b   3    0 
 3   0.5 
   
implying the claimed range for  .
@2020 New York University Tandon
2/24/2020 161
School of Engineering
An Example of Sensitivity Analysis
Validate the above claim by solving the perturbed LP problem
min P   x1  2 x2
subject to  2 x1  x2  2,
 x1  2 x2  7  ,
x1  3,
x1 , x2  0.
for different perturbations :   4, 8, 1, 4.

@2020 New York University Tandon


2/24/2020 162
School of Engineering
The Primal‐Dual Interior‐Point Method
for LP
Motivation: fast polynomial‐time method for
large LP problems

Interior‐Point Method by N. Karmarkar (1984):

Search for optimal solution through interior points,


instead of extreme points.

@2020 New York University Tandon


2/24/2020 163
School of Engineering
Primal‐Dual Problems
The Primal Problem (P):
min z  c x T

subject to Ax  b, x  0. (A: full row-rank)

The Dual Problem (D):


max w  bT y
subject to AT y  s  c, s  0  slack variables  .

@2020 New York University Tandon


2/24/2020 164
School of Engineering
Complementary Slackness Conditions

For optimal solution x to (P) and optimal solution y to (D),


the "complementary slackness" condition must hold:
xT  c  AT y   0. Duality Gap :
c T x  bT y
Or , equivalently,
x j s j  0, j  1, , n.

@2020 New York University Tandon


2/24/2020 165
School of Engineering
Key Idea of the PD Interior Method

For positive   0, approximate the optimal solution


with x    , y    , s    satisfying:
 Ax  b, x  0
 T
 PD   A y  s  c, s  0
 x s   , j  1, , n.
 j j

Remark 1:   0 gives interior points x  0, s  0.


Remark 2 :   0 gives the optimal solution!
@2020 New York University Tandon
2/24/2020 166
School of Engineering
Duality Gap

c x  b y  x s  n .
T T T

The above duality gap measures the closeness


to the optimal solutions.

@2020 New York University Tandon


2/24/2020 167
School of Engineering
Algorithm
Given estimates x  0, y and s  0, with
Ax  b and A y  s  c, but x j s j   ,
T

find new estimates x  x, y  y, s  s


such that
A  x  x   b  Ax  0 (*)
Similarly, A y  s  0. * *
T

@2020 New York University Tandon


2/24/2020 168
School of Engineering
Algorithm (cont’d)
In addition, the nonlinear complementary
slackness
x j  x j  s j  s j   
is approximated by linear equations:
s j x j  x j s j    x j s j ***
Thus, these three equations determine the
directions x, y, s.
@2020 New York University Tandon
2/24/2020 169
School of Engineering
Update Parameter Law

k 1  k , 0    1.

@2020 New York University Tandon


2/24/2020 170
School of Engineering
Comment
In practice, we often adopt:
 x  ,    x  x,

 y  ,    y  y,

 s  ,    s  s,
where  is a step length, chosen to ensure that
x, s are positive (i.e. interior points).

More to come at the end of NL programming:


Interior-point methods for convex programming
@2020 New York University Tandon
2/24/2020 171
School of Engineering
Exercise
Can you solve the following problem using both the
Simplex and the Interior‐Point methods?

min P  2 x1  3 x2  2 x3  x4  x5
3 x1  3 x2  4 x3  2 x4  x5  0,

subject to  x1  x2  x3  3 x4  x5  2,
 x  0, i  1, ,5.
 i
@2020 New York University Tandon
2/24/2020 172
School of Engineering

You might also like