
On Tue, 7 Jul 2009, Sandeep Gupta wrote:
On Tue, Jul 7, 2009 at 8:21 AM, Andrew Sutton <andrew.n.sutton@gmail.com>wrote:
Thanks Andrew, I got confused with add_vertex and add_edge allocation properties. I have modified the code create numEdges. However the problem occurs while building component_index which does not access graph data structure but rather only the parent map. Attached is the modified file (also at http://codepad.org/5dZM6YBo).
I get confused too. I didn't write the class, so it's hard to remember. Just a heads up, though. The adjacency class has a constructor that takes a number of vertices and pre-allocates them. For example:
graph g(20); cout << num_vertices(g); // prints 20.
Hi Andrew, Got it. Back of my mind, I think I was uncomfortable about conversion from int to vertex_descriptor. The final status is that Jeremiah verified that the code runs fine on gcc over the large input. Hence its quite possible a bug, and should be filed as such.
Just a minor thing -- Valgrind did show a buffer overrun in the code, and I added asserts and showed that it writes beyond the end of a temporary array, so it is definitely a bug in component_index.
He suggested a workaround i.e. use ds.compress_sets() and then collect the component. So my problem is resolved.
I also have issues with the documentation of incremental component which I shall post separately.
I would appreciate any comments on that you have. They should be a separate ticket from the component_index one, though. -- Jeremiah Willcock