Network Optimization Breadth First Search Breadth first search animation Initialize1 1 Unmark all nodes in N; Mark node 1 and add it to LIST. LIST Breadth first search animation.

Download Report

Transcript Network Optimization Breadth First Search Breadth first search animation Initialize1 1 Unmark all nodes in N; Mark node 1 and add it to LIST. LIST Breadth first search animation.

Network Optimization
Breadth First Search
Breadth first search animation
Initialize
4
2
1 1
Unmark all
nodes in N;
5
3
8
7
6
9
Mark node 1
and add it to
LIST.
LIST
1
Breadth first search animation
2
Select node 1
4
2
8
1
1 1
2
5
7
3
Select the
first node
in LIST.
3
6
9
Arc numbers for arcs in A(i) refer to the
order in which arcs of A(i) are scanned.
LIST
1
Breadth first search animation
3
Scan arcs (1,2)
2 2
4
8
1
2
1 1
7
3
Find an
admissible
arc
LIST
5
3
1
6
9
2
Breadth first search animation
4
Scan arc (1,5)
2 2
4
8
1
2
1 1
1
7
3
3
Select node 1
and find an
admissible
arc.
LIST
5
3
2
6
9
5
Breadth first search animation
5
Scan arc (1,3)
2 2
4
8
1
2
1 1
1
7
3
3
Select node 1
and find an
admissible
arc.
LIST
5
3
2
4
5
Breadth first search animation
6
9
3
6
Delete Node 1 from LIST
2 2
4
1 1
5
Delete node 1
from LIST
LIST
1
3
2
4
5
Breadth first search animation
8
7
3
6
9
3
7
Select Node 2
1
2 2
4
8
2
1 1
5
Select first
node on LIST
LIST
1
3
2
4
5
Breadth first search animation
7
3
6
9
3
8
Scan arc (2, 4)
1
2 2
4
5
8
2
1 1
5
Select an
admissible
arc
LIST
3
1
2
Breadth first search animation
3
3
6
4
5
7
9
4
9
Scan arc (2, 5)
1
2 2
4
5
8
2
1 1
5
Ignore any
scanned arcs
out of node 2
that are not
admissible.
LIST
1
3
2
Breadth first search animation
3
3
6
4
5
7
9
4
10
Delete node 2
2 2
4
1 1
5
8
7
3
1
Delete node 2
from LIST
LIST
5
3
2
6
4
5
Breadth first search animation
3
9
4
11
Select node 5
2 2
4
1 1
5
8
7
3
1
Select the
first node on
LIST
LIST
5
3
6
4
5
Breadth first search animation
3
9
4
12
Scan arc (5,6)
2 2
4
1 1
5
8
7
3
1
Find an
admissible
arc
LIST
5
3
4
5
Breadth first search animation
3
9
6
6
4
6
13
Delete node 5
2 2
4
1 1
5
8
7
3
1
Delete node 5
from LIST
LIST
5
3
2
4
5
Breadth first search animation
3
9
6
6
4
6
14
Select node 3
2 2
4
1 1
Select first
node on LIST
5
5
8
7
3
1
3
2
4
LIST
Breadth first search animation
3
9
6
6
4
6
15
Scan arcs out of node 3
2 2
4
1 1
Ignore any
scanned arc
that is not
admissible.
5
5
8
7
3
1
3
2
4
LIST
Breadth first search animation
3
9
6
6
4
6
16
Delete node 3
2 2
4
1 1
Delete node 3
from LIST
5
3
Breadth first search animation
3
8
7
3
9
6
4
LIST
5
6
4
6
17
Select node 4
2 2
4
5
1
8
2
1 1
Select the
first node on
LIST
5
3
7
3
4
LIST
Breadth first search animation
9
6
6
4
6
18
Scan arc (4, 8)
2 2
4
5
1
87
2
1 1
5
Look for an
admissible
arc.
LIST
1
3
2
7
3
4
5
Breadth first search animation
3
9
6
6
4
6
8
19
Scan arc (4, 5)
2 2
4
5
1
87
2
1 1
Look for an
admissible
arc
5
3
7
3
4
LIST
Breadth first search animation
9
6
6
4
6
8
20
Delete Node 4
2 2
4
1 1
Delete node 4
from LIST
5
3
Breadth first search animation
87
7
3
9
6
4
LIST
5
6
4
6
8
21
Select node 6
2 2
4
1 1
Select the
first node on
LIST
5
5
87
7
3
1
3
6
4
LIST
Breadth first search animation
2
9
6
6
8
22
Scan arc (6,7)
2 2
4
1 1
5
1
87
7 8
3
1
Scan arcs out
of node 6 one
at a time.
LIST
5
3
2
6
4
5
Breadth first search animation
3
2
9
6
4
6
8
7
23
Scan arc (6,9)
2 2
4
1 1
Scan arcs out
of node 6 one
at a time.
5
5
87
7 8
3
1
3
6
4
LIST
Breadth first search animation
2
9
9
6
6
8
7
9
24
Delete node 6
2 2
4
1 1
Delete node 6
from LIST
5
3
Breadth first search animation
87
7 8
3
9
6
4
LIST
5
9
6
6
8
7
9
25
Select node 8
2 2
4
1 1
Select first
node on LIST
5
3
4
LIST
Breadth first search animation
5
87
7 8
3
9
6
9
6
8
7
9
26
Delete node 8
2 2
4
1 1
5
5
87
7 8
3
Delete node 8
3
4
LIST
Breadth first search animation
9
6
9
6
8
7
9
27
Select node 7
2 2
4
5
3
87
2
1 1
Select first
node on LIST
5
4
LIST
Breadth first search animation
1
3
7 8
3
9
6
9
6
7
9
28
Scan arcs out of node 7
2 2
4
5
3
87
2
1 1
Scan arcs out
of node 7 one
at a time.
5
4
LIST
Breadth first search animation
1
3
7 8
3
9
6
9
6
7
9
29
Delete node 7
2 2
4
1 1
Delete node 7
from LIST
5
3
4
LIST
Breadth first search animation
5
87
7 8
3
9
6
9
6
7
9
30
Select node 9
2 2
4
1 1
Select the
first node on
LIST
5
5
87
2
7 8
3
1
3
4
LIST
Breadth first search animation
9
6
9
6
9
31
Scan arcs out of node 9
2 2
4
1 1
Scan arcs out
of node 9,
one at a time
5
5
87
2
7 8
3
1
3
4
LIST
Breadth first search animation
9
6
9
6
9
32
Delete node 9
2 2
4
1 1
Delete node 9
from LIST
5
3
4
LIST
Breadth first search animation
5
87
7 8
3
9
6
9
6
9
33
THE END
Breadth first search animation
34
MITOpenCourseWare
http://ocw.mit.edu
15.082J / 6.855J / ESD.78J Network Optimization
Fall 2010
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.