|
Boost Users : |
Subject: Re: [Boost-users] [Graph] Difference between DF search and visit / Graph Printing
From: Andrew Sutton (asutton.list_at_[hidden])
Date: 2011-03-26 11:54:01
> Its actually quite easy to solve recursively. I have just done it for LEDA
> and I guess porting the code to boost is a snap. Basicly I just couldn't
> believe that I have to roll out my own solution.
I see. You're right. Like I said, the BGL's DFS guarantees that each
vertex is visited exactly once, regardless of the structure of the
graph (acyclic or not). Its not terribly surprising that you'd have to
write your own solution. I don't think that this application was ever
considered a use case for the BGL's DFS suite. The algorithm is simple
enough to write.
It might be worth noting pointing out that the mockup you showed won't
for graphs with cycles. Applying this to a graph with a single vertex
and loop edge will result in infinite recursion.
Andrew
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net