[vtkusers] Bug in vtkBoostPrimMinimumSpanningTree?

Thompson, David C dcthomp at sandia.gov
Fri May 21 12:48:18 EDT 2010

> I indeed introduced a bug when I made the following change:
> ...
> The correct fix is to add the loop back in, but just perform the
> AddVertex(), not the CopyData(). This does the same thing as David T's
> fix, but in a less hackish way. I've published the fix, let me know if
> there are further issues.

Nope, that fixes it for me. Thanks.

I do have a question (not a criticism): you say what I did was more
hackish but couldn't it also be faster and end up using less memory?
By calling AddVertex once for each of N vertices, the STL container is forced
to reallocate log(N) times and will end up allocating 2**(floor(log2(N))+1)
entries instead of exactly N entries. If that could be a significant problem,
would it be a good idea to add a call like "SetNumberOfVertices" to the
mutable graph classes?


More information about the vtkusers mailing list