Thanks. I will try that.<br><br>I tried a similar strategy in Graphviz, but it seems to me from the layout (i didnt look at the code yet)- that its treating the "invisible" edges as real edges. And so attractive forces are computed between all pairs of nodes, rather than only neighbours (nodes connected by real edges) as per the Fruchterman-Reingold FDP strategy. So its producing a graph with many edge crossings. Hope that it doesnt happen with vtk as well.<br>
<br>Amina<br><br><div class="gmail_quote">On Mon, Oct 25, 2010 at 10:08 AM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com">aashish.chaudhary@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I don't remember on top of my head if there is an easy way to do this.<br>
But one way you could have this by having virtual edges, assign the<br>
weight / distance as Eric suggested and have another array for<br>
visibility (0 or 1) lets say which can be used for opacity. So all the<br>
virtual edges could be assigned visibility = 0.<br>
<br>
Hope this helps,<br>
Aashish<br>
<div><div></div><div class="h5"><br>
On Mon, Oct 25, 2010 at 10:02 AM, Amina Shabbeer<br>
<<a href="mailto:aminashabbeer@gmail.com">aminashabbeer@gmail.com</a>> wrote:<br>
> Yes, Im sorry I should have specified. I need to specify weights/distances<br>
> between nodes that are not connected by edges as well. I can use the edge<br>
> weight strategy for neighbours, but what do I do for nodes not connected by<br>
> edges?<br>
><br>
> thanks,<br>
> amina<br>
><br>
> On Mon, Oct 25, 2010 at 8:46 AM, David Doria <<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>> wrote:<br>
>><br>
>> On Mon, Oct 25, 2010 at 8:39 AM, Eric E. Monson <<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>><br>
>> wrote:<br>
>> ><br>
>> > Hello Amina,<br>
>> ><br>
>> > The graph layout strategies (at least the force-directed types I'm<br>
>> > familiar with) work with the concept of an edge "weight" instead of a<br>
>> > distance. So, because a strong weight would tend to end up as a short<br>
>> > distance after the layout, you might be able to get your desired results by<br>
>> > inverting your distances to make weights. I hope you realize, though, that<br>
>> > it's impossible to flatten an arbitrary graph into 2D while specifying all<br>
>> > of the node-node distances, so some of the spacings may not end up exactly<br>
>> > as you hope.<br>
>> ><br>
>> > One way to construct the graph is to create a table with three columns.<br>
>> > The first two contain indices that specify which vertices edges will run<br>
>> > between, and the third column is the edge weight. Then, use vtkTableToGraph<br>
>> > to create the graph (and the graph edges will contain the weight). If column<br>
>> > 1 is called "index1", and column 2 is called "index2" (and column 3 is<br>
>> > called "weight"), you would run something like (this is Python):<br>
>> ><br>
>> > tgraph = vtk.vtkTableToGraph()<br>
>> > tgraph.SetInput(table)<br>
>> > tgraph.AddLinkVertex('index2', 'stuff', False)<br>
>> > tgraph.AddLinkVertex('index1', 'stuff', False)<br>
>> > tgraph.AddLinkEdge('index2', 'index1')<br>
>> ><br>
>> > Other examples are linked from the doc page:<br>
>> > <a href="http://www.vtk.org/doc/nightly/html/classvtkTableToGraph.html" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkTableToGraph.html</a><br>
>> ><br>
>> > Hope this helps get you started,<br>
>> > -Eric<br>
>><br>
>><br>
>> I believe Amina is looking to also specify distances between vertices<br>
>> that do not have an edge between them:<br>
>><br>
>> > "given distances between all pairs of nodes"<br>
>><br>
>> Is that correct Amina?<br>
>><br>
>> David<br>
><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
| Aashish Chaudhary<br>
| R&D Engineer<br>
| Kitware Inc.<br>
| <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
</font></blockquote></div><br>