I want to implement the min cut algorithm form Karger.
Wikipedia claims it is possible to write an implementation with a running time of O(|V|^2). I don't see any way to do this. The algorithm makes |V| iterations and in each iteration it contracts an edge. To contract an edge you need to:
- create a new vertex,
- delete the two old vertexes and
- delete the edges between the old vertexes.
There is no data structure for graphs which can add vertexes, delete vertexes and delete edges in O(|V|). Wikipedia recommends an adjacency lists but it has an running time of O(|V|+|E|) which is bad if you have |E|=|V|^2. Is it possible to implement the Karger's min cut in O(|V|^2)?