[Haskell-cafe] Re: Functional specification of DFS

jerzy.karczmarczuk at info.unicaen.fr jerzy.karczmarczuk at info.unicaen.fr
Thu Oct 18 15:19:26 EDT 2007


Vimal writes: 

...
> Now, I face some problem which i think is due to Lazy evaluation.
> I tried adding strictness in as many meaningful places as possible,
> but it doesnt work :( 
> 
> I have sat with the code for a long time, and yet I am not able to
> come up with a convincing reason as to why it doesnt work. For
> somegraphs, it even hangs and gives a stack overflow exception!

First, the suspicion that lazy evaluation may lead to a non-termination
of such algorithm is almost surely wrong, and in any case it is against
my religious beliefs [some twisted smiley here]. 

Then, please, would you mind stating again what do you *ultimately*
want? A depth-first SEARCH of a goal node, if reachable, or the construction
of the spanning tree (through backtracking). You probably said that, but
I have probably missed that posting. 

Jerzy Karczmarczuk 




More information about the Haskell-Cafe mailing list