0

I have a list of routing instructions generated by some routing service (MapBox, GraphHopper, ...). The instructions are basically a list where each instruction is a vertex of the full directed path :

<instruction>, <lat, lon>, <distance to next>
// e.g. "turn left", <41.4, 12.33>, 1km
// e.g. "turn slightly right", <41.5, 12.33>, 0.5km

The user is located somewhere on the path between two vertices (instructions). Now I want to display the user the current instruction based on the current GPS location.

A naive approach would be to display the closest not-visited instruction but I am sure there are much better algorithms for this which, for instance, also take the movement history into account. I tried to search for algorithms but probably with the wrong search terms.

What algorithms are best suited for this scenario?

Regards,

Hyndrix
  • 4,282
  • 7
  • 41
  • 82
  • 1
    If you search for "route finding" or "path finding" you will get many, many hits see also https://en.wikipedia.org/wiki/Pathfinding The subject is complex and many solutions are problem domain specific. The problem description is lacking details eg how does movement history affect the chosen route, do different paths have a different cost, is there an upper cost bound etc ? – Richard Critten Sep 07 '21 at 11:29
  • I have added some more details to my question. But probably the easiest solution is to just use the instruction with the shortest distance. – Hyndrix Sep 07 '21 at 14:47

0 Answers0