[vtkusers] Bug in vtkBoostPrimMinimumSpanningTree?

David Thompson dcthomp at sandia.gov
Wed May 26 21:00:47 EDT 2010

>>> ...
>>> I like the SetNumberOfVertices() idea, it would indeed be faster and
>>> use less memory. What I meant was that vtkGraphInternals and
>>> vtkVertexAdjacencyList are not meant to be manipulated directly, but
>>> should be changed by using other vtkGraph API.
>> What would the semantics of SetNumberOfVertices() be? Should it
>> just adjust the GraphInternals->Adjacency ivar or should it also
>> try to allocate memory for vertex point coordinates? Also, I'm
>> unfamiliar with the distributed graph helper class, but it sounds
>> like some attention should be paid to how SetNumberOfVertices
>> works in parallel.
> The convention is that AddVertex() does not change the size of the
> points or vertex attribute arrays; that is assumed to be managed
> separately. So I would think SetNumberOfVertices() could act the same
> way. BTW, the points can remain NULL in a graph and be made on demand
> the first time GetPoints() is called.
> For distributed graphs (if the distributed helper is not NULL) I think
> it should just produce an error that says the operation is not
> supported on distributed graphs.

OK, I've implemented SetNumberOfVertices as described above and  
checked it in. I also modified the Prim MST to use it. Unlike other  
SetXXX() commands, this one returns a number since it could fail if  
there is a distributed graph helper. As a side effect, the Prim MST  
filter will now fail if passed a distributed graph.


More information about the vtkusers mailing list