Photo AI

Last Updated Sep 27, 2025

Kruskal's Algorithm Simplified Revision Notes

Revision notes with simplified explanations to understand Kruskal's Algorithm quickly and effectively.

user avatar
user avatar
user avatar
user avatar
user avatar

261+ students studying

10.3.2 Kruskal's Algorithm

Introduction to Kruskal's Algorithm

Kruskal's algorithm is a method to find a minimum spanning tree (MST) of a connected, weighted graph. The MST is a subset of edges that connects all vertices in the graph without forming cycles and has the minimum total weight.

Steps of Kruskal's Algorithm

  1. Sort the Edges by Weight
  2. Initialise the MST
  3. Iterate Through the Edges
  4. Check for Cycles

  1. Sort the Edges by Weight: List all edges in ascending order of their weights.

  1. Initialise the MST: Start with an empty set of edges for the MST.

  1. Iterate Through the Edges:
  • Add the smallest edge to the MST, provided it does not form a cycle.
  • Repeat until v1v-1 edges are included, where vv is the number of vertices.

  1. Check for Cycles: Use a cycle-checking method, such as disjoint sets (union-find), to ensure no cycles are formed.

infoNote

Worked Example


Problem:

Find the minimum spanning tree for the following graph:

EdgeABABACACADADBCBCBDBDCDCD
Weight576987

Step 1: Sort the Edges by Weight

List edges in ascending order:

AB=5,AD=6,AC=7,CD=7,BD=8,BC=9AB = 5, \, AD = 6, \, AC = 7, \, CD = 7, \, BD = 8, \, BC = 9

Step 2: Initialise the MST

Start with an empty MST.


Step 3: Iterate Through the Edges

Add AB=5AB = 5

  • No cycle.

  • MST = {AB}\{ AB \} Add AD=6AD = 6

  • No cycle.

  • MST = {AB,AD}\{ AB, AD \} Add AC=7AC = 7

  • No cycle.

  • MST = {AB,AD,AC}\{ AB, AD, AC \} Skip CD=7CD = 7

  • Adding CDCD would form a cycle. Add BD=8BD = 8

  • No cycle.

  • MST = {AB,AD,AC,BD}\{ AB, AD, AC, BD \}


Step 4: Check the MST

The MST includes v1=41=3v-1 = 4-1 = 3 edges.


Result:

The minimum spanning tree is:

Edges: {AB,AD,AC,BD}\text{Edges: } \{ AB, AD, AC, BD \}Total Weight: 5+6+8=:highlight[19]\text{Total Weight: } 5 + 6 + 8 = :highlight[19]

Algorithm Complexity

Time Complexity:

  • Sorting edges: O(eloge)O(e \log e), where ee is the number of edges.
  • Cycle checking: O(elogv)O(e \log v) using union-find.
  • Overall: O(eloge+elogv)O(e \log e + e \log v)

Space Complexity:

  • Union-find structures require O(v)O(v) space.

Note Summary

infoNote

Common Mistakes

  1. Skipping Cycle Checks: Always ensure no cycles are formed when adding edges.
  2. Incorrect Sorting: Sorting the edges incorrectly leads to errors in the MST.
  3. Premature Stopping: Stop only after including v1v-1 edges.
  4. Confusion Between Trees: MST is unique only if edge weights are distinct; otherwise, multiple MSTs may exist.
  5. Misinterpreting Graph Connectivity: Kruskal's algorithm works only for connected graphs; otherwise, it gives a spanning forest.
infoNote

Key Formulas and Concepts

  1. Minimum Spanning Tree: A subset of edges connecting all vertices with no cycles and minimum total weight.

  2. Number of Edges in MST: For vv vertices: v1v-1 edges.

  3. Cycle Checking: Use disjoint sets (union-find) to ensure no cycles are formed while adding edges.

Books

Only available for registered users.

Sign up now to view the full note, or log in if you already have an account!

500K+ Students Use These Powerful Tools to Master Kruskal's Algorithm

Enhance your understanding with flashcards, quizzes, and exams—designed to help you grasp key concepts, reinforce learning, and master any topic with confidence!

30 flashcards

Flashcards on Kruskal's Algorithm

Revise key concepts with interactive flashcards.

Try Further Maths Core Pure Flashcards

3 quizzes

Quizzes on Kruskal's Algorithm

Test your knowledge with fun and engaging quizzes.

Try Further Maths Core Pure Quizzes

29 questions

Exam questions on Kruskal's Algorithm

Boost your confidence with real exam questions.

Try Further Maths Core Pure Questions

27 exams created

Exam Builder on Kruskal's Algorithm

Create custom exams across topics for better practice!

Try Further Maths Core Pure exam builder

50 papers

Past Papers on Kruskal's Algorithm

Practice past papers to reinforce exam experience.

Try Further Maths Core Pure Past Papers

Other Revision Notes related to Kruskal's Algorithm you should explore

Discover More Revision Notes Related to Kruskal's Algorithm to Deepen Your Understanding and Improve Your Mastery

96%

114 rated

Minimum Spanning Trees

Networks & Matrices

user avatar
user avatar
user avatar
user avatar
user avatar

415+ studying

183KViews

96%

114 rated

Minimum Spanning Trees

Prim's Algorithm

user avatar
user avatar
user avatar
user avatar
user avatar

461+ studying

195KViews
Load more notes

Join 500,000+ A-Level students using SimpleStudy...

Join Thousands of A-Level Students Using SimpleStudy to Learn Smarter, Stay Organized, and Boost Their Grades with Confidence!

97% of Students

Report Improved Results

98% of Students

Recommend to friends

500,000+

Students Supported

50 Million+

Questions answered