[boost-users]_BGL:_copy_component_bugs
Hi. 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
participants (1)
-
Erik Jenelius