- From: Yoann Pigné <yoann.pigne AT gmail.com>
- To: graphstream-users AT litislab.fr, youri flement <youri.flement AT ugent.be>
- Subject: Re: A few questions about the graph layout algorithm
- Date: Sun, 8 Mar 2015 09:54:17 +0100
Hi Youri,
- The Image "looks" like a normal SpingBox Layout to me.
- Yes, it is normal for the layout to send so much events. Since you are
using the LayoutRunner, you have the layout running in its own thread in a
"kind of" infinite loop. If you want more control over the number of
iterations of the layout and/or the number of events, you could do something
like this in your code:
// Compute the layout in this thread.
// Need a loop with a stop condition of your choice.
while(layout.getStabilization() < 0.9){
layout.compute();
}
// Only plug the sink AFTER the computation of the layout
layout.addSink(this);
// One last computation in order to
// recive one event for each node.
layout.compute();
- About the most performant algorithm, I can't really say. Plus, it depends
on your definition of "performant".
Yoann
>
On Mar 7, 2015, at 9:03 PM, youri flement
>
<youri.flement AT ugent.be>
>
wrote:
>
>
Hello,
>
>
>
I'm sorry this is in English, my French is not that good...
>
>
I'm trying to integrate the GraphStream SpringBox layout algorithm in an
>
application I'm developing for school and I have a few questions:
>
>
• Is the image attached a valid rendering of a connected graph with 3
>
edges using this layout algorithm? (I had to alter the coordinates a bit
>
because I only received x- and y-values between 0 and 1)
>
• Is it normal for the layout algorithm to sent a very high amount of
>
events, even for small graphs? (for example, the rendering above gave me
>
771 nodeAttributeChanged events)
>
• Which is the most performant algorithm: LinLog or SpringBox?
>
>
>
Kind regards,
>
Youri
>
>
>
>
PS. This is somewhat how I'm using the layout algorithm:
>
>
public MyClass() {
>
SpringBox layout = new SpringBox();
>
layout.addSink(this);
>
>
layout.nodeAdded("0", 1000, "a");
>
layout.nodeAdded("0", 2000, "b");
>
layout.edgeAdded("0", 3000, "aToB", "a", "b", true);
>
>
LayoutRunner runner = new LayoutRunner(layout, layout);
>
}
>
>
@Overide
>
public void nodeAttributeChanged(...) {
>
// adjust position of the changed node
>
}
>
>
<SmallGraph.png>
Archives gérées par MHonArc 2.6.16.