[Lemon-user] SubDigraph and ListDigraph

Alpár Jüttner alpar at cs.elte.hu
Tue Oct 25 15:39:30 CEST 2011


Hi,
> 
> I ran into a problem where I cannot convert a SubDigraph into a
> ListDigraph. I use the SubDigraph to construct a subgraph of my
> original ListDigraph. Now, how can I use the newly constructed
> SubDigraph as a ListDigraph…?

SubDigraph (and every other graph adaptor) doesn't create a physical
graph structure in the memory, but instead it "simulates" the desired
graph using the original graph and the auxiliary data. In spite of this,
you can use it directly with any graph algorithm.

If you still need to "convert" it to a ListDigraph, you must make a copy
of it, most practically by using the digraphCopy() utility, e.g.:


ListDigraph g;
ListDigraph::NodeMap<bool> n_filter(g);
ListDigraph::ArcMap<bool> a_filter(g);
...
SubDigraph<ListDigraph> sub_g(g,n_filter,a_filter);
...
ListDigraph g2;
digraphCopy(sub_g,g2);

Regards,
Alpar





More information about the Lemon-user mailing list