More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2...

Preview:

Citation preview

1

15.053 February 8, 2005

More Linear and Non-linear Programming Models

Announcements:– Lecture check problems = practice for quiz– Can everyone attend office hours?

• 3-5 Monday and Wednesdays– Should I post lectures on web before class?– Homework cover sheets

2

Overview of Lecture

Goals– get practice in recognizing and modeling linear

constraints and objectives– and non-linear objectives– to see a broader use of models in practice

Models– Postal Worker Problem– Portfolio Optimization– Conjoint Analysis

3

Overview

Scheduling Postal Workers (5 in 7)– The model– Practical enhancements or modifications– Two non-linear objectives that can be made

linear– A non-linear constraint that can be made linear

4

Scheduling Postal WorkersEach postal worker works for 5 consecutive days, followed by 2 days off, repeated weekly.

Day Mon Tues Wed Thurs Fri Sat Sun

Demand 17 13 15 19 14 16 11

Minimize the number of postal workers (for the time being, we will permit fractional workers on each day.)

5

Formulating as an LP

Select the decision variables– Let x1 be the number of workers who start

working on Monday, and work till Friday– Let x2 be the number of workers who start on

Tuesday …– Let x3, x4, …, x7 be defined similarly.

6

The linear programDay Mon Tues Wed Thurs Fri Sat Sun

Demand 17 13 15 19 14 16 11

Minimize z = x1 + x2 + x3 + x4 + x5 + x6 + x7

x1 + x4 + x5 + x6 + x7 ≥ 17 Mon. subject tox1 + x2 + x5 + x6 + x7 ≥ 13 Tues.x1 + x2 + x3 + x6 + x7 ≥ 15 Wed.x1 + x2 + x3 + x4 + x7 ≥ 19 Thurs.x1 + x2 + x3 + x4 + x5 ≥ 14 Fri.

x2 + x3 + x4 + x5 + x6 ≥ 16 Sat.x3 + x4 + x5 + x6 + x7 ≥ 11 Sun.

xj ≥ 0 for j = 1 to 7

7

A Closer Look at the Constraint Matrix

x1 x2 x3 x4 x5 x6 x7

1 0 0 1 1 1 1 ≥ 17 Mon

1 1 0 0 1 1 1 ≥ 13 Tues

1 1 1 0 0 1 1 ≥ 15 Wed

1 1 1 1 0 0 1 ≥ 19 Thurs

1 1 1 1 1 0 0 ≥ 14 Fri

0 1 1 1 1 1 0 ≥ 16 Sat

0 0 1 1 1 1 1 ≥ 11 Sun

It is cyclically repeating in both rows and columns.

8

On the selection of decision variables

A choice of decision variables that doesn’t work– Let yj be the number of workers on day j.– No. of Workers on day j is at least dj. (easy to formulate)– Each worker works 5 days on followed by 2 days off (hard).

Conclusion: sometimes the decision variables incorporate constraints of the problem. – Hard to do this well, but worth keeping in mind– We will see more of this in integer programming.

9

Some Modifications of the Model

Suppose that there was a pay differential. The cost of workers who start work on day j is cj per worker.

Suppose that one can hire part time workers (one day at a time), and that the cost of a part time worker on day j is pj.

Work with your partner to modify the model taking into account the new information.What are the new decision variables?What are the changes to the model?

10

What are the new decision variables?

subject to x1 + x4 + x5 + x6 + x7 ≥ 17x1 + x2 + x5 + x6 + x7 ≥ 13x1 + x2 + x3 + x6 + x7 ≥ 15x1 + x2 + x3 + x4 + x7 ≥ 19x1 + x2 + x3 + x4 + x5 ≥ 14

x2 + x3 + x4 + x5 + x6 ≥ 16x3 + x4 + x5 + x6 + x7 ≥ 11

xj ≥ 0 for j = 1 to 7

Minimize z =

11

Another EnhancementSuppose that the desirable number of workers on day j is dj, but it is not required. Let sj be the “excess” number of workers day j. sj > 0 if there are more workers on day j than dj; otherwise sj ≤ 0.

What is the minimum cost schedule, where the “cost” of having too many workers on day j is fj(sj), which is a non-linear function?

