You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
1
# Kruskal's Algorithm Minimum Spanning Tree (Graph MST)
2
2
3
3
Java Implementation of Kruskal's Algorithm using **disjoing sets**
4
-
**Kruskal's algorithm:** Start with T = ∅. Consider edges in ascending order of weight. Insert edge e into T unless doing so would create a cycle
4
+
**Kruskal's algorithm:** Start with **T** = ∅. Consider edges in ascending order of weight. Insert edge `e` into **T** unless doing so would create a cycle.
5
5
- Works on **UN-directed** graphs
6
6
-**Algorithm still works on edges with identical weight**
7
7
Edges are sorted by weight first. Depending on the order they are entered into the **edge list** in the **constructor**, you may get different Minimum Spanning Trees (but all still optimal solutions)
@@ -32,6 +32,6 @@ Example graph has 8 nodes numbered 1-8 (array ignores the 0th index)
32
32
Hence `&& mstEdges.size()<(nodeCount-1)` in my loop
33
33
- The `Edge` class simply packages an edge's weight & 2 vertices together as 1 object
34
34
35
-
####Sources
35
+
####Sources
36
36
-[Disjoint Sets by Mark Allen Weiss](http://users.cis.fiu.edu/~weiss/dsaajava3/code/DisjSets.java) Author of *Data Structures and Algorithm Analysis in Java (3rd Edition), 2011*
37
37
He also has other helpful [Java Data Structures implementations](http://users.cis.fiu.edu/~weiss/dsaajava3/code/)
0 commit comments