Boost logo

Boost Users :

Subject: Re: [Boost-users] [graph] Convert bidirectional graphs into directed graphs
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-03-18 09:43:03


> I need to convert any bidirectional graph into an
> adjacency_list<vecS,vecS,directedS>,
> but looks like the copy constructor cannot handle it (needs the same type
> in input).
> I don't see any simple way to convert any directed graph into an
> adjacency_list<vecS,vecS,directedS>.
> Is there any more-or-less-simple way to do it that I don't know?
> May be there is a way to copy graphs constrained not by the concrete type
> of the graph,
> but only, may be, on graph concepts?
> Thanks,
>

There's no direct conversion between *any* bidirectional graph and a
directed adjancency_list. If you're talking about any bidirectional
adjacency list and a directed one, you shouldn't actually need to convert
them.

As an alternative, you could use copy_graph.

Andrew Sutton
andrew.n.sutton_at_[hidden]



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