[vtkusers] Disallow multiple graph edges?

David Doria daviddoria+vtk at gmail.com
Mon Oct 26 15:23:18 EDT 2009


Is there anything in place to prevent adding the same edge twice? That
is, if I do this:

vtkMutableUndirectedGraph* G = vtkMutableUndirectedGraph::New();
  vtkIdType V1 = G->AddVertex();
  vtkIdType V2 = G->AddVertex();
  G->AddEdge ( V1, V2 );
  G->AddEdge ( V1, V2 );

There will now be two edges between V1 and V2. Some algorithms do not
allow this. Is there a flag anywhere to disallow these duplicate
edges? Or would I have to get all the edges of V1 and check if any of
their Destinations are V2 manually every time before adding an edge?

Thanks,

David



More information about the vtkusers mailing list