Lecture 15
Lecture 15
1
Summary of the previous lecture
Xn Xn-1 X2 X1
• Bellman’s principle of optimality
2
Dynamic Programming
x1
f1* S1 Max R1 x1
0 < x 1 < S1
0 < S1 < Q
S1 : Amount of water available for allocation to User 1
x1 : Amount of water allocated to User 1
x1* : Allocation to User 1, that results in f1 S1
*
5
Contd.
S1 x1 R1(x1) f1* S1 Max R1 x1 x1*
0 0
1 7
4 2 12 16 4
3 15
4 16
0 0
1 7
2 12
5 16 4
3 15
4 16
5 15
0 0
1 7
2 12
6 3 15 16 4
4 16
5 15
6 12 6
Dynamic Programming
R2(x2)
Stage 2: S2 - x2
S2 User 2 User 1
x2
f 2* S 2 Max R2 x2 f1* S 2 x2
0 < x 2 < S2
0 < S2 < Q
8
Dynamic Programming
f 2* S 2 Max R2 x2 f1* S 2 x2
0 < x2 < S2 ; 0 < S2 < Q
f1* S 2 x2 R2* x2
f1 S 2 x2 2 2
S2 x2 R2(x2) S 2 – x2 f *
S x2*
0 0 0 0 0 0 0 0
0 0 1 7 7
1 7 0
1 5 0 0 5
0 0 2 12 12
2 1 5 1 7 12 12 0, 1
2 6 0 0 6
0 0 3 15 15
1 5 2 12 17
3 17 1
2 6 1 7 13
3 3 0 0 3
Contd. 9
Contd.
S2 x2 R2(x2) S2 – x2 f1* S 2 x2 R2 x2
f1* S 2 x2
f 2* S 2 x 2*
0 0 4 16 16
1 5 3 15 20
4 2 6 2 12 19 20 1
3 3 1 7 10
4 -4 0 0 -4
0 0 5 16 16
1 5 4 16 21
2 6 3 15 21
5 21 1, 2
3 3 2 12 15
4 -4 1 7 3
5 -15 0 0 -15
0 0 6 16 16
1 5 5 16 21
2 6 4 16 22
6 3 3 3 15 18 22 2
4 -4 2 12 8
5 -15 1 7 -8
6 -30 0 0 -30 10
Dynamic Programming
Stage 3: R3(x3)
S3 – x3
S3 User 3 User 2 User 1
x3
f 3* S3 Max R3 x3 f 2* S3 x3
0 < x 3 < S3
S3 = Q
11
Dynamic Programming
S3 : Amount of water available for allocation to User 1,
User 2 and User 3 together = 6 units
x3 : Amount of water allocated to User 3
12
Dynamic Programming
f3* S3 Max R3 x3 f 2* S3 x3
0 < x3 < S3
S3 = Q
R x
S3 x3 R3(x3) S 3 – x3 f 2* S3 x3 f 3* S3 x f3* S3 x3*
2 3 3
0 0 6 22 22
1 5 5 21 26
2 8 4 20 28
6 3 9 3 17 26 28 2
4 8 2 12 20
5 5 1 5 10
6 0 0 0 0
13
Dynamic Programming
• When the third stage is solved, all the three users
are considered for allocation; thus the total
maximum return is
f3* 6 28
• The allocations to individual users are traced back.
x 1
*
2
S1 S2 x 4 1 3
*
2
15
Dynamic Programming
16
Dynamic Programming
Characteristics of DP problem:
• Problem is divided into stages, with a policy
decision required at each stage.
• Each stage has a number of possible states
associated with it.
e.g., In the allocation problem, the amount of
water available for allocation at a stage defines
the state at that stage.
17
Dynamic Programming
In allocation problem,
the transformation function is, (Sn – xn)
18
Dynamic Programming
20