introduction to operations research - vtk gent · 2016. 2. 1. · introduction to operations...

29
Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo Rezende Amaral

Upload: others

Post on 08-Nov-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

Introduction to Operations Research

ANSWERS

Introduction to Dynamic Programming

Prof. dr. E-H. Aghezzafir. Rodrigo Rezende Amaral

Page 2: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

Exercise 1

Page 3: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo
Page 4: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo
Page 5: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

Exercise 2

Page 6: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

B B B B

II I I

C C C

f4(I) = 12 , x4(I) = I ft(i) : profit from t to end departing from city if4(B) = 16-5 , x4(B) = I xt(i) : city to which we travel on tf4(C) = 17-2 , x4(C) = I

Page 7: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

B B B B

II I I

C C C

, x3(I) = C

f4(I) = 12 , x4(I) = I ft(i) : profit from t to end departing from city if4(B) = 16-5 , x4(B) = I xt(i) : city to which we travel on tf4(C) = 17-2 , x4(C) = I

Page 8: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

B B B B

II I I

C C C

f4(I) = 12 , x4(I) = If4(B) = 16-5 , x4(B) = If4(C) = 17-2 , x4(C) = I

, x3(B) = B

Page 9: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

B B B B

II I I

C C C

f4(I) = 12 , x4(I) = If4(B) = 16-5 , x4(B) = If4(C) = 17-2 , x4(C) = I

, x3(C) = C

Page 10: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

B B B B

II I I

C C C

f3(I) = 25 , x3(I) = If3(B) = 27 , x3(B) = Bf3(C) = 32 , x3(C) = C

, x2(I) = C

Page 11: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

B B B B

II I I

C C C

, x2(B) = B

f3(I) = 25 , x3(I) = If3(B) = 27 , x3(B) = Bf3(C) = 32 , x3(C) = C

Page 12: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

B B B B

II I I

C C C

, x2(C) = C

f3(I) = 25 , x3(I) = If3(B) = 27 , x3(B) = Bf3(C) = 32 , x3(C) = C

Page 13: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

B B B B

II I I

C C C

, x1(B) = B

f2(I) = 42 , x2(I) = Cf2(B) = 43 , x2(B) = Bf2(C) = 49 , x2(C) = C

Page 14: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

B B B B

II I I

C C C

f4(I) = 12 , x4(I) = If4(B) = 16-5 , x4(B) = If4(C) = 17-2 , x4(C) = I

, x1(B) = B

0 16 16

16-5

Page 15: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

Exercise 6

Page 16: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

Profits when machine is kept for only one year:= -5000 + 4500 - 500 + 3000 = 2000

Profits when machine is kept for two years:= -5000 + (4500 + 3000) - (500 + 700) + 1800 = 3100

Profits when machine is kept for three years:= -5000 + (4500 + 3000 + 1500) - (500 + 700 + 1100) + 500 = 2200

Page 17: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

gt : profit which can be made from period t to 6 (g6 = 0)

Page 18: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

Exercise 3

Page 19: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

ft(i) : minimum cost (order placing + holding costs) incurred from month t to end, given that i units are on hand at the beginning of month t.

xt(i) : production level during month t attaining ft(i)

f4(0) = 1*4 + 0*2 = 4 , x4(0) = 2f4(1) = 1*4 + 0*2 = 4 , x4(1) = 1f4(2) = 0*4 + 0*2 = 0 , x4(2) = 0

Page 20: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo
Page 21: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo
Page 22: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

1

1

2

3

4

5

0

1

2

3

4

0

1

2

0

end

2

21

3 0

40

0

4 44

4+2

4+2

0

0

2

Page 23: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

ft = min (ctj + ft+j+1) for j = 0, 1, 2, … T – t (fT+1 = 0)

ctj = K + c(dt + dt+1 + … + dt+j) + h [(j)dt+j + (j-1)dt+j-1 + … (1)dt+1]

K = 4 d1 = 0h = 2 d2 = 1c = 0 d3 = 2

d4 = 2

b) Wagner-Whitin Algorithm

Page 24: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

b) Wagner-Whitin Algorithm

ft = min (ctj + ft+j+1) for j = 0, 1, 2, … T – t (fT+1 = 0) ctj = 4 + 2 [(j)dt+j + (j-1)dt+j-1 + … (1)dt+1]

𝑓5 = 0∗

𝑓4 = 4 + 𝑓5 = 4∗

𝑓3 = min 4 + 𝑓4 = 8

4 + 2 1 ∗ 2 + 𝑓5 = 8∗

𝑓2 = min

4 + 𝑓3 = 12∗

4 + 2 1 ∗ 2 + 𝑓4 = 12∗

4 + 2 2 ∗ 2 + 2 − 1 ∗ 2 + 𝑓5 = 16

Page 25: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

c) Silver-Meal heuristic

TCt(j) = K + HCt(j)ACt(j) = TCt(j)/(j+1)

TCt(j): total cost in period t to produce all units demanded from period t to period t+j

HCt(j): holding cost from period t to t+j if we produce all unitsdemanded from period t to period t+j

ACt(j): average cost per period if we produce all unitsdemanded from period t to period t+j (in period t)

(j = 0..T-t)

HCt(j) = h [(j)dt+j + (j-1)dt+j-1 + … (1)dt+1]

Page 26: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

c) Silver-Meal heuristic

TC1(0) = 0 + 0 , AC1(1) = 0

K = 4h = 2

d1 = 0d2 = 1d3 = 2d4 = 2

TC2(0) = 4 + 0 , AC2(0) = 4/1TC2(1) = 4 + 1*2*2 , AC2(1) = 8/2TC2(2) = 4 + 1*2*2 + 2*2*2 , AC2(2) = 16/3

TC3(0) = 4 + 0 , AC3(0) = 4/1TC3(1) = 4 + 1*2*2 , AC3(1) = 8/2

TC4(0) = 4 + 0 , AC4(0) = 4/1

Page 27: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

Exercise 7

Newly hired workers do not quit.

Page 28: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

ft(w) = minimum cost incurred in meeting demands for years t to 5 given that w workers are available in the beginning of year t (before hiring and firing)

ht = Workers hired at beginning of year tdt = Workers fired at beginning of year twt = Workers required during year t

Page 29: Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations Research ANSWERS Introduction to Dynamic Programming Prof. dr. E-H. Aghezzaf ir. Rodrigo

b) Add the following condition:

If w < wt, then ft(w) = ∞

This will ensure that each month's requirement is met. Also note that dt must satisfy (w - dt) ≥ wt.