|
Boost : |
From: Aaron Windsor (aaron.windsor_at_[hidden])
Date: 2005-11-19 12:12:26
Hi all,
I've put some files in the boost vault under algorithms/graph in a
package I'm calling "auto index property maps." I developed these in
response to a thread on boost-users a few months back
(http://tinyurl.com/bezjr) and a steady stream of questions on this
mailing list and boost-users about how to use/create vertex and edge
index maps when they aren't provided for you.
Vertex index maps are property maps that map the vertices of a graph
bijectively into the range [0..num_vertices(g)). Edge index maps map
edges bijectively into [0..num_edges(g)).
Many BGL algorithms require a vertex or edge index map, and one can be
supplied either in the form of an interior property or an external
property map.
Auto index property maps are external property maps that were created
with ease of use in mind. In short, whenever a vertex index map is
expected for the graph g, you can substitute the expression
"make_auto_vertex_index(g)" and everything will work as expected.
Similarly, if an edge index property map is expected, you can use the
expression "make_auto_edge_index(g)" instead. It's my hope that the
auto index property maps will provide a quick solution to those
looking to get started with the BGL who aren't yet worried about
delving into the details of working with internal properties, which
seems to be a difficult issue for a lot of beginners. Auto index
property maps can be used while prototyping and replaced later with
interior properties if efficiency is an issue.
Any feedback would be most appreciated. I've tested everything with
gcc 3.4.4 on cygwin.
Aaron
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk