39
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

More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 2: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 3: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 4: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling 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.)

Page 5: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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.

Page 6: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 7: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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.

Page 8: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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.

Page 9: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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?

Page 10: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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 =

Page 11: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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?

Page 12: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 13: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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.

Page 14: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 15: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 16: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 17: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 18: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 19: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

19

Towards a Portfolio Model

an investment model over multiple time periods

maximize return and minimize risk

NEOS Portfolio Problem

Page 20: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 21: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 22: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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.

Page 23: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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.

Page 24: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 25: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 26: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 27: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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?

Page 28: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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.

Page 29: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

29

Conjoint Analysis

Widely used in product designs and pricing

Lots of research over the past 25 years.

Page 30: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 31: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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)

Page 32: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

32

v(T)

BT

B

T

BB

T

BT

v(B)

Which PDA is preferred?

Page 33: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 34: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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.

Page 35: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

35

Page 36: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 37: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 38: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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

Page 39: More Linear and Non-linear Programming Modelsdspace.mit.edu/bitstream/handle/1721.1/44638/15-053...2 Overview of Lecture zGoals – get practice in recognizing and modeling linear

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.