Implementation of Karger's algorithm to find min cuts of a connected graph