Graph connectivity is one of the classical subjects in graph theory and has many practical applications. A Minimum Spanning Tree in an undirected connected weighted graph is a spanning tree of minimum weight. For this we can implement two function that are Prim and Kruskal algorithms.
Finding the minimum cut of an edge weighted graph is a fundamental algorithmic problem. Stoer–Wagner algorithm is a recursive algorithm to solve the minimum cut problem in undirected weighted graphs with non-negative weights. The essential idea of this algorithm is to shrink the graph by merging the most intensive vertices, until the graph only contains two combined vertex sets. Implement Min-Cut by Stoer Wagner function.