I’m developing an iOS application that needs to determine the probability that a user is following a given path.
If they are not following the path, I’d like to give them the option to recalculate.
This should be a relatively simple algorithm, for inputs I have a location (x,y) and n paths (two x,y points).
What is the best way to do this?
You might look at Dijkstra’s algorithm to find shortest distance between two points? What I think is you should always feed the current location of vehicle as it will show the recalculated value if taken a wrong turn and show it in graph. Hope it helps.