Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Layout Slow with large amount nodes/Links (Read 2221 times)
rnpayet
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Nov 14th, 2011
Layout Slow with large amount nodes/Links
Jul 18th, 2012 at 2:01am
Print Post  
Hi
we are having issue laying out  when we have huge amount of nodes and links in the diagram.
We use are mainly using Spring Layout (200 iteration) and Annealing .
Anything above 300 nodes takes far too long to load - More than 5 min.

* Any tips/ strategy on how to optimize Layout?

* Are there any other layout algorithm that is good for large node samples?

regards

Ryan
 
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layout Slow with large amount nodes/Links
Reply #1 - Jul 18th, 2012 at 9:24am
Print Post  
Hi,

If your graph contains several connected components (subgraphs without links between each other), you can speed these layouts up by setting their SplitGraph property to true. This will arrange each subgraph separately and should be faster since these force-directed algorithms run in polynomial time; running an O(n^3) algorithm three times on 100 nodes is much better than running it once on 300 nodes.

If there are no separate subgraphs but you can divide the graph easily by removing some key links, you can remove them temporarily to allow for SpltGraph to split the graph into several components; setting the IgnoreLayout property of these links should work too. Alternatively, you can run CompositeLayout specifying some smaller subgraphs as custom partitions.

You could also try LayeredLayout with EnforceLinkDirection and StraightenLongLinks properties enabled. Running it with these settings and random graphs of 300-400 nodes in the LayeredLayout sample project takes about 5 seconds on my system.

Finally, if you graphs are trees, use TreeLayout or FractalLayout algorithms - they run in almost linear (O(n)) time. Even if they aren't trees, you might still try using them with some additional processing of non-tree links.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
rnpayet
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Nov 14th, 2011
Re: Layout Slow with large amount nodes/Links
Reply #2 - Jul 19th, 2012 at 8:59pm
Print Post  
Thanks
I will give those suggestion a go.

Do you have any sample/example on how to use composite Layout?


regards

Ryan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layout Slow with large amount nodes/Links
Reply #3 - Jul 20th, 2012 at 9:05am
Print Post  
In most simple form, CompositeLayout can be set up like this:

Code
Select All
private void miLayoutComposite_Click(object sender, EventArgs e)
{
	CompositeLayout cl = new CompositeLayout();
	cl.MultipleGraphsPlacement = MultipleGraphsPlacement.MinimalArea;
	cl.DesiredSubgraphSize = 10;
	cl.MasterLayout = new AnnealLayout();
	cl.SubtreeLayout = new TreeLayout(TreeLayoutType.Radial);
	cl.SubgraphLayout = new CircularLayout();
	cl.Arrange(diagram);
} 



If your graph contains some sort of clusters (e.g. employees in the same company division), you can specify them as custom partitions as shown in the CompositeLayout sample project, so that each cluster's nodes are laid out together. Otherwise the control will try to divide the graph into partitions based on DesiredSubgraphSize and the lengths of paths between nodes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint