Skip to main content
Question

Does the ShortestPathFinder work out an optimal route considering other start points, or is each route generated independent of others?


Does the SHortestPathFinder consider all FROM-TO routes when generating routes or does it calculate a route for each input? I'd ideally want the generated routes to produce the lowest overall length, where routes that join together are preferred to routes that find their own path. For example if I've got two residential areas and I want to generate a route from these to the city centre, using the shortest path finder may generate two separate routes for these areas, but I want them to converge on a road almost like rivers draining a catchment. SO I'd prefer routes to converge if possible

9 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

Each From-To line you put in the ShortestPathFinder is considered separately, but you can have it find an optimal order for the intermediate points within a single line (the Travelling Salesman problem).

However... depending on your network cost and the transformer settings, I would expect it to merge routes anyway if that is the most optimal routing. I think your wish to get the lowest overall length kinda contradicts your wish to merge routes.


  • Author
  • May 31, 2019
redgeographics wrote:

Each From-To line you put in the ShortestPathFinder is considered separately, but you can have it find an optimal order for the intermediate points within a single line (the Travelling Salesman problem).

However... depending on your network cost and the transformer settings, I would expect it to merge routes anyway if that is the most optimal routing. I think your wish to get the lowest overall length kinda contradicts your wish to merge routes.

Thanks for the response. I would like to find a way for the shortest path finder to generate routes so that there is a lowest total length (where joining onto another route adds no extra distance onto the cumulative count) - which doesn't seem possible if the ShortestPathFinder calculates routes in isolation of other routes


ebygomm
Influencer
Forum|alt.badge.img+33
  • Influencer
  • May 31, 2019
em_fme wrote:

Thanks for the response. I would like to find a way for the shortest path finder to generate routes so that there is a lowest total length (where joining onto another route adds no extra distance onto the cumulative count) - which doesn't seem possible if the ShortestPathFinder calculates routes in isolation of other routes

I think you may need to illustrate what you mean. A route is either the shortest route or it isn't.

You can choose to calculate using a weighting instead of an absolute shortest route, but I can't really picture exactly what you are after.


  • Author
  • May 31, 2019
ebygomm wrote:

I think you may need to illustrate what you mean. A route is either the shortest route or it isn't.

You can choose to calculate using a weighting instead of an absolute shortest route, but I can't really picture exactly what you are after.

Please forgive the dreadful paint sketch, but I think it helps explain what I'm trying to do. The red points are start points, the black triangle is the destination. The road network is visible in the background.

The black line is the optimal "network" I want to achieve for these points. The orange lines show the routes of shortest distance between the start points and the destination for a few points which would produce a different path to the black. The shortestpathfinder would output the orange paths for these points.

So as you can see the start points on the far left would produce a smaller "network length" if they followed the black line, but would have a shorter path if they followed the orange line.

The start point with blue arrows has a roughly equal distance to the destination if it goes left along the black or right along the orange. In the circumstance like this I would see a more optimal route being the black because this would result in the lower overall network length and would also open up a shorter overall network route for the start point to its right (which would normally go along the orange path as it is a shorter distance).

So what I'm getting at is I want a way for the routes to be calculated so they produce an optimal network length rather than each route having the shortest possible length

 


redgeographics
Celebrity
Forum|alt.badge.img+49

Right, if you connect all the start points and the end point to a single line and tell the ShortestPathFinder to change the order of the points if necessary you will get something that is close, but not quite, what you’re looking for.

 

On the other hand, of you calculate all shortest paths and then run them through a stream order calculation you might get closer (can’t test that right now, no FME at home)


  • Author
  • May 31, 2019
redgeographics wrote:

Right, if you connect all the start points and the end point to a single line and tell the ShortestPathFinder to change the order of the points if necessary you will get something that is close, but not quite, what you’re looking for.

 

On the other hand, of you calculate all shortest paths and then run them through a stream order calculation you might get closer (can’t test that right now, no FME at home)

Thanks for your help, I'll give this a try :)


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • May 31, 2019
em_fme wrote:

Please forgive the dreadful paint sketch, but I think it helps explain what I'm trying to do. The red points are start points, the black triangle is the destination. The road network is visible in the background.

The black line is the optimal "network" I want to achieve for these points. The orange lines show the routes of shortest distance between the start points and the destination for a few points which would produce a different path to the black. The shortestpathfinder would output the orange paths for these points.

So as you can see the start points on the far left would produce a smaller "network length" if they followed the black line, but would have a shorter path if they followed the orange line.

The start point with blue arrows has a roughly equal distance to the destination if it goes left along the black or right along the orange. In the circumstance like this I would see a more optimal route being the black because this would result in the lower overall network length and would also open up a shorter overall network route for the start point to its right (which would normally go along the orange path as it is a shorter distance).

So what I'm getting at is I want a way for the routes to be calculated so they produce an optimal network length rather than each route having the shortest possible length

 

Hi @em_fme From your paint sketch it looks like you might want to try the RMinimumSpanningTree transformer. See https://www.safe.com/blog/2017/09/minimum-spanning-tree-evangelist167/ and https://hub.safe.com/publishers/lizsanderson/transformers/rminimumspanningtree


  • Author
  • June 3, 2019
fmelizard wrote:

Hi @em_fme From your paint sketch it looks like you might want to try the RMinimumSpanningTree transformer. See https://www.safe.com/blog/2017/09/minimum-spanning-tree-evangelist167/ and https://hub.safe.com/publishers/lizsanderson/transformers/rminimumspanningtree

Thanks, this looks perfect


  • Author
  • June 3, 2019
fmelizard wrote:

Hi @em_fme From your paint sketch it looks like you might want to try the RMinimumSpanningTree transformer. See https://www.safe.com/blog/2017/09/minimum-spanning-tree-evangelist167/ and https://hub.safe.com/publishers/lizsanderson/transformers/rminimumspanningtree

Can this be constrained to a network? Looks like it connects points but not along network lines?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings