1 / 19

Network Flow Problems – Shortest Path Problem

Network Flow Problems – Shortest Path Problem. Consider the following flow network:. d 26. 2. 6. d 12. d 36. d 23. d 13. 1. 3. d 56. d 35. d 34. d 14. d 45. 4. 5.

Download Presentation

Network Flow Problems – Shortest Path Problem

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network Flow Problems –Shortest Path Problem Consider the following flow network: d26 2 6 d12 d36 d23 d13 1 3 d56 d35 d34 d14 d45 4 5 The objective is to find the shortest path from node 1 to node n. The distance from node i to j, dijdoes not have to equal the distance from node j to i, dji.

  2. Network Flow Problems –Shortest Path Problem 9 Dijkstra’s labeling algorithm: 2 6 3 6 2 7 1 3 3 3 1 4 3 Summary: Nodes are permanently labeled or temporarily labeled. All nodes that can be immediately reached from permanently labeled nodes are temporarily labeled. The label is the minimum of the sum of the distance from node 1 to the permanent node plus the distance to the temporary node. Start with node 1 as the only permanently labeled node. Find the temporarily labeled node with minimum distance. Make this node permanent. Repeat this process until all nodes are permanently labeled. 4 5

  3. Network Flow Problems –Shortest Path Problem Dijkstra’s labeling algorithm: 9 2 (3,1) 6 3 6 2 7 1 [0] 3 (7,1) 3 3 1 4 3 4 (4,1) 5 [ ] – permanent label (d,f) – temporary label; d – distance, f - from node L(0) = [0, 3, 7, 4, inf., inf.] – choose node 2 *

  4. Network Flow Problems –Shortest Path Problem Dijkstra’s labeling algorithm: 9 2 [3,1] 6 (12,2) 3 6 2 7 1 [0] 3 (5,2) 3 3 1 4 3 4 (4,1) 5 L(1) = [0, 3, 5, 4, inf., 12] – choose node 4 * *

  5. Network Flow Problems –Shortest Path Problem Dijkstra’s labeling algorithm: 9 2 [3,1] 6 (12,2) 3 6 2 7 1 [0] 3 (5,2) 3 3 1 4 3 4 [4,1] 5 (7,4) L(2) = [0, 3, 5, 4, 7, 12] – choose node 3 * * *

  6. Network Flow Problems –Shortest Path Problem Dijkstra’s labeling algorithm: 9 2 [3,1] 6 (11,3) 3 6 2 7 1 [0] 3 [5,2] 3 3 1 4 3 4 [4,1] 5 (7,4) L(3) = [0, 3, 5, 4, 7, 11] – choose node 5 * * * *

  7. Network Flow Problems –Shortest Path Problem Dijkstra’s labeling algorithm: 9 2 [3,1] 6 (10,5) 3 6 2 7 1 [0] 3 [5,2] 3 3 1 4 3 4 [4,1] 5 [7,4] L(4) = [0, 3, 5, 4, 7, 10] – choose node 6 * * * * *

  8. Network Flow Problems –Shortest Path Problem Dijkstra’s labeling algorithm: 9 2 [3,1] 6 [10,5] 3 6 2 7 1 [0] 3 [5,2] 3 3 1 4 3 4 [4,1] 5 [7,4] L(5) = [0, 3, 5, 4, 7, 10] – done * * * * * * Shortest Path: 1-4-5-6

  9. Shortest Path Problem – Excel Solution

  10. Shortest Path Problem – Cost Example Equipment Replacement Problem: d15 d14 d13 d35 d12 d34 d23 d45 4 1 2 3 5 where Kiis purchase price in year i , Siis salvage value after i years in service, and ctis maintenance cost after t years of service.

  11. Minimal Spanning Tree Objective: Find the minimum distance such that all nodes are visited once (i.e. no cycles). 9 2 6 3 6 2 7 1 3 3 3 1 4 3 4 5

  12. Minimal Spanning Tree One possible spanning tree, Z = 26 (note, no cycles). 9 2 6 3 7 1 3 4 3 4 5

  13. Minimal Spanning Tree • Possible applications: • Phone lines between cities. • Rail lines between cities. • Road networks. • Air conditioning ducts. • etc.. 9 2 6 3 7 1 3 4 3 4 5

  14. Minimal Spanning Tree Algorithm: Step 1 – Select an arbitrary node initially. Identify a node that is closest and include the arc connecting these two nodes in the spanning tree. Step 2 – Out of the remaining nodes, determine the one that is closest to a node already selected in the spanning tree. Include the arc connecting these two nodes in the spanning tree. Whenever there is a tie for the closest node, it is broken arbitrarily.

  15. Minimal Spanning Tree Start with node 1. Node 2 is closest. 9 2 6 3 6 2 7 1 3 3 3 1 4 3 4 5

  16. Minimal Spanning Tree Node 3 is closest to partial spanning tree {(1,2)}. Remove any cycles. 9 2 6 3 6 2 1 3 3 3 1 4 3 4 5

  17. Minimal Spanning Tree Node 4 is closest to partial spanning tree {(1,2), (2,3)}. Remove any cycles. 9 2 6 3 6 2 1 3 3 3 1 3 4 5

  18. Minimal Spanning Tree Node 5 is closest to partial spanning tree {(1,2), (2,3),(3,4)}. Remove any cycles. Note, arbitrarily select (3,5) or (4,5). 9 2 6 3 6 2 1 3 3 1 3 4 5

  19. Minimal Spanning Tree Node 6 is closest to partial spanning tree {(1,2), (2,3),(3,4),(4,5)}. Remove any cycles. Stop, no more nodes. 2 6 3 2 1 3 3 1 3 4 5 Minimal spanning tree is {(1,2), (2,3),(3,4),(4,5),(5,6)}. Z = 12.

More Related