Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations...
Transcript of Introduction to Operations Research - VTK Gent · 2016. 2. 1. · Introduction to Operations...
Introduction to Operations Research
ANSWERS
Introduction to Dynamic Programming
Prof. dr. E-H. Aghezzafir. Rodrigo Rezende Amaral
Exercise 1
Exercise 2
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
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
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
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
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
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
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
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
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
Exercise 6
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
gt : profit which can be made from period t to 6 (g6 = 0)
Exercise 3
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
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
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
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
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]
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
Exercise 7
Newly hired workers do not quit.
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
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.