Traversing graphs

Mikael Karlsson mikael.karlsson@REDACTED
Wed May 25 16:55:33 CEST 2005


Hi Vlad,
are not the digraph and digraph_utils modules in stdlib useful to you?
/Mikael

onsdag 25 maj 2005 15:50 skrev Vlad Dumitrescu:
> Hi all,
>
> I just hit a problem where I clearly see how simple it would be with lazy
> evaluation. But since we don't have that, I wonder if anyone could point me
> to some non-lazy algorithms.
>
> I have a graph described by a list of nodes. The nodes refer to other nodes
> by name. I need to traverse the graph and do stuff on each node, without
> traversing a node more than once. Of course, the 'stuff' done above is
> recursive (the value for a node depends on the values of its linked nodes),
> so visiting a node results in visiting all linked ones.
>
> All references I found about doing this in a functional language are
> Haskell ones, and they use lazyness. Does anyone know about where to look
> for hints on how to solve this in a strict language?
>
> I have partial solutions, but I seem to be missing something, and such a
> problem can't be something new in computer science.
>
> Thanks in advance! best regards,
> Vlad



More information about the erlang-questions mailing list