Dijkstra’s algorithm is primarily used to find the shortest path from a starting node to all other nodes in a weighted graph.