I may have answered my own question.
The Compare functor that does the trick is:
struct ltExternalEdge : public
std::binary_function
On Aug 20, 2004, at 3:53 PM, Jeff Holle wrote:
I'm using gcc v3.4.1 and boost_CVS captured on Tue Jun 29 05:25:17 EDT 2004. I'm developing a boost.graph application that must deal with multiple graphs.
The following typedefs describe how its using boost.graph: typedef boost::adjacency_listboost::vecS,boost::vecS,boost::bidirectionalS GraphT;
[snip]
I've used ExternalVertex successfully in two different maps.
Since the vertices are stored in an std::vector, the vertex descriptor is actually an unsigned integer in [0:num_vertices(g)).
Now I'm having trouble populating the first map that uses ExternalEdge. The compiler warnings that I'm getting sugguest that Edge does have an "operator<" method. Specifically its: error: no match for 'operator<' in '__x->std::pair
::second < __y->std::pair ::second' Right. Edge descriptors do not have a < operator.
I'm wondering why Edge is different from Vertex.
It's not always clear how to order edges, nor is it clear how to order vertices except when the vertices are stored in an std::vector.
Any guidance that assists me to, at worst case, write a Compare operator for my "map
" containers would be appreciated. You have a few options here: 1) You could just add the property as an internal property 2) You could add (and maintain!) an edge_index internal property and order based on that 3) If you don't have parallel edges, you could order based on std::make_pair(source(e, g), target(e, g)).
Doug
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users