ENGM 792 Network Flow Programming

32
ENGM 792 Network Flow Programming Shortest Path Solutions

description

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. - PowerPoint PPT Presentation

Transcript of ENGM 792 Network Flow Programming

Page 1: ENGM 792 Network Flow Programming

ENGM 792Network Flow Programming

Shortest Path Solutions

Page 2: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[External Flow]

[1] [-1]

2

1

4

5

3

6

7

9

8 10

(40)

(8)

(10)

(4)

(12)

(2)

(2)

(1)

(2)

(6)

(10)

(4)

(4)

(3)

(6)

(0) (20)

(10)

(20)

(2)

(1)

Page 3: ENGM 792 Network Flow Programming

Dijkstra’s Algorithm

1. Initial : let S={s}, s=02. Find an arc k(i,j) that passes from an unsolved

node to a solved node such that

3. Add node j and arc k(i,j) to tree4. Add j to solved set S. Let j=I + ck

5. Go to step 2, repeat until S = set of all nodes

]',',)','(':min[),( '' SjSiAjikcjik ki

Page 4: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10

(40)

(8)

(10)

(4)

(12)

(2)

(2)

(1)

(2)

(6)

(10)

(4)

(4)

(3)

(6)

(0) (20)

(10)

(20)

(2)

(1)

[8]

Page 5: ENGM 792 Network Flow Programming

solved closest length to node length ofIter nodes unsolved unsolved added shortest path 1 1 3 8 3 8

Page 6: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10

(40)

(8)

(10)

(4)

(12)

(2)

(2)

(1)

(2)

(6)

(10)

(4)

(4)

(3)

(6)

(0) (20)

(10)

(20)

(2)

(1)

[8]

Page 7: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10

(40)

(8)

(10)

(4)

(12)

(2)

(2)

(1)

(2)

(6)

(10)

(4)

(4)

(3)

(6)

(0) (20)

(10)

(20)

(2)

(1)

[8]

[10]

[10]

Page 8: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10

(40)

(8)

(10)

(4)

(12)

(2)

(2)

(1)

(2)

(6)

(10)

(4)

(4)

(3)

(6)

(0) (20)

(10)

(20)

(2)

(1)

[8]

[10]

Page 9: ENGM 792 Network Flow Programming

solved closest length to node length ofIter nodes unsolved unsolved added shortest path 1 1 3 8 3 8

2 1 4 10 3 6 10 4 10

Page 10: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10

(40)

(8)

(10)

(4)

(12)

(2)

(2)

(1)

(2)

(6)

(10)

(4)

(4)

(3)

(6)

(0) (20)

(10)

(20)

(2)

(1)

[8]

[10]

[10]

Page 11: ENGM 792 Network Flow Programming

solved closest length to node length ofIter 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

Page 12: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10

(40)

(8)

(10)

(4)

(12)

(2)

(2)

(1)

(2)

(6)

(10)

(4)

(4)

(3)

(6)

(0) (20)

(10)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

Page 13: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(6)

(10)

(4)

(4)

(3)

(0) (20)

(10)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

Page 14: ENGM 792 Network Flow Programming

solved closest length to node length ofIter 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

Page 15: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(6)

(10)

(4)

(4)

(3)

(0) (20)

(10)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

Page 16: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(6)

(10)

(4)

(4)

(3)

(0) (20)

(10)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

[13]

Page 17: ENGM 792 Network Flow Programming

solved closest length to node length ofIter 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

Page 18: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(6)

(10)

(4)

(4)

(3)

(0) (20)

(10)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

[13]

Page 19: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(6)

(10)

(4)

(4)

(3)

(0) (20)

(10)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

[13]

[14]

Page 20: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(6)

(10)

(4)

(4)

(3)

(0)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

[13]

[14]

Page 21: ENGM 792 Network Flow Programming

solved closest length to node length ofIter 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

Page 22: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(6)

(10)

(4)

(4)

(3)

(0)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

[13]

[14]

Page 23: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(6)

(10)

(4)

(4)

(3)

(0)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

[13]

[14]

[14]

Page 24: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(10)

(4)

(4)

(3)

(0)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

[13]

[14]

[14]

Page 25: ENGM 792 Network Flow Programming

solved closest length to node length ofIter 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

Page 26: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(10)

(4)

(4)

(3)

(0)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

[13]

[14]

[14]

Page 27: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(10)

(4)

(4)

(3)

(0)

(20)

(2)

(1)

[8]

[10]

[10]

[12]

[13]

[14]

[14]

[15]

Page 28: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(10)

(4)

(4)

(3)

(0)

(2)

[8]

[10]

[10]

[12]

[13]

[14]

[14]

[15]

Page 29: ENGM 792 Network Flow Programming

solved closest length to node length ofIter 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

Page 30: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(10)

(4)

(4)

(3)

(0)

(2)

[8]

[10]

[10]

[12]

[13]

[14]

[14]

[15]

[18]

Page 31: ENGM 792 Network Flow Programming

Shortest Path (Cost)

[s]

[0]

2

1

4

5

3

6

7

9

8 10(8)

(10)

(4)

(2)

(4)

(4)

(3)

(0)

(2)

[8]

[10]

[10]

[12]

[13]

[14]

[14]

[15]

[18]

Page 32: ENGM 792 Network Flow Programming

solved closest length to node length ofIter 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