Deterministic Dynamic Programming Part 1
Deterministic Dynamic Programming Part 1
1
Deterministic Dynamic Programming
2
Recursive Nature of Computations in DP
3
Recursive Nature of Computations in DP
Example 9:
Suppose that you want to select the shortest
highway route between two cities. The network
in the next slide provides the possible routes
between the starting city at node 1 and the
destination city at node 7. The routes pass
through intermediate cities designated by nodes
2 to 6. 5
Shortest Route Problem
2 12
7 5
8 9
8
1 3 9 7
5
7 6 6
4 13
6
Shortest Route Problem
7
Shortest Route Problem
8
Shortest Route Problem
2 2
12
7
5 5 9
8
8 7
1 3 3 9
5 6 6
7
6
13
4 4
9
Shortest Route Problem
2 2
12
7
5 5 9
8
8 7
1 3 3 9
5 6 6
7
6
13
4 4
10
Stage 1
Shortest Route Problem
2 2
12
7
5 5 9
8
8 7
1 3 3 9
5 6 6
7
6
13
4 4
11
Stage 2
Shortest Route Problem
2 2
12
7
5 5 9
8
8 7
1 3 3 9
5 6 6
7
6
13
4 4
12
Stage 3
Shortest Route Problem
13
Shortest Route Problem
14
Shortest Route Problem
Stage 1 Summary:
15
Shortest Route Problem
Stage 1 Summary:
16
Shortest Route Problem
Stage 1 Summary:
17
Shortest Route Problem
18
Shortest Route Problem
7 + 12 = 19
= min 8 + 8 = 16 = 12 (from node 4)
5 + 7 = 12
19
Shortest Route Problem
Node 6 can be
reached from nodes 3
and 4 only.
20
Shortest Route Problem
8 + 9 = 17
= min = 17 (from node 3)
5 + 13 = 18
21
Shortest Route Problem
Stage 2 Summary:
22
Shortest Route Problem
23
Shortest Route Problem
12 + 9 = 21
= min = 21 (from node 5) 24
17 + 6 = 23
Shortest Route Problem
Stage 3 Summary:
25
Shortest Route Problem
26
Shortest Route Problem
5 9 9 7
6 6 6 7
30
Stage 2, i = 2:
d(x2,x3) + f3(x3) Optimum Solution
x2
x3 = 5 x3 = 6 f2(x2) x3
2 12 + 9 = 21 - 21 5
3 8 + 9 = 17 9 + 6 = 15 15 6
4 7 + 9 = 16 13 + 6 = 19 16 5 31
Stage 1, i = 1:
d(x1,x2) + f2(x2) Optimum Solution
x1
x2 = 2 x2 = 3 x2 = 4 f1(x1) x2
1 7 + 21 = 28 8 + 15 = 23 5 + 16 = 21 21 4
32
d(x3,x4) Optimum Solution
x3
x4 = 7 f3(x3) x4
5 9 9 7
6 6 6 7
3 8 + 9 = 17 9 + 6 = 15 15 6
4 7 + 9 = 16 13 + 6 = 19 16 5
1 7 + 21 = 28 8 + 15 = 23 5 + 16 = 21 21 4 33
34