"How Google Maps Calculates the Best Routes: A Graph Algorithm Insight"

Welcome, everyone, to my post after a long time. I hope you are all doing well. Despite my intentions, I couldn’t post anything due to studies and various other commitments, for which I sincerely apologize. From now on, I’ll try to stay updated with “Local Guides Connect” as it evolves.

For a while, a thought has been on my mind: When we look for directions on Google Maps from one place to another, it shows all the possible routes to reach the destination. Many of us might not know how this system works. I believe it’s crucial to think like a “developer” while being a “user.” This can significantly expand our knowledge.

The direction feature in Google Maps is primarily based on “graph” algorithms in computer science. Here, the destination points are considered “nodes,” and the distance between these nodes is called “edges.” The distance from one node to another is referred to as a “route or path.” Using the ‘Dijkstra’ algorithm, Google Maps determines the “Shortest Path” and suggests the easiest and shortest route to reach a destination. Let’s try to understand this better with an example.

In the above image, my current location is Binodpur in Rajshahi city, and I’m looking for directions to Saheb Bazar Zero Point. Google Maps shows two routes:

  1. Binodpur → Talaimari → Hadir Mor → Alupotti → Zero Point
  2. Binodpur → Talaimari → Northern Mor → Tikapara → Sagorpara → Ranibazar → Zero Point

The first route is considered ideal as it shows a probable time of 18 minutes via Talaimari-Hadir Mor, while the second route takes 22 minutes via Tikapara-Ranibazar. Therefore, Google Maps suggests Talaimari → Hadir Mor as the preferred route.

However, there is another way to get from Binodpur to Zero Point:
Binodpur → Talaimari → Vodra→ Rail Gate → New Market → Zero Point

Google Maps hasn’t included this route in its suggestions. This is because technology aims to make our lives easier, not more complicated. I’ve tried to explain the matter from my limited knowledge. If you find any mistakes, feel free to comment. Thank you, everyone!

14 Likes

I always use google maps roads with this pertan thinking in mind. However, in some cases, we reach our destination with more road distance, it is only subject to our own needs.

Welcome to Connect @ashik9840 Bhai. I hope to hear new ideas and stories of new experiences from you, inshallah.

2 Likes

It might be worth mentioning the route options found under Navigation settings in Google Maps:

2 Likes

Thanks for the information @ashik9840

1 Like

Welcome brother! Your valuable feedback will motivate me to share something new in the future.:smiling_face_with_three_hearts::smiling_face_with_three_hearts::smiling_face_with_three_hearts:

2 Likes

@ashik9840 This may form the basis for the initial routing, but Maps does a lot more than check the road network. It looks at traffic that is both happening now and is predicted as you reach each spot. It looks at the type of transport you’ve asked for. It looks at hazards and other reported conditions and as @MortenCopenhagen points out it does not by default take the quickest, it takes the most efficient.

1 Like