12

What are the new decision variables?

What is the resulting non-linear model?

subject to x1 + x4 + x5 + x6 + x7 d1

x1 + x2 + x5 + x6 + x7 d2

x1 + x2 + x3 + x6 + x7 d3

x1 + x2 + x3 + x4 + x7 d4

x1 + x2 + x3 + x4 + x5 d5

x2 + x3 + x4 + x5 + x6 d6

x3 + x4 + x5 + x6 + x7 d7

xj ≥ 0 for j = 1 to 7

z = Minimize

13

A non-linear function that can be made linear.Suppose we want to minimize |x – 4| + |y – 7|

subject to other constraints.

This is equivalent to minimize z1

s.t. z1 ≥ x – 4z1 ≥ 4 – x

+ other constraints

minimize z1 + z2s.t.

z2 ≥ y – 7z2 ≥ 7 – y

Suppose the objective is minimize |s1| + … + |s7|. Take a minute and modify the last NLP to make it a linear program.

14

subject to x1 + x4 + x5 + x6 + x7 d1

x1 + x2 + x5 + x6 + x7 d2

x1 + x2 + x3 + x6 + x7 d3

x1 + x2 + x3 + x4 + x7 d4

x1 + x2 + x3 + x4 + x5 d5

x2 + x3 + x4 + x5 + x6 d6

x3 + x4 + x5 + x6 + x7 d7

xj ≥ 0 for j = 1 to 7

Minimize

15

A 2nd non-linear objective that can be made linear.

Minimize y = max[ (x - 1) , (.5x + 1) ] s.t. other constraints.

1 2 3 4 5 6

1

2

3

4

5

min ys.t. y ≥ x - 1

y ≥ .5x + 1+ other constraints

16

Exercise: minimize the maximum number of excess workers needed on any day: that is

Minimize max (s1, …, s7), where sj ≥ 0 for each j.

Minimize

subject to x1 + x4 + x5 + x6 + x7 - s1 = 17x1 + x2 + x5 + x6 + x7 - s2 = 13x1 + x2 + x3 + x6 + x7 - s3 = 15x1 + x2 + x3 + x4 + x7 - s4 = 19x1 + x2 + x3 + x4 + x5 - s5 = 14

x2 + x3 + x4 + x5 + x6 - s6 = 16x3 + x4 + x5 + x6 + x7 - s7 = 11

xj ≥ 0 , sj ≥ 0 for j = 1 to 7

17

A ratio constraint:

Suppose that we need to ensure that at least 30% of the workers have Sunday off.

How do we model this?

(x1 + x2 )/(x1 + x2 + x3 + x4 + x5 + x6 + x7) ≥ .3

Note: the denominator is always positive.

If we multiply both sides of the inequality by the denominator, we get a linear constraint.

(x1 + x2 ) ≥ .3 (x1 + x2 + x3 + x4 + x5 + x6 + x7)

.7x1 + .7x2 - .3x3 - .3x4 - .3x5 - .3x6 - .3x7 ≥ 0

18

Other enhancements

Require that each shift has an integral number of workers – integer program

Consider longer term scheduling– model 6 weeks at a time

Consider shorter term scheduling– model lunch breaks

Model individual workers– permit worker preferences

19

Towards a Portfolio Model

an investment model over multiple time periods

maximize return and minimize risk

NEOS Portfolio Problem

20

Returns of a portfolioExample: Stock A has a return of 10%

Stock B has a return of 20%

Return on Investment

0.10.120.140.160.180.2

0 0.2 0.4 0.6 0.8 1

Proportion of Stock A

Ret

urn

21

Evaluating Risk

0.1500.1600.1700.1800.1900.2000.2100.2200.230

0 0.2 0.4 0.6 0.8 1Proportion of Stock A

SD o

f Ret

urn

of

Port

folio

Stock A has a s.d. of .223

Stock B has a s.d. of .223

Cov(A, B) = 0

Varying the Covariance

22

Portfolio Selection Example

There are 3 candidate assets for out portfolio, X, Y and Z. The expected returns are 30%, 20% and 8% respectively (if possible we would like at least a 12% return). Suppose the covariance matrix is:

