Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Is vertex_descriptor always integer?
From: Daniel Hofmann (daniel_at_[hidden])
Date: 2015-12-04 11:30:52


For the concept a vertex_descriptor models, take a look here:

> http://www.boost.org/doc/libs/1_59_0/libs/graph/doc/Graph.html

> A vertex descriptor corresponds to a unique vertex in an abstract graph instance. A vertex descriptor must be Default Constructible, Assignable, and Equality Comparable.

These are the guarantees you get.

I'm usually using make_iterator_property_map with a vector of the graph's vertex or edge descriptor.

Hope that helps,
Daniel J H

On December 4, 2015 4:07:58 PM GMT+01:00, "Ireneusz Szcześniak" <irek.szczesniak_at_[hidden]> wrote:
>Hi,
>
>In my code I do:
>
>vector_property_map<edge_descriptor> pred(num_vertices(g));
>auto rep = record_edge_predecessors(pred, on_edge_relaxed());
>auto dv = make_dijkstra_visitor(rep);
>dijkstra_shortest_paths(g, s, visitor(dv));
>
>But this assumes that the vertex_descriptor is integer, since I'm
>using vector_property.
>
>Does this assumption always hold, or should I choose the type of the
>property map based on the graph type?
>
>
>Thanks & best,
>Irek
>_______________________________________________
>Boost-users mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users


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