# Find a path between an origin and destination given scattered points

We have a postgis database containing a lot of ordered (by date/time) nautical point (lat/long). Each of these points are affected to a leg between an origin and a destination (both origin and destination are on a coast).

Based on this we are trying to find every possible paths (hopefully only one in most case) for each origin/destination combination (several legs for a given combination), do anyone know if there already exists some sort of algorithm/function that does this ?

EDIT: "affected to a leg" means that we can map every point we have to a combination origin-destination (so for instance we know that Px (-122°, 85°) has been passed by a vessel doing the voyage between origin A and destination B). What we are tying to do is find the possible geographical path between A and B based on the positions we know have been visited by vessels doing this voyage.

• Can you explain what you mean by "affected to a leg"? It sounds like you might be after a variation of the travelling salesman algorithm but it is difficult to know for sure. It is possible your problem is considerably simpler? Sep 24, 2014 at 16:09
• Do the points have some kind of vessel ID attached to them Sep 25, 2014 at 10:34
• Yes they do have a vessel attached to them Sep 25, 2014 at 13:37
• There was a question about finding routes on the sea couple of months ago but I can't find it right now. Sep 25, 2014 at 18:05