Dijkstra Shortest Path Calculator

Find the shortest path between two nodes of a weighted graph with Dijkstra's algorithm.

Results

Enter your details and click Calculate to see your results.
About This Calculator

Repeatedly settle the closest unvisited node and relax its edges.

Example

Example: the default inputs → Distance: Shortest distance A → F: 13.

Assumptions

Exact maths — check the input format shown in each field.

Frequently Asked Questions

Does Dijkstra work with negative weights?

No — use Bellman–Ford.

What is the shortest A to F path in the example?

A → C → B → D → E → F, length 13.

Related Calculators

About the Author

Imran Hossain
Imran Hossain

Professional SEO, Digital Marketer Specialist

I am a Certified Google Ads Expert And Professional SEO, Digital Marketing Specialist

View full profile