lect04 - Lecture 4 Graph Search Breadth First Search...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Lecture 4 Graph Search Breadth First Search animation Initialize LIST Unmark all nodes in N; Mark node s 1 2 4 5 3 6 9 7 8 1 pred(1) = 0 next := 1 order(next) = 1 LIST:= {1} next 1 1 2 4 5 3 6 9 7 8 1 1 Select a node i in LIST LIST In breadth first search, i is the first node in LIST 1 2 4 5 3 6 9 7 8 1 1 next 1 1 1 If node i is incident to an admissible arc LIST Select an admissible arc (i,j) 1 2 4 5 3 6 9 7 8 1 1 next 1 2 1 1 Mark Node j pred(j) := i 2 Next := Next + 1 order(j) := next add j to LIST 2 2 If node i is incident to an admissible arc LIST Select an admissible arc (i,j) 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 1 Mark Node j pred(j) := i 2 Next := Next + 1 order(j) := next add j to LIST 2 2 5 5 4 If node i is incident to an admissible arc LIST Select an admissible arc (i,j) 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 1 Mark Node j pred(j) := i 2 Next := Next + 1 order(j) := next add j to LIST 2 2 5 5 3 4 3 4 If node i is not incident to an admissible arc LIST Delete node i from LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 1 2 2 2 5 5 3 4 3 1 4 Select Node i LIST The first node on LIST becomes node i 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 1 2 2 2 5 5 3 4 3 1 2 5 4 If node i is incident to an admissible arc LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 2 2 2 5 5 3 4 3 2 Select an admissible arc (i,j) Mark Node j pred(j) := i Next := Next + 1 order(j) := next add j to LIST 4 5 4 5 4 If node i is not incident to an admissible arc LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 2 2 2 5 5 3 4 3 2 Delete node i from LIST 4 5 4 2 5 4 Select a node LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 2 2 2 5 5 3 4 3 2 4 5 4 The first node on LIST becomes node i 5 6 5 4 If node i is incident to an admissible arc LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 2 2 2 5 5 3 4 3 2 4 5 4 5 Select an admissible arc (i,j) Mark Node j pred(j) := i Next := Next + 1 order(j) := next add j to LIST 6 6 6 6 5 4 If node i is not incident to an admissible arc LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 2 2 2 5 5 3 4 3 2 4 5 4 5 6 6 6 Delete node i from LIST 5 6 5 4 Select node 3 LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 2 2 2 5 5 3 4 3 2 4 5 4 5 6 6 6 node 3 is not incident to any admissible arcs 5 3 delete node 3 from LIST 3 6 5 4 Select a node LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 2 2 2 5 5 3 4 3 4 5 4 6 6 6 i : = 4 4 7 6 5 4 If node i is incident to an admissible arc LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 2 2 2 5 5 3 4 3 4 5 4 6 6 6 4 Select an admissible arc (i,j) Mark Node j pred(j) := i Next := Next + 1 order(j) := next add j to LIST 8 7 8 7 6 5 4 If node i is not incident to an admissible arc LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 2 2 2 5 5 3 4 3 4 5 4 6 6 6 4 Delete node i from LIST 8 7 8 4 7 6 5 4 Select node i LIST 1 2 4 5 3 6 9 7 8 3 1 1 next 2 3 1 2 2 2 5 5 3 4 3 4 5 4 6 6 6 i := 6 8 7 8 6 8...
View Full Document

Page1 / 92

lect04 - Lecture 4 Graph Search Breadth First Search...

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

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