Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Performance vs Link routing (Read 4607 times)
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Performance vs Link routing
Feb 24th, 2009 at 8:20pm
Print Post  
Hi!

As a result of my previous posts (Links and Performance), I am a bit mixed up.

I need to be able to load my diagram quickly (the bottle-neck is routeLinks) and to have clear links. To improve the routing speed, you suggested me to use a big RoutingOptions.GridSize (40 is good enough). It seemed to work for a while, but now I realized that the visual result is not good enough. To have clear links (I need to be able to follow the links' paths easily), I need to have a small grid size (5). However, this slows down the loading speed. I just need to make sure that my links end & start orientation are always horizontal (under all circumstances without any exception). I made a little user interface to help me play with the different parameters (a bit like the one in the Routing sample, but with more options).

In order or importance, I would need:
  • Horizontal start & end links.
  • Links that do not follow the same path (if two links are on the exact same line we end up loosing track of what goes where).
  • Links that do not cross nodes.

I do not understand exactly how the priorities work regarding routing. Is there a way I can respect the previous 3 rules in that order and remove every other rules to have good performance? I already found that LinkStyle.Cascading seem to work better, but I do not know how to enforce/use RoutingOptions.StartOrientation & RoutingOptions.EndOrientation...

Thanks Cheesy
Marie
« Last Edit: Apr 30th, 2009 at 8:20pm by marie »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Performance vs Link routing
Reply #1 - Feb 26th, 2009 at 11:24am
Print Post  
Hi Marie,

Cascading links work better because the CrossingCost is applied only to them. I suppose the problem with links not starting horizontally is the one you showed before where two links go our from the same point? This happens because NodeVicinityCost overrides the crossing/overlapping costs. For this to work better, we would have to implement some additional handling for links when they have common end points. Until that's available, you could implement some post-routing step that sets the coordinates of the end segments of such links as you need them (by changing the coordinates of the two or three points at the beginning and end of ControlPoints).

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



Posts: 147
Joined: Nov 11th, 2008
Re: Performance vs Link routing
Reply #2 - Feb 26th, 2009 at 1:32pm
Print Post  
Hi Stoyan,

I will do that Smiley. However, it is not the worst case. When I have only 1 outgoing link on an anchorpoint (which is almost always the case), the line often starts vertically, following the node's boundaries. It results in totally mixed up links. If I reduce the grid size significantly, the speed is bad but the display is good. I will send you screenshots by email to show you.

Thanks a lot,
Marie

p.s. My RoutingOptions:
  • Anchoring = Keep
  • Crossing cost = 4
  • End & start orientation = Horizontal Wink
  • Grid size = 40 (for good results: 5)
  • Length cost = 2
  • Node vicinity cost = 2
  • Node vicinity size = 48
  • Turn cost = 4
  • Don't optimize long routes = true
  • Smart polyline ends = true

My Diagram options (related to links):
  • Link style = Cascading
  • Link cascade orientation = Auto
  • Links crossing = Straight
  • Rounded links radius = 10
  • Crossing radius = 4
  • Links snap to border = false
  • Dynamic links = false
  • Rounded links = true
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Performance vs Link routing
Reply #3 - Feb 27th, 2009 at 7:58am
Print Post  
Hi Marie,

I think what happens in the GridSize40 image is that you get only one routing grid square available between the two tables, which gets occupied by the first link. Then the other links choose to go along the table borders, because the crossing cost that would incur from passing through the already occupied grid square would be higher than the NodeVicinityCost along the border.

What you might try instead of using RouteAll with the same RoutingOptions is to loop over the links and call Route with options that depend on the table distances. E.g. first use the quick-routing RoutingOptions values for links whose nodes are placed further from each other than say thrice the RoutingOptions.GridSize. Next, apply the routing options with which you get best results and call Route for links whose tables are placed closer to each other.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Performance vs Link routing
Reply #4 - Feb 27th, 2009 at 2:35pm
Print Post  
Hi Stoyan,

I will try that and tell you later how it works Smiley. However, I will try to use link.ControlPoints instead to know if the link's start & end are vertical or horizontal. It seems easier and more reliable to use that instead of the nodes' distance. Is there already a method made to tell me that?

Thanks,
Marie
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Performance vs Link routing
Reply #5 - Feb 27th, 2009 at 2:51pm
Print Post  
Hi Marie,

You could compare the points at 0th and 1st positions in ControlPoints: if their X difference is smaller than 0.1f, then the first segment is vertical.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Performance vs Link routing
Reply #6 - Feb 27th, 2009 at 2:53pm
Print Post  
Perfect Wink
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Performance vs Link routing
Reply #7 - Mar 2nd, 2009 at 10:16pm
Print Post  
Hi!

I implemented the special routing for vertical links. I'm actually routing 3 times for 3 different grid sizes. Then, for the few vertical links left, I'm using UpdateFromPoints() to force the start to be vertical even if it doesn't respect the cascading link style. It' all working great. The result is really clear, but there is still a speed issue.

Could you implement a way to specify priorities in routing options (in my case horizontal start links would be on top of the list)? Would that help in making the routing faster?

Thanks
Marie
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Performance vs Link routing
Reply #8 - Mar 3rd, 2009 at 6:36am
Print Post  
Hi,

We could add a property that lets you define the minimum length of the first and last segments of links, and it would always takes precedence over the RoutingOptions costs that now make the links change their direction too soon.

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



Posts: 147
Joined: Nov 11th, 2008
Re: Performance vs Link routing
Reply #9 - Mar 3rd, 2009 at 6:57pm
Print Post  
Hi!

That would be great!!! Grin

Thanks,
Marie
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Performance vs Link routing
Reply #10 - Apr 30th, 2009 at 8:20pm
Print Post  
For your information, this issue is continued at the end of the following post http://mindfusion.eu/Forum/YaBB.pl?board=fcnet_disc;action=display;num=123376652... (look for posts starting on 2009 March 18th).


(I'm writing this just in case someone else has the same problem Wink)...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint