Skip to content

Dijkstra Algorithm

Soumya Sharma edited this page Jul 24, 2020 · 3 revisions

Dijkstra Algorithm

Dijkstra’s Algorithm works by visiting vertices in the graph starting with the object’s starting point. It then repeatedly examines the closest not-yet-examined vertex, adding its vertices to the set of vertices to be examined. It expands outwards from the starting point until it reaches the goal. Dijkstra’s Algorithm is guaranteed to find the shortest path from the starting point to the goal, as long as none of the edges has a negative cost.

File code

Clone this wiki locally