Skip to contentScholarGate
LibraryBookshelfDeskReview StudioAssistant
Sign in
On this page
IntuitionHow it worksWhen to use itStrengths & limitationsCommon pitfallsApplicationsFrequently asked🔒 Read the full methodSourcesRelated methods
Cite this pageSpotted an issue on this page? Report or suggest a fix →
Home›Operations Research›Dijkstra Algorithm
Machine learningGraph Algorithms

Dijkstra Algorithm

Dijkstra Algorithm for Shortest Path · Also known as: Dijkstra's algorithm, shortest path algorithm

Dijkstra's Algorithm, introduced by Edsger W. Dijkstra in 1956, is one of the most fundamental algorithms in computer science for solving the single-source shortest path problem. It finds the shortest path from a starting vertex to all other vertices in a weighted graph with non-negative edge weights.

ScholarGate
  1. Machine learning
  2. v1
  3. 2 Sources
  4. PUBLISHED
Cite this page →
Tools & resources
Download slides
Learn & explore

Read the full method

Members only

Sign in with a free account to read this section.

Sign in

Method map

The neighbourhood of related methods — select a node to explore.

Dijkstra Algorithm
A-star Search AlgorithmBellman-Ford AlgorithmFord-Fulkerson AlgorithmPush-Relabel AlgorithmSimplex Method

When to use it

Apply Dijkstra's algorithm when finding shortest paths in graphs with non-negative edge weights. It is ideal for navigation systems, network routing, and any graph problem requiring optimal paths. Use it for single-source shortest paths to all vertices. For graphs with negative weights, use Bellman-Ford instead. For bidirectional search or heuristic guidance, consider A* algorithm.

Strengths & limitations

Strengths
  • Simple to understand and implement with clear correctness guarantees
  • Efficient with proper data structures: O((V+E)logV) with binary heap, O(V²) with array
  • Optimal for non-negative weight graphs; proves optimality of computed paths
  • Works on both directed and undirected graphs
  • Foundation for numerous extensions and related algorithms
Limitations
  • Cannot handle graphs with negative edge weights
  • Computes shortest paths to all vertices, not just one destination (though can terminate early)
  • Less efficient than A* when heuristic information is available
  • Requires all vertices to be discovered; inefficient for very sparse connectivity

Frequently asked

Why does Dijkstra's algorithm fail on negative weights?

The algorithm assumes that once a vertex is finalized, no shorter path can be found through unvisited vertices. With negative weights, a longer path might later improve when a negative edge is used, violating this assumption.

What data structure should be used for the priority queue?

Binary heaps provide O(logV) operations for both insertion and extraction, resulting in O((V+E)logV) total complexity. Fibonacci heaps achieve O(E+VlogV) but have large constant factors. Arrays work well for small graphs.

How can Dijkstra's algorithm find the path to one specific destination?

Terminate the algorithm as soon as the destination vertex is selected (its distance is finalized), avoiding unnecessary computation. Alternatively, reconstruct the path by maintaining parent pointers during execution.

Can Dijkstra's algorithm be used in undirected graphs?

Yes, undirected graphs can be represented as directed graphs with edges in both directions for each undirected edge, each with the same weight. The algorithm works identically on the bidirectional representation.

Sources

  1. Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. Numerische Mathematik, 1(1), 269-271. DOI: 10.1007/BF01386390 ↗
  2. Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to Algorithms (3rd ed.). MIT Press. ISBN: 978-0-262-03384-8

How to cite this page

ScholarGate. (2026, June 3). Dijkstra Algorithm for Shortest Path. ScholarGate. https://scholargate.app/en/operations-research/dijkstra-algorithm

Related methods

A-star Search AlgorithmBellman-Ford AlgorithmFord-Fulkerson Algorithm

Which method?

Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.

  • A-star Search AlgorithmOperations Research↔ compare
  • Bellman-Ford AlgorithmOperations Research↔ compare
  • Ford-Fulkerson AlgorithmOperations Research↔ compare
Compare side by side →

Referenced by

A-star Search AlgorithmBellman-Ford AlgorithmFord-Fulkerson AlgorithmPush-Relabel AlgorithmSimplex Method

Similar methods

Bellman-Ford AlgorithmA-star Search AlgorithmFord-Fulkerson AlgorithmNetwork Distance AnalysisSimplex MethodPush-Relabel AlgorithmDynamic ProgrammingBetweenness Centrality

Related reference concepts

Shortest Path AlgorithmsGraph AlgorithmsMinimum Spanning TreesGreedy AlgorithmsGraph TraversalRouting Algorithms

Spotted an issue on this page? Report or suggest a fix →

ScholarGate — Dijkstra Algorithm (Dijkstra Algorithm for Shortest Path). Retrieved 2026-07-21 from https://scholargate.app/en/operations-research/dijkstra-algorithm · Dataset: https://doi.org/10.5281/zenodo.20539026
Quick facts
Originator
Edsger W. Dijkstra
Subfamily
Graph Algorithms
Year
1956
Type
algorithm
Related methods
A-star Search AlgorithmBellman-Ford AlgorithmFord-Fulkerson Algorithm
ScholarGate

A content-first reference library for research methods — what each one is, how it works, and where it comes from.

Open data (CC-BY)

Explore

  • Library
  • Search the library…
  • Browse by field
  • Fields
  • Journey
  • Compare
  • Which method?

Reference

  • Subjects
  • Atlas
  • Glossary
  • Methodology
  • Philosophy

Your tools

  • Bookshelf
  • Desk
  • Chat

Company

  • About
  • Pricing
  • Contact
  • Suggest a method

Entries are compiled from published sources for reference. Verifying the accuracy and suitability of any information for your own use remains your responsibility.

© 2026 ScholarGate · A research-method reference library
  • Privacy
  • Cookies
  • Terms
  • Delete account