Shortest Path in an Unweighted Graph Using BFS
Shortest path algorithms are designed to find the minimum cost path between two nodes in a graph.
For example, a shortest path algorithm can be used to find the fastest route between two places or the minimum number of connections required to reach one point from another.
An unweighted graph is a graph in which all the edges are of same cost. Therefore, the shortest path is simply the path with the minimum number of edges.
The easiest way to find the shortest path in an unweighted graph is by using BFS (Breadth First Search).
Before going ahead, you can have a look at Graph Basics if you are not familiar with graph representation..