|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Stoer-Wagner deterministic min-cut algorithm. More...
#include <limits>#include <vector>#include <queue>#include <functional>#include <htlist.H>#include <tpl_sgraph.H>#include <tpl_dynArray.H>#include <tpl_graph_utils.H>#include <ah-errors.H>Go to the source code of this file.
Classes | |
| class | Aleph::Stoer_Wagner_Min_Cut< GT, Distance, SA > |
| Stoer-Wagner deterministic minimum cut algorithm. More... | |
| struct | Aleph::Stoer_Wagner_Min_Cut< GT, Distance, SA >::SWNode |
| struct | Aleph::Stoer_Wagner_Min_Cut< GT, Distance, SA >::PQEntry |
| struct | Aleph::Unit_Weight< GT > |
| Unit weight functor for unweighted graphs. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
Stoer-Wagner deterministic min-cut algorithm.
Implements the Stoer-Wagner algorithm for finding minimum cuts in undirected weighted graphs. Unlike Karger's randomized approach, Stoer-Wagner is deterministic and always finds the exact minimum cut.
The Stoer-Wagner algorithm is based on a key observation: for any two vertices s and t, the minimum cut of the graph is either:
The algorithm exploits this by repeatedly finding a "minimum s-t cut" using a procedure called Maximum Adjacency Search (also known as Maximum Cardinality Search), then merging s and t.
MAS grows a set A of vertices starting from an arbitrary vertex:
Key theorem: The cut separating t from all other vertices has weight equal to the sum of edges incident to t. This is a minimum s-t cut!
This implementation uses a binary heap, achieving O(nm + n² log n).
| Algorithm | Time Complexity | Type | Guarantee |
|---|---|---|---|
| Stoer-Wagner | O(nm + n² log n) | Deterministic | Exact |
| Karger | O(n⁴ m) | Randomized | High prob. |
| Karger-Stein | O(n² log³ n) | Randomized | High prob. |
| Max-Flow | O(n³) or better | Deterministic | Exact (s-t) |
Definition in file Stoer_Wagner.H.