Why the loops are avoided in Kruskal's algorithm?

I read Kruskal's algorithm as it's presented on Wikipedia. There, it says that it's an algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph. But while going through the examples that illustrate this algorithm I am unable to understand why the loops are avoided by marking some of the edges in red. What is the reason for this?

May 7, 2025 - 06:05
 0

I read Kruskal's algorithm as it's presented on Wikipedia. There, it says that it's an algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph.

But while going through the examples that illustrate this algorithm I am unable to understand why the loops are avoided by marking some of the edges in red.

What is the reason for this?