15'082 and 6'855J - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

15'082 and 6'855J

Description:

And there is at least one node in G with no arcs coming in. ... G has no directed cycle, then one can relabel the nodes so that for each arc (i,j), i j. ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 12
Provided by: JimO76
Category:
Tags: 855j | relabel

less

Transcript and Presenter's Notes

Title: 15'082 and 6'855J


1
15.082 and 6.855J
  • Topological Ordering

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 lt j.

3
1
4
6
7
3
Initialization
6
1
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.
5
3
8
2
4
7
4
Select a node from LIST
6
1
Select a node from LIST and delete it.
next next 1order(i) next update
indegrees update LIST
5
3
8
2
4
7
7
1
0
1
next
1
2
3
4
5
7
8
6
Node
2
2
3
2
1
0
2
Indegree
0
1
1
7
5
5
Select a node from LIST
6
1
next next 1order(i) next update
indegrees update LIST
Select a node from LIST and delete it.
2
5
3
8
5
2
4
7
7
1
0
1
2
next
1
2
3
5
7
8
6
4
Node
2
2
3
1
1
0
2
Indegree
0
1
0
2
1
0
4
7
5
6
6
Select a node from LIST
3
6
6
1
next next 1order(i) next update
indegrees update LIST
Select a node from LIST and delete it.
2
5
3
8
5
2
4
7
7
1
0
1
2
3
next
1
2
3
5
7
8
6
4
Node
2
2
3
1
1
0
2
Indegree
0
1
0
2
1
0
0
1
4
7
5
6
2
7
Select a node from LIST
3
6
6
1
next next 1order(i) next update
indegrees update LIST
Select a node from LIST and delete it.
2
2
5
3
8
5
2
4
4
7
7
1
0
1
2
3
4
next
2
3
5
7
8
6
4
1
Node
2
2
3
1
1
0
2
Indegree
0
1
0
2
1
0
0
1
0
4
7
5
6
2
1
8
Select a node from LIST
5
3
1
6
6
1
next next 1order(i) next update
indegrees update LIST
Select a node from LIST and delete it.
2
2
5
3
8
5
2
4
4
7
7
1
0
1
2
3
4
5
next
2
3
5
7
8
6
4
1
Node
2
2
3
1
1
0
2
Indegree
0
1
0
2
1
0
0
1
0
2
1
4
7
5
6
2
1
9
Select a node from LIST
5
3
1
6
6
1
next next 1order(i) next update
indegrees update LIST
Select a node from LIST and delete it.
2
2
5
3
8
5
2
4
4
7
7
4
1
6
0
1
2
3
4
5
6
next
2
5
7
8
6
4
1
3
Node
2
2
3
1
1
0
2
Indegree
0
1
0
2
1
0
0
1
0
1
2
0
1
4
6
2
1
7
5
8
10
Select a node from LIST
5
3
1
6
6
1
next next 1order(i) next update
indegrees update LIST
Select a node from LIST and delete it.
7
2
2
5
3
8
5
2
8
4
4
7
7
4
1
6
0
1
2
3
4
5
6
7
next
2
5
7
8
6
4
1
3
Node
2
2
3
1
1
0
2
Indegree
0
1
0
2
1
0
0
1
0
1
2
0
1
0
8
3
11
Select a node from LIST
5
3
1
6
6
1
next next 1order(i) next update
indegrees update LIST
Select a node from LIST and delete it.
7
8
2
2
5
3
8
5
2
8
3
4
4
7
7
4
1
6
0
1
2
3
4
5
6
7
8
next
List is empty. The algorithm terminates with a
topological order of the nodes
2
5
7
8
6
4
1
3
Node
2
2
3
1
1
0
2
Indegree
0
1
0
2
1
0
0
1
0
1
2
0
1
0
3
Write a Comment
User Comments (0)
About PowerShow.com