Boost logo

Boost Users :

From: Erik Jenelius (jenelius_at_[hidden])
Date: 2004-08-13 07:38:43


In boost/graph/copy.hpp, besides the copy_graph function, I noticed a nice,
undocumented function called copy_component which uses breadth-first search
to copy a component from a graph to a new graph. Unfortunately, it doesn't
work. I think there are at least two bugs in it:

1. The vertices are copied at the examine_vertex event point and the edges
are copied at the examine_edge event point. However, the target of the edge
has not yet been examined at that point, which leads to strange results. If
the edges are copied at the black_target event point instead, the algorithm
seems to work correctly.

2. The std::vector orig2copy is templated on the vertex descriptor type of
the input graph, while it should be the output graph. The function
copy_graph is correct here.

Also, both copy_graph and copy_component by default assume the vertices
have a vertex_all property and the edges an edge_all property, which are
copied to the output graph. Wouldn't it be more intuitive to not assume and
copy any properties by default?

- Erik Jenelius

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