Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost][graph] problems using reverse_graph adaptor
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-06-30 07:30:06


>
>
> Why does reverse_graph requires edges_size_type?
> edges_size_type isn't in BidirectionalGraph, VertexListGraph,
> PropertyGraph.
> it is in EdgeListGraph.

This appears to be a case where the documentation has lagged behind the
implementation. The reverse_graph adaptor tries to satisfy EdgeListGraph and
PropertyGraph. Fortunately, these are fairly easy requirements to implement.
You just need to provide the typedefs.

> reverse_graph requires Graph to be `BidirectionalGraph and optionally
> VertexListGraph and PropertyGraph`.
> What does `optionally` mean? My graph is not a PropertyGraph. I want just
> revert edges.
>

It probably means "optionally" in the functional sense, but you have to
provide the typedefs since the adaptor is creating typedefs for them (which
is kind of lame, but unfortunately unavoidable). If you don't want to
support properties then do this in your graph:

typedef no_property vertex_property_type;
typedef no_property edge_property_type;

You may also have to do something similar for property bundles, but I forget
the exact types and names.

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