Topological_Sorting - 15.082 and 6.855J Topological...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1 15.082 and 6.855J Topological Ordering
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
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. 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. 1 4 6 7 3
Background image of page 2
3 Initialization 1 2 4 5 3 6 7 next 0 1 2 3 4 5 6 7 8 2 2 3 2 1 1 0 2 Node Indegree Determine the indegree of each node LIST is the set of nodes with indegree of 0. “Next” will be the label of nodes in the topological order. LIST 7
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Select a node from LIST next 0 1 2 3 4 5 7 8 2 2 3 2 1 0 2 Node Indegree Select a node from LIST and delete it. LIST 7 next := next +1 order(i) := next; update indegrees update LIST 1 1 1 2 4 5 3 6 7 0 1 5 6 1
Background image of page 4
5 Select a node from LIST next 0 1 2 3 5 7 8 2 2 3 1 1 0 2 Node Indegree Select a node from LIST and delete it.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/05/2010 for the course EE 15.082 taught by Professor Orlin during the Spring '10 term at Visayas State University.

Page1 / 11

Topological_Sorting - 15.082 and 6.855J Topological...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online