I have searched on how Google or any map provider calculates distance between two coordinates. The closest I could find is Haversine formula.
If I draw a straight line between two points, then Haversine formula can be helpful. But since no one will travel straight and typically move through the streets, I want to know if there are any methods to calculate turn by turn points and see how to find multiple ways to travel to the destination from the source.
Right now my idea is
- Have the two coordinates within a map window.
- Make an algorithm detect the white lines (path) in the window.
- Make it understand how they are connected.
- Feed it to an algorithm to solve the Travelling Salesman Problem to find the best path between them.
But these things see very memory and process intensive. Even with the knowledge that Google has the powerhouse to process, to serve so many directions and distance matrix in fractions of seconds in amazing. I want to know if there are different approaches to this?