TITLE: Is Dijkstra's algorithm optimal for unweighted graphs?
QUESTION [10 upvotes]: Dijkstra's algorithm is a very good approach to the shortest path problem. But is it optimal? Are there better algorithms for unweighted graphs?

REPLY [3 votes]: For unweighted graphs you can use a simple Breadth-first Search to solve the problem in linear time.
While traversing the graph in a BFS manner, you can calculate and store the minimal distance from the source for each visited vertex. Particularly:

dist(Source) = 0
visiting a yet unvisited edge A->B implies that dist(B) = dist(A) + 1

https://en.wikipedia.org/wiki/Breadth-first_search#Applications