ArticleslgStudy

computer science

Stoer–Wagner algorithm

Stoer–Wagner algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Stoer–Wagner algorithm rather than just read about it. In short: 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. It was proposed by Mechthild Stoer and Frank Wagner in 1995.

Stoer–Wagner algorithm — main illustration
Stoer–Wagner algorithm — illustration

Key takeaways

  • Stoer–Wagner algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Stoer–Wagner algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Stoer–Wagner algorithm from memory before moving on to harder problems.

Reference excerpt

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. It was proposed by Mechthild Stoer and Frank Wagner in 1995. 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. At each phase, the algorithm finds the minimum s {\displaystyle s} - t {\displaystyle t} cut for two vertices s {\displaystyle s} and t {\displaystyle t} chosen at its will. Then the algorithm shrinks the edge between s {\displaystyle s} and t {\displaystyle t} to search for non s {\displaystyle s} - t {\displaystyle t} cuts. The minimum cut found in all phases will be the minimum weighted cut of the graph. A cut is a partition of the vertices of a graph into two non-empty, disjoint subsets. 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. For an unweighted graph, the minimum cut would simply be the cut with the least edges. For a weighted graph, the sum of all edges' weight on the cut determines whether it is a minimum cut. 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.

Stoer–Wagner minimum cut algorithm Let G = ( V , E , w ) {\displaystyle G=(V,E,w)} be a weighted undirected graph. Suppose that s , t ∈ V {\displaystyle s,t\in V} . The cut is called an s {\displaystyle s} - t {\displaystyle t} cut if exactly one of s {\displaystyle s} or t {\displaystyle t} is in S {\displaystyle S} . The minimal cut of G {\displaystyle G} that is also an s {\displaystyle s} - t {\displaystyle t} cut is called the s {\displaystyle s} - t {\displaystyle t} min-cut of G {\displaystyle G} . This algorithm starts by finding an s {\displaystyle s} and a t {\displaystyle t} in V {\displaystyle V} , and an s-t min-cut ( S , T ) {\displaystyle (S,T)} of G {\displaystyle G} . For any pair { s , t } {\displaystyle \left\{s,t\right\}} , there are two possible situations: either ( S , T ) {\displaystyle (S,T)} is a global min-cut of G {\displaystyle G} , or s {\displaystyle s} and t {\displaystyle t} belong to the same side of the global min-cut of G {\displaystyle G} . Therefore, the global min-cut can be found by checking the graph G ∪ { s t } / { s , t } {\displaystyle G\cup \{st\}/\left\{s,t\right\}} , which is the graph after merging vertices s {\displaystyle s} and t {\displaystyle t} into a new vertex s t {\displaystyle st} . During the merging, if s {\displaystyle s} and t {\displaystyle t} are connected by an edge then this edge disappears. If s {\displaystyle s} and t {\displaystyle t} both have edges to some vertex v {\displaystyle v} , then the weight of the edge from the new vertex s t {\displaystyle st} to v {\displaystyle v} is w ( s , v ) + w ( t , v ) {\displaystyle w(s,v)+w(t,v)} . The algorithm is described as:

MinimumCutPhase ( G , w , a ) {\displaystyle (G,w,a)}

A ← { a } {\displaystyle A\gets \left\{a\right\}}

while A ≠ V {\displaystyle \ A\neq V}

add to A {\displaystyle 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 {\displaystyle 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 ) {\displaystyle (G,w,a)}

… excerpt ends here. Continue reading the full article.

Illustrations

Stoer–Wagner algorithm: A min-cut of a weighted graph having min-cut weight 4[1]
A min-cut of a weighted graph having min-cut weight 4[1]

Worked examples

Example 1 — a first encounter with Stoer–Wagner algorithm

Start with the simplest possible case. Write down what Stoer–Wagner algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Stoer–Wagner algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Stoer–Wagner algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Stoer–Wagner algorithm

In research
Stoer–Wagner algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Stoer–Wagner algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Stoer–Wagner algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Graph algorithms, Graph connectivity, so understanding it makes those chapters shorter.
In everyday life
Look for Stoer–Wagner algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Stoer–Wagner algorithm” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Stoer–Wagner algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Stoer–Wagner algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Stoer–Wagner algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Stoer–Wagner algorithm in simple terms?

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. It was proposed by Mechthild Stoer and Frank Wagner in 1995.

Why does Stoer–Wagner algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Stoer–Wagner algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Stoer–Wagner algorithm.

Tags

  • Graph algorithms
  • Graph connectivity

Keep exploring