OPIM 915 - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

OPIM 915

Description:

OPIM 915 Depth First Search The depth first search tree OPIM 915 Depth First Search The depth first search tree Initialize LIST Unmark all nodes in N; Mark node s 1 2 ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 31
Provided by: JimO164
Category:
Tags: opim | depth | first | search

less

Transcript and Presenter's Notes

Title: OPIM 915


1
OPIM 915
  • Depth First Search

2
Initialize
1
1
Unmark all nodes in N Mark node s
pred(1) 0 next 1order(next) 1 LIST 1
LIST
3
Select a node i in LIST
1
1
1
In depth first search, i is the last node in LIST
LIST
1
4
If node i is incident to an admissible arc
2
4
2
8
2
1
1
5
7
1
1
Select an admissible arc (i,j)
Mark Node j pred(j) i
Next Next 1 order(j) next add j to
LIST
9
3
6
LIST
1
2
1
2
next
5
Select the last node on LIST
2
4
2
8
2
2
1
1
5
7
1
1
1
9
3
6
Node 2 gets selected
LIST
1
2
1
2
next
6
If node i is incident to an admissible arc
2
4
4
3
2
8
2
2
1
1
5
7
1
1
1
Select an admissible arc (i,j)
Mark Node j pred(j) i
Next Next 1 order(j) next add j to
LIST
9
3
6
LIST
1
2
4
1
2
3
next
7
Select
2
4
4
4
3
2
8
2
2
2
1
1
5
7
1
1
1
Select the last node on LIST
9
3
6
LIST
1
2
4
1
2
3
next
8
If node i is incident to an admissible arc
2
4
4
4
3
2
8
2
2
2
8
4
1
1
5
7
1
1
1
Select an admissible arc (i,j)
Mark Node j pred(j) i
Next Next 1 order(j) next add j to
LIST
9
3
6
LIST
1
2
4
8
1
2
3
4
next
9
Select
2
4
4
4
3
2
8
2
2
2
8
4
8
1
1
5
7
1
1
1
Select the last node on LIST
9
3
6
LIST
1
2
4
8
1
2
3
4
next
10
If node i is not incident to an admissible arc
2
4
4
4
3
2
8
2
2
2
8
4
8
8
1
1
5
7
1
1
1
Delete node i from LIST
9
3
6
LIST
1
2
4
8
1
2
3
4
next
11
Select
2
4
4
4
4
3
2
8
2
2
2
8
4
8
8
1
1
5
7
1
1
1
Select the last node on LIST
9
3
6
LIST
1
2
4
8
1
2
3
4
next
12
If node i is incident to an admissible arc
2
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
1
1
5
7
1
1
1
5
Select an admissible arc (i,j)
Mark Node j pred(j) i
Next Next 1 order(j) next add j to
LIST
9
3
6
LIST
1
2
4
8
5
1
2
3
4
5
next
13
Select
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
1
1
5
7
1
1
1
5
5
Select the last node on LIST
9
3
6
LIST
1
2
4
8
5
1
2
3
4
5
next
14
If node i is incident to an admissible arc
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
1
1
5
7
1
1
1
5
5
Select an admissible arc (i,j)
Mark Node j pred(j) i
Next Next 1 order(j) next add j to
LIST
9
3
6
6
6
LIST
1
2
4
8
5
6
1
2
3
4
5
6
next
15
Select the last node on LIST
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
1
1
5
7
1
1
1
5
5
5
Select node 6
9
3
6
6
6
6
LIST
1
2
4
8
5
6
1
2
3
4
5
6
next
16
If node i is incident to an admissible arc
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
1
1
5
7
1
1
1
5
5
5
Select an admissible arc (i,j)
Mark Node j pred(j) i
Next Next 1 order(j) next add j to
LIST
9
9
3
6
6
6
7
6
LIST
1
2
4
8
5
6
9
1
2
3
4
5
6
7
next
17
Select the last node on LIST
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
1
1
5
7
1
1
1
5
5
5
Select node 9
9
9
9
3
6
6
6
6
7
6
LIST
1
2
4
8
5
6
9
1
2
3
4
5
6
7
next
18
If node i is incident to an admissible arc
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
8
1
1
5
7
1
1
1
5
5
5
7
Select an admissible arc (i,j)
Mark Node j pred(j) i
Next Next 1 order(j) next add j to
LIST
9
9
9
3
6
6
6
6
7
6
LIST
1
2
4
8
5
6
9
7
1
2
3
4
5
6
7
8
next
19
Select the last node on LIST
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
8
1
1
5
7
1
1
1
5
5
5
7
7
Select node 7
9
9
9
9
3
6
6
6
6
7
6
LIST
1
2
4
8
5
6
9
7
1
2
3
4
5
6
7
8
next
20
If node i is not incident to an admissible arc
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
8
1
1
5
7
1
1
1
5
5
5
7
7
7
Delete node 7 from LIST
9
9
9
9
3
6
6
6
6
7
6
LIST
1
2
4
8
5
6
9
7
1
2
3
4
5
6
7
8
next
21
Select node 9
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
8
1
1
5
7
1
1
1
5
5
5
7
7
7
But node 9 is not incident to an admissible arc.
Delete node 9 from LIST
9
9
9
9
9
9
3
6
6
6
6
7
6
LIST
1
2
4
8
5
6
9
7
1
2
3
4
5
6
7
8
next
22
Select node 6
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
8
1
1
5
7
1
1
1
5
5
5
7
7
7
But node 6 is not incident to an admissible arc.
Delete node 6 from LIST
9
9
9
9
9
9
3
6
6
6
6
6
6
7
6
LIST
1
2
4
8
5
6
9
7
1
2
3
4
5
6
7
8
next
23
Select node 5
2
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
8
1
1
5
7
1
1
1
5
5
5
7
7
7
5
5
But node 5 is not incident to an admissible arc.
Delete node 5 from LIST
9
9
9
9
9
9
3
6
6
6
6
6
6
7
6
LIST
1
2
4
8
5
6
9
7
1
2
3
4
5
6
7
8
next
24
Select node 4
2
4
4
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
5
8
1
1
5
7
1
1
1
5
5
5
7
7
7
5
5
But node 4 is not incident to an admissible arc.
Delete node 4 from LIST
9
9
9
9
9
9
3
6
6
6
6
6
6
7
6
LIST
1
2
4
8
5
6
9
7
1
2
3
4
5
6
7
8
next
25
Select node 2
2
4
4
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
2
2
5
8
1
1
5
7
1
1
1
5
5
5
7
7
7
5
5
But node 2 is not incident to an admissible arc.
Delete node 2 from LIST
9
9
9
9
9
9
3
6
6
6
6
6
6
7
6
LIST
1
2
4
8
5
6
9
7
1
2
3
4
5
6
7
8
next
26
Select node 1
2
4
4
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
2
2
5
8
1
1
5
7
1
1
1
5
5
5
7
7
7
5
5
1
Select an admissible arc (i,j)
Mark Node j pred(j) i
Next Next 1 order(j) next add j to
LIST
9
9
9
9
9
9
3
6
6
6
6
6
6
3
7
9
6
LIST
1
2
4
8
5
6
9
7
3
1
2
3
4
5
6
7
8
9
next
27
Select node 3
2
4
4
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
2
2
5
8
1
1
5
7
1
1
1
5
5
5
7
7
7
5
5
1
1
But node 3 is not incident to an admissible arc.
Delete node 3 from LIST
9
9
9
9
9
9
3
6
6
6
6
6
6
3
3
3
7
9
6
LIST
1
2
4
8
5
6
9
7
3
1
2
3
4
5
6
7
8
9
next
28
Select node 1
2
4
4
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
2
2
5
8
1
1
5
7
1
1
1
5
5
5
7
7
7
5
5
1
1
1
1
But node 1 is not incident to an admissible arc.
Delete node 1 from LIST
9
9
9
9
9
9
3
6
6
6
6
6
6
3
3
3
7
9
6
LIST
1
2
4
8
5
6
9
7
3
1
2
3
4
5
6
7
8
9
next
29
LIST is empty
2
4
4
4
4
4
4
4
3
2
8
2
2
2
8
4
8
8
2
2
5
8
1
1
5
7
1
1
1
5
5
5
7
7
7
5
5
1
1
1
1
The algorithm ends!
9
9
9
9
9
9
3
6
6
6
6
6
6
3
3
3
7
9
6
LIST
1
2
4
8
5
6
9
7
3
1
2
3
4
5
6
7
8
9
next
30
The depth first search tree
Note that each induced subtree has consecutively
labeled nodes
Write a Comment
User Comments (0)
About PowerShow.com