depthfirstsearch - 15.082 and 6.855J Depth First Search...

Info iconThis preview shows pages 1–11. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 15.082 and 6.855J Depth First Search Unmark all nodes in N; Mark node s 2 Initialize LIST 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 3 Select a node i in LIST LIST In depth first search, i is the last node in LIST 1 2 4 5 3 6 9 7 8 1 1 next 1 1 1 Select an admissible arc (i,j) 1 Mark Node j pred(j) := i 4 If node i is incident to an admissible arc… LIST 1 2 4 5 3 6 9 7 8 1 1 next 2 1 1 2 Next := Next + 1 order(j) := next add j to LIST 2 2 1 5 Select the last node on LIST LIST 1 2 4 5 3 6 9 7 8 1 1 next 2 1 1 2 2 2 1 2 Node 2 gets selected 12 Select an admissible arc (i,j) Mark Node j pred(j) := i 6 3 If node i is incident to an admissible arc… LIST 1 2 4 5 3 6 9 7 8 1 1 next 1 1 2 2 2 1 2 Next := Next + 1 order(j) := next add j to LIST 4 3 4 12 7 3 Select LIST 1 2 4 5 3 6 9 7 8 1 1 next 1 1 2 2 2 1 2 Select the last node on LIST 4 3 4 2 4 123 Select an admissible arc (i,j) Mark Node j pred(j) := i 8 3 If node i is incident to an admissible arc… LIST 1 2 4 5 3 6 9 7 8 1 1 next 1 1 2 2 2 1 2 4 4 2 4 Next := Next + 1 order(j) := next add j to LIST 8 4 4 8 123 9 3 Select LIST 1 2 4 5 3 6 9 7 8 1 1 next 1 1 2 2 2 1 2 4 2 4 8 4 4 8 Select the last node on LIST 4 8 123 8 10 3 If node i is not incident to an admissible arc… LIST 1 2 4 5 3 6 9 7 8 1 1 next 1 1 2 2 2 1 2 4 2 4 8 4 4 4 8 Delete node i from LIST 8 123...
View Full Document

Page1 / 30

depthfirstsearch - 15.082 and 6.855J Depth First Search...

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

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