Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (2024)

Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (1)

4 min read

·

Jun 13, 2019

--

Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (2)

How does Google Maps find the directions?

Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (3)

These popular rideshare apps including Uber and Lyft use Waze, which was bought by Google Maps back in 2013 for a little over a billion dollars. Personally, I use Waze for driving and Google Maps when I’m not.

How do you find the shortest path ?

There are three major shortest path algorithms: Bellman Ford’s Algorithm, Dijkstra’s Algorithm, and Floyd–Warshall’s Algorithm.

Google Map is based on this algorithm, Dijkstra’s Algorithm which was invented by Edsger W. Dijkstra, Dutch essayist DescriptionEdsger Wybe Dijkstra was a Dutch systems scientist, programmer, software engineer, science essayist, and pioneer in computing science. A theoretical physicist by training, he worked as a programmer at the Mathematisch Centrum from 1952 to 1962.

Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (4)

Dijkstra is a greedy algorithm. What is greedy algorithm?

Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. So the problems where choosing locally optimal also leads to global solution are best fit for Greedy.

A greedy algorithm is a simple, intuitive algorithm that is used in optimization problems. The algorithm makes the optimal choice at each step as it attempts to find the overall optimal way to solve the entire problem. Greedy algorithms are quite successful in some problems, such as Huffman encoding which is used to compress data, or Dijkstra’s algorithm, which is used to find the shortest path through a graph.

However, in many problems, a greedy strategy does not produce an optimal solution. For example, in the animation below, the greedy algorithm seeks to find the path with the largest sum. It does this by selecting the largest available number at each step. The greedy algorithm fails to find the largest sum, however, because it makes decisions based only on the information it has at any one step, without regard to the overall problem.

Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (5)

With a goal of reaching the largest sum, at each step, the greedy algorithm will choose what appears to be the optimal immediate choice, so it will choose 12 instead of 3 at the second step and will not reach the best solution, which contains 99.

Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (6)

Dijkstra’s algorithm (or Dijkstra’s Shortest Path First algorithm, SPF algorithm) is an algorithm for finding the shortest paths between nodes in a graph, which may represent, for example, road networks. It was conceived by computer scientist Edsger W. Dijkstra in 1956 and published three years later. The algorithm exists in many variants; Dijkstra’s original variant found the shortest path between two nodes, but a more common variant fixes a single node as the “source” node and finds shortest paths from the source to all other nodes in the graph, producing a shortest-path tree.

  • => => → find the shortest path (minimum cost path)
Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (7)
Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (8)
Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (9)
Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (10)
Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (11)

Work Cited

https://www.myrouteonline.com/blog/what-is-the-best-shortest-path-algorithm

http://math.mit.edu/~rothvoss/18.304.3PM/Presentations/1-Melissa.pdf

https://brilliant.org/wiki/dijkstras-short-path-finder/

https://medium.com/basecs/finding-the-shortest-path-with-a-little-help-from-dijkstra-613149fbdc8e

https://www.hackerearth.com/practice/notes/dijkstras-algorithm/

https://www.hackerearth.com/practice/algorithms/graphs/shortest-path-algorithms/tutorial/

https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/graph/dijkstra

https://www.google.com/search?q=waze+app+algorithm&oq=waze+app+algorithm&aqs=chrome..69i57.4903j0j1&sourceid=chrome&ie=UTF-8

https://rubygarage.org/blog/how-to-make-a-gps-app-like-waze

https://www.quora.com/What-routing-algorithm-does-Waze-use

https://wiki.waze.com/wiki/Routing_server#Routing_algorithm_refinements

https://www.google.com/search?q=Greedy+algorithm&oq=Greedy+algorithm&aqs=chrome..69i57.233j0j1&sourceid=chrome&ie=UTF-8

Dijkstra Algorithm: Key to Finding the Shortest Path, Google Map to Waze (2024)
Top Articles
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 6169

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.