Boost logo

Boost Users :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2006-08-03 14:03:50


On Jul 27, 2006, at 6:01 AM, timblech wrote:
>
> i'm curious, if it's possible to change the type, that a graph uses as
> vertex_descriptor...
> i went through the examples, where usually int values are used,
> which seems
> to be the default ... for my application, i'd like to use a class
> pointer as
> vertex_descriptor, though...
>

The BGL graph types don't let you change the type of
vertex_descriptor, but you can add extra properties to the vertices
of the graph (which can include your own class).

> the problem i had with property map is, that i was only able to
> look up a
> property by vertex_descriptor, but not the other way round...

Right. You could store a copy of the vertex descriptor in the
property itself. adjacency_list_traits allows you to determine what
the descriptor type will be, before instantiating the graph.

        Doug


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