Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Flow Problems – Shortest Path Problem

Similar presentations


Presentation on theme: "Network Flow Problems – Shortest Path Problem"— 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, dij does not have to equal the distance from node j to i, dji.

2 Network Flow Problems – Shortest Path Problem
Dijkstra’s labeling algorithm: 9 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:

9 Shortest Path Problem – Excel Solution

10 Shortest Path Problem – Cost Example
Equipment Replacement Problem: d15 d14 d13 d35 d12 d23 d34 d45 1 2 3 4 5  where Ki is purchase price in year i , Si is salvage value after i years in service, and ct is 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
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.


Download ppt "Network Flow Problems – Shortest Path Problem"

Similar presentations


Ads by Google