Boost logo

Boost Users :

Subject: Re: [Boost-users] PropertyGraphConcept concept checking errors for an example implicit graph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-06-26 11:30:35


On Fri, 25 Jun 2010, W.P. McNeill wrote:

> I'll look into implementing all the non-mutable graph concepts.  That shouldn't be difficult.  Are the following concept are consistent with each other?
> * Graph
> * IncidenceGraph
> * BidirectionalGraph
> * AdjacencyGraph
> * VertexListGraph
> * EdgeListGraph
> * PropertyGraph
> What should I specify for the traversal_category if I model all of them with a single object?

I believe they are all consistent. Your traversal category should inherit
virtually from all of the tags for the concepts that your graph provides.
See the part in <boost/graph/grid_graph.hpp> that first mentions "virtual"
for an example.

> I think also having a vertex property map is a good idea.  Maybe I'll
> make that a mutable color map, so there's an example of a writable
> property map.  Should I use associative_property_map as a base class?
>  (That's what's done in "The Boost Graph Library" section 15.3.2.)

I would use iterator_property_map (on a vector) with the vertex_index map
that you have/are going to put in.

> I'll add Dijkstra's algorithm to the main() function.

OK.

> Have you looked at the source since commit f500721913f6728fc85d
> "Complete Edge Weight Map Parameterization"?  With that checkin I tried
> to render all type definitions in terms of graph_traits<> and
> property_traits<>.

Part of me says that it might be better to put your code in a namespace
and then use the actual (internal) names of edge_descriptor, etc. to make
the code shorter. You can also, once you have a namespace, just make
typedefs for "edge_descriptor" and such directly within the namespace so
you can refer to them unqualified. It's up to you whether you want to
change that.

> I'll look at iterator_facade.
>
> I'll combine implicit.cpp and implicit.hpp into just implicit.hpp.  All
> the valid expression functions should be inline anyway.  I think having
> a separate main.cpp makes things more readable.

It looks like you have done these in the latest checkin.

I would recommend having your source(), target(), etc. functions take the
graph by const reference; although it doesn't matter to your code since
your graph type is small, I think it would be a better model for other
users (with larger graph types) that you not copy graphs around
unnecessarily.

-- 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