I am still having a problem with the minimum spanning tree claiming that it is a forest. I wrote a big function to connect the graph so now (according to my code, which I suppose could have a bug) every vertex can be reached from any vertex - but the MST still claims it is a forest...<br>
<br>I then tried to write out the graph so I could visualize it and see if there are any apparent disconnected regions. I did the following:<br><br> vtkSmartPointer<vtkCircularLayoutStrategy> circular = vtkSmartPointer<vtkCircularLayoutStrategy>::New();<br>
<br> vtkSmartPointer<vtkGraphLayout> GraphLayout = vtkSmartPointer<vtkGraphLayout>::New();<br> GraphLayout->SetInput(G);<br> GraphLayout->SetLayoutStrategy(circular);<br> GraphLayout->Update();<br>
<br> vtkSmartPointer<vtkGraphToPolyData> GraphToPolyData = vtkSmartPointer<vtkGraphToPolyData>::New();<br> GraphToPolyData->SetInput(GraphLayout->GetOutput());<br> GraphToPolyData->Update();<br>
<br> vtkSmartPointer<vtkXMLPolyDataWriter> Writer = vtkSmartPointer<vtkXMLPolyDataWriter>::New();<br> Writer->SetInput(GraphToPolyData->GetOutput());<br> Writer->SetFileName("SphereGraph.vtp");<br>
Writer->Write();<br><br>This produces this file:<br><a href="http://www.rpi.edu/~doriad/VTK_List/SphereGraph/SphereGraph.vtp">http://www.rpi.edu/~doriad/VTK_List/SphereGraph/SphereGraph.vtp</a><br><br>That doesn't look particularly helpful to me... is there supposed to be a way to interpret this? I'm not sure what GraphLayout does, the docs said that GraphToPolyData needed the points to be added by vtkGraphLayout. I actually already have a point for each graph node - is there a way I can add the actual points so the graph looks like the input point set that I created the graph from?<br>
<br clear="all">Thanks,<br><br>David<br>