Shortest Paths (Dijkstra)
Find least-cost routes from a source.
Key idea
Find least-cost routes from a source.
In depth
Dijkstra’s algorithm repeatedly finalises the unvisited vertex with the smallest tentative distance and relaxes its neighbours. It works because all edge weights are non-negative, so a finalised distance cannot be improved later.
Worked example
From A: to B costs 4, to C costs 1, C → B costs 2, so B’s best distance is 3.
Real-world uses
- Finding the quickest route in a satellite navigation app or the cheapest flight path
Common mistake
Using it with negative edge weights.
How to learn this
- Read the key idea and say it in your own words.
- Work through the worked example, then try a similar problem.
- Use the interactive lesson’s visual and mini-quiz to check the pattern.
Frequently asked questions
What is Shortest Paths (Dijkstra)?
Find least-cost routes from a source. It is a topic at the expert level in Discrete Math & Number Theory.
Where is Shortest Paths (Dijkstra) used in real life?
Real-world examples: Finding the quickest route in a satellite navigation app or the cheapest flight path.
What should I learn before Shortest Paths (Dijkstra)?
Make sure you are comfortable with Minimum Spanning Trees, the previous topic in Discrete Math & Number Theory.
What is a common mistake with Shortest Paths (Dijkstra)?
Using it with negative edge weights.
How can I practise Shortest Paths (Dijkstra)?
Open the interactive lesson, play with the visual, then answer the three-question mini-quiz. Getting two right marks the topic complete.
What comes after Shortest Paths (Dijkstra)?
Move on to Breadth- and Depth-First Search next.
Related expert topics in Discrete Math & Number Theory
- Strong Induction – Assume all earlier cases to prove the next.
- Well-Ordering Principle – Every nonempty set of positive integers has a least element.
- Partial Orders – Reflexive, antisymmetric, transitive relations.
- Cardinality of Sets – Comparing sizes of infinite sets.
- Countable and Uncountable Sets – ℕ and ℚ are countable; ℝ is not.
- Cantor’s Diagonal Argument – Proof that real numbers are uncountable.