[algogeeks] Re: bfs doubt

2011-01-19 Thread SVIX
in the maze, u can leave pennies as breadcrumbs to trace your path... for current path, keep the pennies showing heads...if u hit a wall, backtrack until the place you made a choice while turning all the pennies to face tails up (to indicate dead end) so that you don't go that route again... On J

[algogeeks] Re: bfs doubt

2011-01-18 Thread juver++
But if we represent undirected edge (A, B) as (A->B) and (B->A) then after this problem can be reduced to searching Eulerian path -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.co

[algogeeks] Re: bfs doubt

2011-01-18 Thread juver++
I found that Euler's algo cannot be applied here. Please ignore my above posts. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to a

[algogeeks] Re: bfs doubt

2011-01-18 Thread juver++
However, Eulerian path traverses each edge (in one direction) exactly once. You may repeat the path in backward order. So you traverses edges in each directions once. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, se

[algogeeks] Re: bfs doubt

2011-01-18 Thread juver++
Path you mentioned to find is an Euler-path. It can be traversed during DFS. Here is an algorithm. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@goo