320 likes | 415 Views
ENGM 792 Network Flow Programming. Shortest Path Solutions. Shortest Path . (Cost ) [External Flow]. (10). 2. 7. (6). (4). (1). (40). 5. (4). (0). (20). (2). (8). (20). [1]. 1. 10. [-1]. 3. (2). 8. (2). (4). (2). 6. (12). (10). (10). (3). (1). (6). 4. 9.
E N D
ENGM 792Network Flow Programming Shortest Path Solutions
Shortest Path (Cost) [External Flow] (10) 2 7 (6) (4) (1) (40) 5 (4) (0) (20) (2) (8) (20) [1] 1 10 [-1] 3 (2) 8 (2) (4) (2) 6 (12) (10) (10) (3) (1) (6) 4 9
Dijkstra’s Algorithm • Initial : let S={s}, s=0 • Find an arc k(i,j) that passes from an unsolved node to a solved node such that • Add node j and arc k(i,j) to tree • Add j to solved set S. Let j=I + ck • Go to step 2, repeat until S = set of all nodes
Shortest Path (Cost) [s] (10) 2 7 (6) (4) (1) (40) 5 (4) (0) (20) (2) [8] [0] (8) (20) 1 10 3 (2) 8 (2) (4) (2) 6 (12) (10) (10) (3) (1) (6) 4 9
solved closest length to node length of Iter nodes unsolved unsolved added shortest path 1 1 3 8 3 8
Shortest Path (Cost) [s] (10) 2 7 (6) (4) (1) (40) 5 (4) (0) (20) (2) [8] [0] (8) (20) 1 10 3 (2) 8 (2) (4) (2) 6 (12) (10) (10) (3) (1) (6) 4 9
Shortest Path (Cost) [s] (10) 2 7 (6) (4) (1) (40) 5 (4) (0) (20) (2) [8] [0] (8) (20) 1 10 3 (2) 8 (2) (4) [10] (2) 6 (12) (10) (10) (3) (1) (6) 4 9 [10]
Shortest Path (Cost) [s] (10) 2 7 (6) (4) (1) (40) 5 (4) (0) (20) (2) [8] [0] (8) (20) 1 10 3 (2) 8 (2) (4) (2) 6 (12) (10) (10) (3) (1) (6) 4 9 [10]
solved closest length to node length of Iter nodes unsolved unsolved added shortest path 1 1 3 8 3 8 2 1 4 10 3 6 10 4 10
Shortest Path (Cost) [s] (10) 2 7 (6) (4) (1) (40) 5 (4) (0) (20) (2) [8] [0] (8) (20) 1 10 3 (2) 8 (2) (4) [10] (2) 6 (12) (10) (10) (3) (1) (6) 4 9 [10]
solved closest length to node length of Iter nodes unsolved unsolved added shortest path 1 1 3 8 3 8 2 1 4 10 3 6 10 4 10 3 1 2 40 3 6 10 6 10 4 6 11
Shortest Path [12] (Cost) [s] (10) 2 7 (6) (4) (1) (40) 5 (4) (0) (20) (2) [8] [0] (8) (20) 1 10 3 (2) 8 (2) (4) [10] (2) 6 (12) (10) (10) (3) (1) (6) 4 9 [10]
Shortest Path [12] (Cost) [s] (10) 2 7 (6) (4) (1) 5 (4) (0) (20) [8] [0] (8) (20) 1 10 3 8 (2) (4) [10] (2) 6 (10) (10) (3) 4 9 [10]
solved closest length to node length of Iter nodes unsolved unsolved added shortest path 1 1 3 8 3 8 2 1 4 10 3 6 10 4 10 3 1 2 40 3 6 10 6 10 4 6 11 4 1 2 40 3 2 12 2 12 6 9 13
Shortest Path [12] (Cost) [s] (10) 2 7 (6) (4) (1) 5 (4) (0) (20) [8] [0] (8) (20) 1 10 3 8 (2) (4) [10] (2) 6 (10) (10) (3) 4 9 [10]
Shortest Path [12] (Cost) [s] (10) 2 7 (6) (4) (1) 5 (4) (0) (20) [8] [0] (8) (20) 1 10 3 8 (2) (4) [10] (2) 6 (10) (10) (3) 4 9 [10] [13]
solved closest length to node length of Iter nodes unsolved unsolved added shortest path 1 1 3 8 3 8 2 1 4 10 3 6 10 4 10 3 1 2 40 3 6 10 6 10 4 6 11 4 1 2 40 3 2 12 2 12 6 9 13 5 2 5 18 6 9 13 9 13
Shortest Path [12] (Cost) [s] (10) 2 7 (6) (4) (1) 5 (4) (0) (20) [8] [0] (8) (20) 1 10 3 8 (2) (4) [10] (2) 6 (10) (10) (3) 4 9 [10] [13]
Shortest Path [12] (Cost) [s] (10) 2 7 (6) (4) (1) 5 (4) (0) (20) [8] [0] [14] (8) (20) 1 10 3 8 (2) (4) [10] (2) 6 (10) (10) (3) 4 9 [10] [13]
Shortest Path [12] (Cost) [s] (10) 2 7 (6) (4) (1) 5 (4) (0) [8] [0] [14] (8) (20) 1 10 3 8 (2) (4) [10] (2) 6 (10) (3) 4 9 [10] [13]
solved closest length to node length of Iter nodes unsolved unsolved added shortest path 1 1 3 8 3 8 2 1 4 10 3 6 10 4 10 3 1 2 40 3 6 10 6 10 4 6 11 4 1 2 40 3 2 12 2 12 6 9 13 5 2 5 18 6 9 13 9 13 6 2 5 18 6 8 14 6 14 9 10 15
Shortest Path [12] (Cost) [s] (10) 2 7 (6) (4) (1) 5 (4) (0) [8] [0] [14] (8) (20) 1 10 3 8 (2) (4) [10] (2) 6 (10) (3) 4 9 [10] [13]
Shortest Path [12] (Cost) [s] (10) 2 7 (6) [14] (4) (1) 5 (4) (0) [8] [0] [14] (8) (20) 1 10 3 8 (2) (4) [10] (2) 6 (10) (3) 4 9 [10] [13]
Shortest Path [12] (Cost) [s] (10) 2 7 [14] (4) (1) 5 (4) (0) [14] [8] [0] (8) (20) 1 10 3 8 (2) (4) [10] (2) 6 (10) (3) 4 9 [10] [13]
solved closest length to node length of Iter nodes unsolved unsolved added shortest path 4 1 2 40 3 2 12 2 12 6 9 13 5 2 5 18 6 9 13 9 13 6 2 5 18 6 8 14 6 14 9 10 15 7 2 7 22 8 5 14 5 14 9 10 15
Shortest Path [12] (Cost) [s] (10) 2 7 [14] (4) (1) 5 (4) (0) [14] [8] [0] (8) (20) 1 10 3 8 (2) (4) [10] (2) 6 (10) (3) 4 9 [10] [13]
Shortest Path [12] (Cost) [s] (10) 2 7 [14] (4) (1) 5 (4) (0) [14] [8] [0] (8) (20) 1 10 [15] 3 8 (2) (4) [10] (2) 6 (10) (3) 4 9 [10] [13]
Shortest Path [12] (Cost) [s] (10) 2 7 [14] (4) 5 (4) (0) [14] [8] [0] (8) 1 10 [15] 3 8 (2) (4) [10] (2) 6 (10) (3) 4 9 [10] [13]
solved closest length to node length of Iter nodes unsolved unsolved added shortest path 5 2 5 18 6 9 13 9 13 6 2 5 18 6 8 14 6 14 9 10 15 7 2 7 22 8 5 14 5 14 9 10 15 8 2 7 22 5 7 18 8 10 24 9 10 15 10 15
Shortest Path [12] (Cost) [s] (10) [18] 2 7 [14] (4) 5 (4) (0) [14] [8] [0] (8) 1 10 [15] 3 8 (2) (4) [10] (2) 6 (10) (3) 4 9 [10] [13]
Shortest Path [12] (Cost) [s] [18] 2 7 [14] (4) 5 (4) (0) [14] [8] [0] (8) 1 10 [15] 3 8 (2) (4) [10] (2) 6 (10) (3) 4 9 [10] [13]
solved closest length to node length of Iter nodes unsolved unsolved added shortest path 5 2 5 18 6 9 13 9 13 6 2 5 18 6 8 14 6 14 9 10 15 7 2 7 22 8 5 14 5 14 9 10 15 8 2 7 22 5 7 18 8 10 24 9 10 15 10 15 9 2 7 22 5 7 18 7 18