Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] vertex_index_t,edge_index_t?
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2008-12-08 15:28:16


On Mon, Dec 8, 2008 at 2:41 PM, Tim Keitt <tkeitt_at_[hidden]> wrote:

> Geoff Hilton <geoff.hilton <at> t-optlogic.com> writes:
> > Where:
> > typedef boost::property<
> > boost::vertex_index_t,
> > unsigned long long,
> > MyVertexProperty> VertexPropertyWrapper_type;
>
> I believe adjacency_list has an internal vertex index property by default
> when
> choosing vecS for the vertex container, so you should not need to add it.
> Do
> things fail without it there?
>

That's correct.

Just declaring a vertex index as a property (either bundled or interior, as
here) won't buy you any new functionality. It just provides a place where
you can assign an index for each vertex or edge. The problem that this
half-solves is that nearly every algorithm in the distro requires a vertex
index map (or edge index map, more rarely), and providing this will allow
the default arguments to automatically extract a property map for
vertices/edges.

It won't - or shouldn't??? automatically assign indices. Also, if you remove
a vertex or edge, you may have to renumber vertices.

Andrew Sutton
andrew.n.sutton_at_[hidden]



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