What are the variables?3 1 0.51 2 0.40.5 0.4 1

X Y ZXYZ

−−

− −

Let X,Y,Z be percentage of portfolio of each asset.

23

Portfolio Optimization

Minimize Variance of Portfolio

subject toExpected Return >= Required returninvestments sum to 100%investments are non-negative

Variance of portfolio = variance due to individual investments + 2 * sum of covariances.

24

Portfolio Selection Example2 2 23 2 2 0.8X Y Z XY XZ YZ+ + + − −Min

st 1.3 1.2 1.08 1.121

0, 0, 0

X Y ZX Y ZX Y Z

+ + ≥+ + =≥ ≥ ≥

The quadratic programs (non-linear programs) arising from portfolio problems are easy to solve.

Portfolio Example

25

Risk vs. ReturnRisk vs. Return

0

0.5

1

1.5

2

2.5

3

3.5

0.12 0.17 0.22 0.27Expected Return

Varia

nce

of P

ortfo

lio

26

Portfolio Optimization in Practice

Problems arising in practice often have additional constraints.

Using linear programming one can handle:– upper bounds on each investment– lower bound (or upper bound) on the proportion

of assets held in high tech firms, or whatever.

Other constraints and costs can be handled using integer programming– transaction costs– lower bounds on investments that are chosen

27

What is Conjoint Analysis?

Conjoint analysis is a data analysis for estimating how much respondents value different features.

Illustration: Consider a PDA that has 6 attributes– Size– Cell phone– Hands free operation– Extended battery– Wireless internet– Price

How much does the respondent value each attribute?

28

Why Use Conjoint Analysis?

Possibility: Ask the respondent to estimate the partworths.

Alternative: Use stated preferences on final products to backward infer partworth values.

29

Conjoint Analysis

Widely used in product designs and pricing

Lots of research over the past 25 years.

30

Simplified PDA Example

BTB T∅

T = Titanium Case; B = Big Size

Four PDA Models:• Model ∅ – Small / Leather Case• Model B – Big / Leather Case• Model T – Small / Titanium Case• Model BT – Big / Titanium Case

31

Simplified PDA Example

B BT∅ T

T = Titanium Case; B = Big Size

Utilities given partworths v(B) and v(T):

U∅ = 0 UB = v(B)UT = v(T) UBT = v(B) + v(T)

32

v(T)

BT

B

T

BB

T

BT

v(B)

Which PDA is preferred?

33

BTB T∅

T = Titanium Case; B = Big Size

A consumer then rank orders the products (or cards), and we infer information about the values.

Example: The customer prefers BT, B, T, and ∅, in order

Consider a graph in 2 dimensions.

Then u(BT) > u(B) > u(T) > u(∅).

v(B) + v(T) > v(B) > v(T) > 0

34

v(T)

BT > T > B > ∅

BT > B > T > ∅

B > BT > ∅ > T

B > ∅ > BT > T∅ > B > T > BT

∅ > T > B > BT

T > ∅ > BT > B

T > BT > ∅ > B

BB

T

BT

BT

B

T

v(B)

Example: Suppose 0 < v(T) < v(B) ≤ $50.

35

36

Conjoint Analysis.

Let v(j) be the value of aspect j.

For each product i, ∈

= ∑ ( )( )i j Aspect i

U v j

∑ 2,

( )iji jMin y

∈= ∑ ( )

. . ( )i j Aspect is t U v j

whenever product i is preferred to product j.+ ≥ ( )i ijU y U j

for all i and j≥ 0i jy

37

Conjoint analysis

There are lots of bells and whistles one can add

Important part of marketing profession

presented in a lecture in May: a recent improvement that may yield better results due to – Dahan– Hauser– Orlin– Yee

38

Summary

Postal worker problem– illustration of different types of constraints and

objectives that can arise and how to deal with them

Portfolio Optimization

Conjoint Analysis

39

Lecture check problems**

Section 3.7 #2Section 3.8 #1Section 3.9 #1Section 3.10 #1Section 3.11 #1

** Lecture check problems are practice problems for the quizzes. They are intended to be at about the same level of difficulty.

Recommended