Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] directed_graph_adapter
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2013-04-19 17:45:44


On Fri, 19 Apr 2013, Andreas Fabri wrote:

>
> Hello,
>
> Did anybody write an adapter class (similar
> to filtered_graph) that gives a directed view
> on an undirected bidirectional graph.
>
> Or an adapter in the other direction, that is
> an undirected view on a directed graph.
>
> If not, is there a major obstacle, that is
> it simply cannot be implemented, even if it
> seems straightforward.

I do not see either direction in the library currently. The
undirected->directed direction should be straightforward if you do not
want to do anything too complicated with writing edge properties on the
directed version (assuming the graph type follows the rules in the
documentation about out_edges, it should just be a matter of changing the
tag from undirected to bidirectional and adding in_edges, in_degree, and
some typedefs). Are there algorithms you are trying to use that require a
directed graph and do not accept an undirected one (or don't do what you
want on an undirected one)? The directed->undirected direction is much
harder, especially if the input graph is not bidirectional. Also, would
you expect that opposite-direction edges are merged if they are between
the same vertices? That would cause many more problems. What would you
like these wrappers for?

-- Jeremiah Willcock


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