@@ -0,0 +1,1121 @@
+package com.graphs;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport com.disjointsets.DisjointSet;%0Aimport com.graphs.GraphEdgeListRepresentation.Edge;%0A%0A/**%0A * Given an undirected graph, we want to find the Minimum Spanning Tree using%0A * KRUSKAL algorithm.%0A * %0A * @author STEPHANE MIGUEL KAKANAKOU (Skakanakou@gmail.com)%0A *%0A */%0Apublic class GraphMstWithKruskal %7B%0A%0A    public static List%3CEdge%3E mst(GraphEdgeListRepresentation graph) %7B%0A%0A        if (graph.isDirectedGraph())%0A            throw new IllegalArgumentException(%22Invalid Argument%22);%0A%0A        List%3CEdge%3E result = new ArrayList%3C%3E();%0A        DisjointSet%3CInteger%3E disjointSet = new DisjointSet%3C%3E();%0A        int v_size = graph.getV_Size();%0A%0A        for (int u = 0; u %3C v_size; u++)%0A            disjointSet.makeSet(u);%0A%0A        List%3CEdge%3E sortedListOfEdges = graph.getSortedEdgeListByWeight();%0A        for (Edge edge : sortedListOfEdges) %7B%0A            if (!disjointSet.find(edge.u).equals(disjointSet.find(edge.v))) %7B%0A                result.add(edge);%0A                disjointSet.union(edge.u, edge.v);%0A            %7D%0A        %7D%0A%0A        return result;%0A    %7D%0A%0A%7D%0A

Add GraphMstWithKruskal class to find the Minimum Spanning Tree of a graph