GO-V.ORG
As seen in

Stoer–Wagner algorithm

In graph theory, the Stoer–Wagner algorithm is a recursive algorithm to solve the minimum cut problem in undirected weighted graphs with non-negative weights.[src] It was proposed by Mechthild Stoer and Frank Wagner in 1995.[src] 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.[src] At each phase, the algorithm finds the minimum s - t cut for two vertices s and t chosen at its will.[src] Then the algorithm shrinks the edge between s and t to search for non s - t cuts.[src] The minimum cut found in all phases will be the minimum weighted cut of the graph.[src] A cut is a partition of the vertices of a graph into two non-empty, disjoint subsets.[src] A minimum cut is a cut for which the size or weight of the cut is not larger than the size of any other cut.[src] For an unweighted graph, the minimum cut would simply be the cut with the least edges.[src] For a weighted graph, the sum of all edges' weight on the cut determines whether it is a minimum cut.[src] In practice, the minimum cut problem is always discussed with the maximum flow problem, to explore the maximum capacity of a network, since the minimum cut is a bottleneck in a graph or network.[src]

In graph theory, the Stoer–Wagner algorithm is a recursive algorithm to solve the minimum cut problem in undirected weighted graphs with non-negative weights.[src] It was proposed by Mechthild Stoer and Frank Wagner in 1995.[src] 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.[src] At each phase, the algorithm finds the minimum s - t cut for two vertices s and t chosen at its will.[src] Then the algorithm shrinks the edge between s and t to search for non s - t cuts.[src] The minimum cut found in all phases will be the minimum weighted cut of the graph.[src] A cut is a partition of the vertices of a graph into two non-empty, disjoint subsets.[src] A minimum cut is a cut for which the size or weight of the cut is not larger than the size of any other cut.[src] For an unweighted graph, the minimum cut would simply be the cut with the least edges.[src] For a weighted graph, the sum of all edges' weight on the cut determines whether it is a minimum cut.[src] In practice, the minimum cut problem is always discussed with the maximum flow problem, to explore the maximum capacity of a network, since the minimum cut is a bottleneck in a graph or network.[src] Let G=(V,E,w) be a weighted undirected graph.[src] Suppose that s,t\in V .[src] The cut is called an s - t cut if exactly one of s or t is in S .[src] The minimal cut of G that is also an s - t cut is called the s - t min-cut of G .[src] This algorithm starts by finding an s and a t in V , and an s-t min-cut (S,T) of G .[src] For any pair \left\{s,t\right\} , there are two possible situations: either (S,T) is a global min-cut of G , or s and t belong to the same side of the global min-cut of G .[src] Therefore, the global min-cut can be found by checking the graph G\cup\{st\}/\left\{s,t\right\} , which is the graph after merging vertices s and t into a new vertex st .[src] During the merging, if s and t are connected by an edge then this edge disappears.[src] If s and t both have edges to some vertex v , then the weight of the edge from the new vertex st to v is w(s,v)+w(t,v) .[src] The algorithm is described as: MinimumCutPhase (G,w,a) A\gets\left\{a\right\} while \ A\ne V add to A the most tightly connected vertex end store the cut in which the last remaining vertex is by itself (the "cut-of-the-phase") shrink G by merging the two vertices (s, t) added last (the value of "cut-of-the-phase" is the value of minimum s, t cut.) MinimumCut (G,w,a) while |V|>1 MinimumCutPhase (G,w,a) if the cut-of-the-phase is lighter than the current minimum cut then store the cut-of-the-phase as the current minimum cut The algorithm works in phases.[src] In the MinimumCutPhase, the subset A of the graphs vertices grows starting with an arbitrary single vertex until A is equal to V .[src] In each step, the vertex which is outside of A , but most tightly connected with A is added to the set A .[src] This procedure can be formally shown as: add vertex z\notin A such that w(A,z)=\max\{w(A,y) \mid y\notin A\} , where w(A,y) is the sum of the weights of all the edges between A and y .[src] So, in a single phase, a pair of vertices s and t , and a min s\text{-}t cut C is determined.[src] After one phase of the MinimumCutPhase, the two vertices are merged as a new vertex, and edges from the two vertices to a remaining vertex are replaced by an edge weighted by the sum of the weights of the previous two edges.[src] Edges joining the merged nodes are removed.[src] If there is a minimum cut of G separating s and t , the C is a minimum cut of G .[src] If not, then the minimum cut of G must have s and t on a same side.[src] Therefore, the algorithm would merge them as one node.[src] In addition, the MinimumCut would record and update the global minimum cut after each MinimumCutPhase.[src] After n-1 phases, the minimum cut can be determined.[src] To prove the correctness of this algorithm, we need to prove that the cut given by MinimumCutPhase is in fact a minimum s\text{-}t cut of the graph, where s and t are the two vertices last added in the phase.[src] Therefore, a lemma is shown below: Lemma 1: MinimumCutPhase returns a minimum s\text{-}t -cut of G .[src] Let C=(X,\overline{X}) be an arbitrary s\text{-}t cut, and CP be the cut given by the phase.[src] We must show that W(C)\ge W(CP) .[src] Observe that a single run of MinimumCutPhase gives us an ordering of all the vertices in the graph (where a is the first and s and t are the two vertices added last in the phase).[src] We say the vertex v is active if v and the vertex added just before v are in opposite sides of the cut.[src] We prove the lemma by induction on the set of active vertices.[src] We define A_v as the set of vertices added to A before v , and C_v to be the set of edges in C with both of their ends in A_v \cup \{v\} , i.e.[src] C_v \subseteq C is the cut induced by A_v \cup \{v\} .[src] We prove, for each active vertex v , w(A_v,v)\le w(C_v) Let v_0 be the first active vertex.[src] By the definition of these two quantities, w(A_{v_0},v_0) and w(C_{v_0}) are equivalent.[src] A_{v_0} is simply all vertices added to A before v_0 , and the edges between these vertices and v_0 are the edges that cross the cut C .[src] Therefore, as shown above, for active vertices v and u , with v added to A before u : w(A_u,u)=w(A_v,u)+w(A_u-A_v,u) w(A_u,u)\le w(C_v)+w(A_u-A_v,u) by induction, w(A_v,u)\le w(A_v,v)\le w(C_v) w(A_{u},u)\le w(C_{u}) since w(A_u-A_v,u) contributes to w(C_{u}) but not to w(C_{v}) (and other edges are of non-negative weights) Thus, since t is always an active vertex since the last cut of the phase separates s from t by definition, for any active vertex t : w(A_t,t)\le w(C_t)=w(C) Therefore, the cut of the phase is at most as heavy as C .[src] // Adjacency matrix implementation of Stoer–Wagner min cut algorithm.[src] // // Running time: // O(|V|^3) include using namespace std; pair > globalMinCut(vector > mat) { pair > best = {INT_MAX, {}}; int n = mat.size(); vector > co(n); for (int i = 0; i w = mat[0]; size_t s = 0, t = 0; for (int it = 0; it O(E log V) with prio.[src] queue w[t] = INT_MIN; s = t, t = max_element(w.begin(), w.end()) - w.begin(); for (int i = 0; i const int maxn = 550; const int inf = 1000000000; int n, r; int edge[maxn][maxn], dist[maxn]; bool vis[maxn], bin[maxn]; void init() { memset(edge, 0, sizeof(edge)); memset(bin, false, sizeof(bin)); } int contract( int &s, int &t ) // Find s,t { memset(dist, 0, sizeof(dist)); memset(vis, false, sizeof(vis)); int i, j, k, mincut, maxc; for (i = 1; i maxc) { k = j; maxc = dist[j]; } if (k == -1) return mincut; s = t; t = k; mincut = maxc; vis[k] = true; for (j = 1; j ans) mincut = ans; if (mincut == 0) return 0; for (j = 1; j ==External links== StoerWagnerMinCut.java - a Java library that implements the Stoer–Wagner algorithm[src]

59 sentences · 59 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Stoer–Wagner algorithm." encyclopegia.org, 2025, https://encyclopegia.org/wiki/stoer-wagner-algorithm. Accessed 06 December 2026.

Chicago

"Stoer–Wagner algorithm." encyclopegia.org. Accessed December 6, 2026. https://encyclopegia.org/wiki/stoer-wagner-algorithm.

APA

encyclopegia.org. (2025). Stoer–Wagner algorithm. Retrieved December 6, 2026, from https://encyclopegia.org/wiki/stoer-wagner-algorithm

Accessed December 6, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Richard Wagner

stub · references available

Katrin Wagner-Augustin

stub · references available

Gudrun Wagner

stub · references available

Fritz Arno Wagner

stub · references available

Otto Wagner

stub · references available

Rolf Clemens Wagner

stub · references available

Hannes Wagner

stub · references available

Rupert Wagner

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1283990532 · 0.5 · snapshot enwiki-001283990532

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.