<br><br><div class="gmail_quote">On Mon, Oct 26, 2009 at 3:23 PM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Is there anything in place to prevent adding the same edge twice? That<br>
is, if I do this:<br>
<br>
vtkMutableUndirectedGraph* G = vtkMutableUndirectedGraph::New();<br>
  vtkIdType V1 = G-&gt;AddVertex();<br>
  vtkIdType V2 = G-&gt;AddVertex();<br>
  G-&gt;AddEdge ( V1, V2 );<br>
  G-&gt;AddEdge ( V1, V2 );<br>
<br>
There will now be two edges between V1 and V2. Some algorithms do not<br>
allow this. Is there a flag anywhere to disallow these duplicate<br>
edges? Or would I have to get all the edges of V1 and check if any of<br>
their Destinations are V2 manually every time before adding an edge?<br><br></blockquote><div><br></div><div>No, there is no flag to do this. The solution you suggest is the best I can think of also.</div><div><br></div>
<div>Jeff</div><div> </div></div>