From: Jeremy Siek (jsiek_at_[hidden])
Date: 2004-04-05 11:08:40
Here's some issues with this idea:
Currently the vertex_descriptor for adjacency_list has no
property-related type stuff in it, which allows
adjacency_list_traits to work... that is, it is possible
to determine the vertex_descriptor type without knowing the type of the
vertex properties. This is important, for example, if you want an
internal property containing a vertex descriptor (this is a circular
vertex_descpriptor's are handles... passed by value. You would
not want the City object copied, so the vertex descriptor would
be a pointer to some object that inherits from City. However,
dereferencing this pointer will add overhead to the execution
time, especially in the case when a vertex_descriptor would
have just been an int.
Do you see solutions to these problems?
On Apr 5, 2004, at 1:01 AM, Vladimir Prus wrote:
> Douglas Gregor wrote:
>>> I still don't know if using City to identifiy vertices is feasible.
>> Why not make vertices derive from (or be aggregated with and
>> to) City? It has a whole ton of advantages:
>> 1) The user can just think of nodes as if they were City objects,
>> easy access to City members.
>> 2) Can trivially build a property map from a member pointer;
>> wouldn't it
>> nice to say:
>> dijsktra_shortest_paths(g, v, distance_map(&City::distance))
> This would be nice, really!
>> 3) graph<Vertex, Edge, Rep> can have Rep=adjacency_list<whatever>
>> as the
>> default representation, so we lose no genericity.
> I see only one problem. If vertex== some class derived from City, then
> the vertex itself, as well as vector<vertex> might be very large and
> BGL passes/stores vertices by value almost everywhere.
> The point about operator* is that it allows access to City (though less
> convenient), but does significally affect performance.
> - Volodya
> Unsubscribe & other changes:
Jeremy Siek <jsiek_at_[hidden]>
Ph.D. Student, Indiana University Bloomington
Graduating in August 2004 and looking for work
C++ Booster (http://www.boost.org)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk