Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Optimization Topological Ordering

Similar presentations


Presentation on theme: "Network Optimization Topological Ordering"— Presentation transcript:

1 Network Optimization Topological Ordering
Get ahold of a network, and use the same network to illustrate the shortest path problem for communication newtorks, the max flow problem, the minimum cost flow problem, and the multicommodity flow problem. This will be a very efficient way of introducing the four problems. (Perhaps under 10 minutes of class time.)

2 Preliminary to Topological Sorting
LEMMA. If each node has at least one arc going out, then the first inadmissible arc of a depth first search determines a directed cycle. 1 4 6 7 3 COROLLARY 1. If G has no directed cycle, then there is a node in G with no arcs going. And there is at least one node in G with no arcs coming in. COROLLARY 2. If G has no directed cycle, then one can relabel the nodes so that for each arc (i,j), i < j.

3 Initialization Determine the indegree di of each node i. 6 1 5 2 8 3
LIST = {i : di = 0} 7 4 1 2 3 4 5 6 7 8 Node Indegree LIST 7 2 2 3 2 1 1 2

4 Initialization “Next” will be the label of nodes in the topological order. 6 1 5 2 8 3 7 4 next 1 1 2 3 4 5 6 7 8 Node Indegree LIST 7

5 Select a node from LIST Select Node 7. 6 1 Order(7) := 1
Delete node 7. 5 2 8 3 7 7 4 1 1 next 1 2 3 4 5 6 7 8 Node LIST Indegree 2 2 3 2 1 1 2 7

6 Updates update “next” 6 update indegrees 1 5 2 8 3 update LIST 7 7 4 1
next 1 2 3 4 5 6 8 Node LIST Indegree 2 2 3 1 2 1 1 2 7 5

7 Select node 5 Select Node 5. 6 1 Order(5) := 2 2 Delete node 5. 5 5 2
8 3 7 7 4 1 2 1 next 1 2 3 4 5 6 8 Node LIST Indegree 2 2 3 2 1 1 2 7 5

8 Updates update “next” 6 update indegrees 1 2 5 5 2 8 3 update LIST 7 7
4 1 3 1 2 next 1 2 3 4 6 8 Node LIST Indegree 2 1 2 3 2 1 1 2 4 7 5 6

9 Select Node 6 (or 4) Select Node 6. 3 6 6 1 Order(6) := 3 2
Delete node 6. 5 5 2 8 3 7 7 4 1 3 2 1 next 1 2 3 4 6 8 Node LIST Indegree 2 1 2 3 2 1 2 4 7 5 6

10 Updates update “next” 3 6 6 update indegrees 1 2 5 5 2 8 3 update LIST
7 7 4 1 2 3 1 4 next 1 2 3 4 8 Node LIST Indegree 1 2 2 1 3 2 1 2 4 7 5 2

11 Select Node 2 (or 4) Select Node 2. 3 6 6 1 Order(2) := 4 2
Delete node 2. 5 5 2 2 8 3 4 7 7 4 1 2 4 3 1 next 1 2 3 4 8 Node LIST Indegree 2 1 3 1 2 2 4 7 5 6 2

12 Updates update “next” 3 6 6 update indegrees 1 2 5 5 2 2 8 3
update LIST 4 7 7 4 1 4 5 3 2 1 next 1 3 4 8 Node LIST Indegree 1 2 3 2 1 2 4 5 7 1 6

13 Select node 4 (or 1) Select Node 4. 3 6 6 1 Order(4) := 5 2
Delete node 4. 5 5 2 2 8 3 4 7 7 4 4 1 5 5 2 3 1 4 next 1 3 4 8 Node LIST Indegree 1 2 3 2 4 5 7 6 1

14 Updates update “next” 3 6 6 update indegrees 1 2 5 5 2 2 8 3
update LIST 4 7 7 4 4 1 5 3 4 5 2 6 1 next 1 3 8 Node LIST Indegree 1 2 3 2 1 2 5 7 6 1

15 Select Node 1 Select Node 1. 3 6 6 6 1 1 Order(1) := 6 2
Delete node 1. 5 5 2 2 8 3 4 7 7 4 4 1 5 4 3 5 6 1 2 next 1 3 8 Node LIST Indegree 3 2 1 2 7 5 6 1

16 Updates update “next” 3 6 6 6 update indegrees 1 1 2 5 5 2 2 8 3
update LIST 4 7 7 4 4 1 5 1 5 6 7 4 3 2 next 3 8 Node LIST Indegree 1 2 3 2 1 5 7 8

17 Select Node 8 Select Node 8. 3 6 6 6 1 1 Order(8) := 7 2
Delete node 8. 7 5 5 2 2 8 8 3 4 7 7 4 4 1 5 7 5 6 2 4 1 3 next 3 8 Node LIST Indegree 2 1 3 5 7 8

18 Updates update “next” 3 6 6 6 update indegrees 1 1 2 7 5 5 2 2 8 8 3
update LIST 4 7 7 4 4 1 5 8 5 7 6 4 2 1 3 next 3 Node LIST Indegree 1 2 3 7 5 3

19 Select node 3 Select Node 3. 3 6 6 6 1 1 Order(3) := 8 2
Delete node 3. 7 8 5 5 2 2 8 8 3 3 4 7 7 4 4 1 5 6 8 7 4 1 5 3 2 next List is empty. The algorithm terminates with a topological order of the nodes 3 Node LIST Indegree 7 5 3

20 15.082J / 6.855J / ESD.78J Network Optimization
MITOpenCourseWare 15.082J / 6.855J / ESD.78J Network Optimization Fall 2010 For information about citing these materials or our Terms of Use, visit:


Download ppt "Network Optimization Topological Ordering"

Similar presentations


Ads by Google