Sunteți pe pagina 1din 17

Notes

Slides adopted from Prof. Gesualdo Scutari (SP 2016)

Lesson 6: Linear Programming Models I


IE 335: Operations Research - Optimization

Instructor: Professor Chris Quinn

September 1, 2016

Notes

Linear Programming (LP) Models

LP review:
I Geometric
I Algebraic
Case-Studies:
I An online advertising problem
I Portfolio selection

Notes

Linear programming (LP) problems


Graphical depiction

Top view

Optimal solution: (2,2)

(2)

(4)

x2

(3

(1

(5)
3

Side view

x1

3x1 + 5x2 = 16

3x1 + 5x2 = 14

3x1 + 5x2 = 12

3x1 + 5x2 = 10

3x1 + 5x2 = 8

3x1 + 5x2 = 6

3x1 + 5x2 = 4

3x1 + 5x2 = 2

3x1 + 5x2 = 0

(code on blackboard)

Notes

Linear programming (LP) problems


Algebraic description

An optimization model is a linear program if


I

decision variables are continuous

the objective function is affine

all constraints are linear

More formally
minimize
x
subject to

cT x + b
Ax d 0
Gx q = 0
x Rn

Notes

An online advertising problem

The New Bedford Times (NBT) is a small newspaper with a growing


web site
3 sections: News, Travel, and Sports
5 advertisers: Apple Cruises, Bank Boston, CoolTickets, D-Mobile
Wireless, eCooking

Notes

An online advertising problem

Decision: how do we allocate the ads to the sections of the web site?
I

e.g. How many of D-Mobiles ads do we put on the Sports


section?

Assumption: one ad per page view


Objective: maximize the total expected number of click-throughs on
the NBT web site
(in order to improve its attractiveness to potential advertisers)

Notes

An online advertising problem


Index conventions:
I

News = 1, Travel = 2, Sports = 3

Apple Cruises = 1, Bank Boston = 2, CoolTickets = 3,


D-Mobile Wireless = 4, eCooking = 5

Data available:
I

vi = forecasted number of page views of section i for this month


(i = 1, 2, 3)

aj = number of ads sold to advertiser j for this month


(j = 1, 2, 3, 4, 5)

pi,j = projected click-through probability of advertiser js ad on


section i (i = 1, 2, 3 and j = 1, 2, 3, 4, 5)
7

Notes

An online advertising problem

Implicit constraints:
I

Total number of ads assigned to a section is at most the number


of ads (page views) available on that section

Total number of ads delivered for an advertiser is at least the


number of ads sold to the advertiser

Notes

An online advertising problem

Additional constraints:
I

BankBostons contract requires that at least 20% of its page


views are on the Travel section

CoolTicketss contract requires that at least 25% of its page


views are on the News section

D-Mobiles contract requires that it receives at least 27,000


expected click-throughs based on the forecast click-through
probabilities

Notes

Steps to building an optimization model

Define the decision variables

Write the objective function

Write the constraints


I

Main constraints

Variable-type constraints

10

Notes

Step 1: Define the decision variables

How do we assign each advertisers page views to each section of the


web site?
Decision variables:
xi,j = number of advertiser js ads assigned to section i
for i = 1, 2, 3 and j = 1, 2, 3, 4, 5

11

Notes

Step 2: Write the objective function

Objective is to maximize total expected number of click-throughs


For example, the expected number of click-throughs for Apple Cruises
on the News section = p1,1 x1,1
Objective:
maximize

3 X
5
X

pi,j xi,j

i=1 j=1

12

Notes

Step 3: Write the constraints


Total number of ads assigned to a section is at most the number of
ads (page views) available on that section
For section i, the total number of ads assigned is
xi,1 + xi,2 + xi,3 + xi,4 + xi,5 =

5
X

xi,j

j=1

The number of ads available on section i is vi


Constraints:

5
X

xi,j vi

for i = 1, 2, 3

j=1

13

Notes

Step 3: Write the constraints


Total number of ads delivered for an advertiser is at least the number
of ads sold to the advertiser
For advertiser j, the number of ads delivered is
x1,j + x2,j + x3,j =

3
X

xi,j

i=1

The number of ads advertiser j ordered is aj


Constraints:

3
X

xi,j aj

for j = 1, 2, 3, 4, 5

i=1

14

Notes

Step 3: Write the constraints


BankBostons contract requires that at least 20% of its page views
are on the Travel section
3

x2,2

1X
xi,2
5
i=1

CoolTicketss contract requires that at least 25% of its page views are
on the News section
3
1X
x1,3
xi,3
4
i=1

D-Mobiles contract requires that it receives at least 27,000 expected


click-throughs based on the forecast click-through probabilities
3
X

pi,4 xi,4 27000

i=1
15

Notes

Step 3: Write the constraints

Anything missing?
Nonnegativity:
xi,j 0

for i = 1, 2, 3 and j = 1, 2, 3, 4, 5

Assume large volume - omitting integrality is OK

16

Notes

Putting it all together...


maximize

3 X
5
X

pi,j xi,j

(expected # click-throughs)

i=1 j=1

subject to

5
X

xi,j vi

for i = 1, 2, 3

(section capacities)

xi,j aj

for j = 1, 2, 3, 4, 5

(advertiser demand)

j=1
3
X
i=1
3

x2,2

1X
xi,2
5 i=1

(BankBostons contract)

x1,3
3
X

1X

xi,3
4 i=1

(CoolTicketss contract)

pi,4 xi,4 27000

(D-Mobiles contract)

i=1

xi,j 0

for i = 1, 2, 3 and
j = 1, 2, 3, 4, 5

(nonnegativity)
17

Notes

Real-world usage

Optimization approach tested at Microsoft on data from msn.com, in


conjunction with forecasting of click-through probabilities
20 - 30% increase in click-through rate
Reference: D. Chickering, D. Heckerman. Targeting advertising on
the web with inventory management. Interfaces 33: 71-77, 2003.

18

Notes

Portfolio selection
Bradley, Hax, Magnanti (1977)

A portfolio manager in charge of a bank portfolio has $10 million to


invest
5 different securities available
Bond
name
1
2
3
4
5

Bond
type
Municipal
Agency
Govt
Govt
Municipal

Quality
rating
2
2
1
1
5

Years to
maturity
9
15
4
3
2

Yield to
maturity
4.3%
2.7
2.5
2.2
4.5

Lower quality rating better (1=best)


19

Notes

Portfolio selection
The bank places the following policy limitations on the portfolio
managers actions
1 Government and agency bonds must total at least $4 million
2

The average quality of the portfolio cannot exceed 1.4 (lower


quality rating = better)

The average years to maturity of the portfolio must not exceed 5


years

Bonds cannot be shorted (cannot buy negative amounts of


bonds)

Objective: maximize earnings


Decision: how much of each type of bond to purchase?

20

Notes

Step 1: Define the decision variables

Need to determine dollar amount of each security to be purchased


Decision variables:
xi = amount to be invested in bond i, in millions
for i = 1, 2, 3, 4, 5

21

Notes

Step 2: Write the objective function

We want to maximize total earnings


For one security,
earnings = (yield to maturity) (amount invested)
Objective:
maximize

0.043x1 + 0.027x2 + 0.025x3 + 0.022x4 + 0.045x5

22

Notes

Step 3: Write the constraints

Variable-type constraints?
Cannot short bonds, so amount invested is nonnegative
Constraints:
xi 0

for i = 1, 2, 3, 4, 5

23

Notes

Step 3: Write the constraints

Portfolio manager only has a total of 10 million dollars to invest


5
X

xi 10

i=1

At least $4 million must be invested in government and agency bonds


x2 + x3 + x4 4

24

Notes

Step 3: Write the constraints


The average quality of the portfolio must not exceed 1.4
average quality of portfolio =

So,

total quality of portfolio


total value of portfolio

2x1 + 2x2 + x3 + x4 + 5x5


1.4
x1 + x2 + x3 + x4 + x5

Nonlinear!
But can be linearized: xi s are nonnegative, so denominator is
nonnegative
2x1 + 2x2 + x3 + x4 + 5x5 1.4(x1 + x2 + x3 + x4 + x5 )
0.6x1 + 0.6x2 0.4x3 0.4x4 + 3.6x5 0

25

Notes

Step 3: Write the constraints


The average maturity of the portfolio must not exceed 5
average maturity of portfolio =
So,

total maturity of portfolio


total value of portfolio

9x1 + 15x2 + 4x3 + 3x4 + 2x5


5
x1 + x2 + x3 + x4 + x5

Since xi s are nonnegative, can be linearized


9x1 + 15x2 + 4x3 + 3x4 + 2x5 5(x1 + x2 + x3 + x4 + x5 )
4x1 + 10x2 x3 2x4 3x5 0

26

Notes

Putting it all together...

maximize

subject to

0.043x1 + 0.027x2 + 0.025x3


+ 0.022x4 + 0.045x5
5
X

xi 10

(total earnings)

(cash available)

i=1

x2 + x3 + x4 4

(govt and agency)

0.6x1 + 0.6x2 0.4x3


0.4x4 + 3.6x5 0

(average quality)

4x1 + 10x2 x3 2x4 3x5 0

(average maturity)

xi 0

(nonnegativity)

for i = 1, 2, 3, 4, 5

27

Notes

Portfolio selection
Solution
Bradley, Hax, Magnanti (1977)

A portfolio manager in charge of a bank portfolio has $10 million to


invest
5 different securities available
Bond
name
1
2
3
4
5

Bond
type
Municipal
Agency
Govt
Govt
Municipal

Quality
rating
2
2
1
1
5

Years to
maturity
9
15
4
3
2

Yield to
maturity(%)
4.3
2.7
2.5
2.2
4.5

Optimal
investment(M$)
2.2
0.0
7.4
0.0
0.4

Optimal value is $298,364


28

Notes

What if...

What if we are able to borrow up to $1 million at a rate of 2.75%?


In other words, we can increase our cash supply above $10 million by
borrowing at a rate of 2.75%
How can we change our model to incorporate this?

29

Notes

Incorporating borrowing
Define new decision variable
y = amount borrowed, in millions
Limitations on how much can be borrowed
I

Add new constraint:


y1

Cash availability increases


I

Change cash availability constraint:


5
X

xi 10 + y

i=1

30

Notes

Incorporating borrowing
Define new decision variable
y = amount borrowed, in millions
Borrowed money costs 2.75%
I

Change objective function:


0.043x1 + 0.027x2 + 0.025x3 + 0.022x4 + 0.045x5 0.0275y

Nonnegativity
y0

31

Notes

Incorporating borrowing
New model:
maximize

0.043x1 + 0.027x2 + 0.025x3


+ 0.022x4 + 0.045x5 0.0275y

(total earnings)

subject to

y1

(borrowing limit)

5
X

xi 10 + y

(cash available)

i=1

x2 + x3 + x4 4

(govt and agency)

0.6x1 + 0.6x2 0.4x3


0.4x4 + 3.6x5 0

(average quality)

4x1 + 10x2 x3 2x4 3x5 0

(average maturity)

xi 0 for i = 1, 2, 3, 4, 5, y 0

(nonnegativity)

32

Notes

Portfolio selection
Solution
Bradley, Hax, Magnanti (1977)

A portfolio manager in charge of a bank portfolio has $10 million to


invest
5 different securities available
Bond
name
1
2
3
4
5

Bond
type
Municipal
Agency
Govt
Govt
Municipal

Quality
rating
2
2
1
1
5

Years to
maturity
9
15
4
3
2

Yield to
maturity(%)
4.3
2.7
2.5
2.2
4.5

Optimal
investment(M$)
2.4
0.0
8.1
0.0
0.5

Optimal value is $300,700. That is $2,336 better than before.


33

Notes

Recap

Two examples of linear programming models


Take-home message: some constraints are nonlinear but can be
rewritten in linear form

34

S-ar putea să vă placă și