Skip to content

Commit bf0fdd7

Browse files
Context added
1 parent dd06589 commit bf0fdd7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

DataStructures/Graphs/Kruskal.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
package Kruskal;
1+
//Problem -> Connect all the edges with the minimum cost.
2+
//Possible Solution -> Kruskal Algorithm (KA), KA finds the minimum-spanning-tree, which means, the group of edges with the minimum sum of their weights that connect the whole graph.
3+
//The graph needs to be connected, because if there are nodes impossible to reach, there are no edges that could connect every node in the graph.
4+
//KA is a Greedy Algorithm, because edges are analysed based on their weights, that is why a Priority Queue is used, to take first those less weighted.
5+
//This implementations below has some changes compared to conventional ones, but they are explained all along the code.
6+
//In case you need to know anyhing else, I would be willing to answer all your doubts, you can contact me by https://www.linkedin.com/in/marcosvillacanas/
27

38
import java.util.Comparator;
49
import java.util.HashSet;

0 commit comments

Comments
 (0)