in reply to Re^2: Short Circuiting DFS Graph Traversal
in thread Short Circuiting DFS Graph Traversal
> Now, let's say I first start descending from D -> X and beyond and unwind back to D in failure. Now I go to D -> F -> X. I already determined that paths to X coming from D are bad so I can stop here.
I haven't investigated the "short circuit" heuristics you've implemented so far, but it's certainly not trivial.
Let the following show a search for paths from 0 to * and the numbers denote the first steps taken in a DFS.
Now avoiding edges or nodes "failuring" after passing 2 would hinder you finding 0->3->2->4->1->* after unwinding to 0.3 / \ 0 2 \ / \ 1---4 | *
IMHO you need a mechanism to detect loops ("cycles") to "earlier" nodes in your actual search path before cutting of a branch of the graph which isn't trivial for DFS, I'd rather prefer BFS.
But this involves already more mathematical proofs than most of our fellow monks are likely to tolerate.
Which brings me back to the suspicion that we are trying to launch a rocket, while the OP most likely needs a tutorial about how to throw stones!
As long as he isn't capable/willing to correctly express his needs it doesn't make much sense continuing! :(
HTH!
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Short Circuiting DFS Graph Traversal
by Limbic~Region (Chancellor) on Nov 01, 2010 at 15:47 UTC | |
by LanX (Saint) on Nov 01, 2010 at 16:12 UTC |