Boost logo

Boost Users :

From: Nicola Vitacolonna (vitacolo_at_[hidden])
Date: 2005-08-22 05:35:11

I need to implement a graph whose set of vertices is partitioned into
a certain number of ordered subsets (called layers). Edges join
vertices from a layer to the next one(s). A critical operation is the
iteration over the nodes of a given layer.

I think this can be implemented by adding a vertex property to each
vertex, that specifies the layer each vertex belongs to. But this
does not seem to me the most (time and space) efficient solution: in
particular, how can I iterate over the nodes of a given layer without
checking every node?

I was wondering whether there is a better way to do the job: maybe,
using a custom VertexList implemented using a vector for each layer
(in this case, should I write my own functions to add/remove
vertices? And should I write my own iterators?). Any other idea, or
pointer to existing code (I am new to Boost)?

Best regards
Nicola Vitacolonna

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at