Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Time to show LayeredLayout becomes huge (Read 4144 times)
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Time to show LayeredLayout becomes huge
May 27th, 2007 at 1:26pm
Print Post  
Something weird happens when I try to arrange a graph with LayeredLayout.
I've created a chart with random boxes and connections.
I've set the number of boxes to 4000 and the number of connections to 2000. After running 5 times, the average running time was 5 seconds.
I've changed the number of connections to 3000. Suddenly runnnig time became 444 seconds and 548 seconds!
It sounds right that with high number of connections the time will rise, but rising from 5 sec. to 400 sec.? Is there anything to do about it?
Thanks,
Yoav
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Time to show LayeredLayout becomes huge
Reply #1 - May 27th, 2007 at 1:30pm
Print Post  
Sorry I put that on Feature Suggestions by mistake...  Tongue
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Time to show LayeredLayout becomes huge
Reply #2 - May 27th, 2007 at 6:00pm
Print Post  
The algorithm spends most time trying to decrease the arrow crossings, where it checks each pair of arrows for crossings, and for each crossing it runs a loop where node pairs are swapped until the crossing disappears. I guess that makes the algorithm complexity at least O(arrows^3) or O(arrows^4). So as the number of arrows increases, the amount of crossings processing increases much faster.

We can't do anything to decrease the algorithm complexity at this time, but could let you decrease the number of crossing processing iterations. Currently it is hard-coded to 4, so we can make it a public property and let you set it to 1, which should decrease the processing time to ~150 seconds in the 4000x3000 case.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Time to show LayeredLayout becomes huge
Reply #3 - May 28th, 2007 at 6:30am
Print Post  
I see. That's one tough algorithm...  Smiley
Never mind the change of parameter, 150 seconds are still too much. I understand the complexity so I will look for other ways (maybe filtering out some of the boxes).
Thanks!
Yoav
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint