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

As an alternative, you could use copy_graph.

Andrew Sutton

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at