Comparing Dijkstra's & Floyd's Algorithms (Edexcel A Level Further Maths: Decision 1): Revision Note

Exam code: 9FM0

Dan Finlay

Written by: Dan Finlay

Reviewed by: Lucy Kirkham

Updated on

Comparing Dijkstra's & Floyd's algorithms

What is the difference between Dijkstra's and Floyd's algorithms?

  • Both algorithms find the shortest path, and its weight (length) between nodes on a graph

  • Dijkstra's algorithm finds the shortest path between a fixed starting node and every other node in the network

    • This would be useful where a starting point cannot be moved

      • e.g.  a power station, a distribution warehouse

    • The advantage of Dijkstra's algorithm are speed

      • the algorithm can be stopped once the desired end node is reached

    • The disadvantage of Dijkstra's algorithm is the limited information it provides (compared to Floyd's)

  • Floyd's algorithm finds the shortest path between any pair of start and end nodes

    • This would be useful where a starting point can be anywhere on the network

      • e.g. a robot inspecting a network of pipelines

    • The advantage of Floyd's algorithm is the amount of information it provides (compared to Dijkstra)

    • The disadvantage of Floyd's algorithm is the time it takes (especially manually without a computer!)

  • Repeating Dijkstra's algorithm, taking each node in turn as the starting node, would produce the same information as Floyd's algorithm

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Build on this topic

Dan Finlay

Author: Dan Finlay

Expertise: Portfolio Lead

Dan graduated from the University of Oxford with a First class degree in mathematics. As well as teaching maths for over 8 years, Dan has marked a range of exams for Edexcel, tutored students and taught A Level Accounting. Dan has a keen interest in statistics and probability and their real-life applications.

Lucy Kirkham

Reviewer: Lucy Kirkham

Expertise: Content Creator

Lucy has been a passionate Maths teacher for over 12 years, teaching maths across the UK and abroad helping to engage, interest and develop confidence in the subject at all levels.Working as a Head of Department and then Director of Maths, Lucy has advised schools and academy trusts in both Scotland and the East Midlands, where her role was to support and coach teachers to improve Maths teaching for all.