Best Online Learning Platform

CS502-Designs and Analysis of Algorithms GDB Solution 2020-2021

Posted By:



CS502-Designs and Analysis of Algorithms GDB Solution 2020-2021

Dijkstra’s algorithm also known as SPF algorithm (Shortest Path First algorithm) is the most reasonable algorithm for the given scenario that to find the shortest distance between two points “Karachi” and “Hunza” as per the give scenario. I quote the following reasons to justify my answer.

  1. It is the simplest algorithm to find single shortest distance between two nodes on graph by modeling the nodes as roads on map. In our case two nodes are “Karachi” and “Hunaz”.
  2. It is used in Google Maps.
  3. The Bellman-Ford algorithm is slower than Dijkstra’s algorithm
  4. Floyd-Warshall algorithm is being used when there is need to compute the shortest paths among all pairs of vertices or nodes; therefore, it is not fit to the prevailing scenario.
  5. It only calculate the shortest path between Karchi and Hunza, and stop calculating other meanwhile Breadth-First-Search complete the computation of cycle to reach the shortest path which consume time that not fit to the given scenario.


hey oy

Sharing is Caring


Leave a Reply

Your email address will not be published. Required fields are marked *