Finding the cheapest cut through a pipe network
How the pipe network is built, why blocking the biggest pipe is usually wrong, the theorem that tells you the exact price before you start, and a step-by-step method for finding the right set of pipes to block.

The setup: spring, pipes and sink
Water leaves a green spring on the left and flows through pipes toward a dark sink on the right. Every pipe has a number on it. That number means two things at once: how much water the pipe can carry, and how much it costs to block.
Your goal is to stop all water from reaching the sink. You do this by blocking pipes. But you have a budget, and every pipe you block costs its number. A pipe labelled five costs five to block. The puzzle is to find a set of blocked pipes that cuts the spring off from the sink completely, at or below the allowed cost.
Tap a pipe to block it. Tap it again to unblock it. Only the pipes blocked at the end count toward your cost. You can experiment as much as you like without penalty.
Blue pipes, grey pipes and what they tell you
The network uses colour to show you what is happening. Blue pipes are currently carrying water. They have a clear path back to the spring. Grey pipes are already cut off from the spring, either because you blocked something upstream or because the network's shape leaves them stranded.
Blocking a grey pipe wastes money. It is already doing nothing. Before you block a pipe, check its colour. If it is already grey, your budget is better spent elsewhere.
When you block a blue pipe, the network recalculates. Some pipes that were blue may turn grey because your block cut off their supply. Watch for that cascade. A single well-placed block can grey out several pipes at once.
Pipes that skip a column
The network has columns of junction points between the spring and the sink. Most pipes connect one column to the next. But one or two pipes jump straight past a column, linking a node on the left to a node two columns to the right.
These skip pipes are traps. If you block every pipe leaving one column but miss a skip pipe that goes around it, water still reaches the sink. Your cut is not actually a cut.
Before you call your answer final, check whether any skip pipes are still blue. They are easy to overlook because they cross the whole width of a column and sit behind the shorter pipes in the drawing. A quick visual scan from left to right catches them. If one is still blue, your cut is broken no matter how many other pipes you blocked.
Why big pipes are tempting but often wrong
A pipe labelled six looks important. It carries a lot of water and it must be stopped. But blocking it costs six, which might be half your budget on a small network. If two smaller pipes downstream carry the same water to the sink, blocking those two might cost less.
The cheapest cut is almost never the set of the largest pipes. It is the narrowest place in the whole network, and that place is often several small pipes spread across different paths.
Think of it this way: the water has to cross from left to right. Somewhere in the network there is a bottleneck where the total capacity is lower than everywhere else. That bottleneck is where the cheap cut lives, and the pipes there are usually the small ones.
The column method for finding a starting point
Here is a simple way to get a working cut. Pick a column of junction points. Block every pipe that leaves that column going right. That always works because no water can pass through without crossing at least one of those pipes.
Add up the cost. That number is an upper bound on the cheapest cut. It is rarely the answer, but it tells you what to beat. If blocking the second column costs twelve, you know the answer is twelve or less.
Now look for individual pipes in that set that you can unblock without letting water through. Sometimes a node on the right side of your column is already cut off by something else. The pipe leading to it is redundant, and unblocking it saves money.
The theorem behind the budget
The budget is always set to match the cheapest possible cut. That number comes from a theorem proved in nineteen fifty-six: the most water a network can deliver from spring to sink is always exactly equal to the cost of the cheapest set of pipes that stops all the water.
The game computes the maximum flow, and that figure becomes the par. Your budget is par plus a few extra to give you room to experiment. Any cut that costs par is perfect. Any cut that costs less than par does not exist.
This means you can check your own work. Count up the total capacity of every pipe leaving the spring. That is the most the spring could push out. Follow the water forward and find where the capacity shrinks. The total capacity at the narrowest crossing is the answer.
A worked example on a small network
The spring connects to two middle nodes through pipes of three and four. The first middle node connects to the sink through a pipe of two. The second middle node connects to the sink through a pipe of five. There is also a skip pipe from the spring to the sink with a capacity of one.
The spring can push out three plus four plus one equals eight. But the two middle paths can only deliver two plus five equals seven to the sink, plus the skip pipe's one. Total capacity is eight, but the actual flow is limited by the thinnest path.
Blocking the pipe of two, the pipe of five and the skip pipe costs two plus five plus one equals eight. That works but is expensive. Blocking the pipes of three and four from the spring cuts everything for seven. Cheaper, and still a full cut. Checking whether seven is the minimum takes trying a few more combinations.
Network sizes and how they change the puzzle
Small networks have two columns of middle nodes with two nodes each. The total number of pipes is low, and the cheapest cut usually involves three or four pipes. You can often spot the answer by eye.
Medium networks stretch to three columns of two or three nodes. More pipes means more paths for water to sneak through, and the skip pipes become more dangerous. You need to be systematic rather than intuitive.
Large networks go to three columns of three nodes with higher pipe capacities. The budget grows, the number of possible cuts explodes, and the difference between a good cut and the cheapest cut can be several points. Planning from the bottleneck inward becomes essential.
Mistakes that inflate the cost
- Blocking grey pipes. They are already cut off and cost you money for nothing. Check the colour before you tap.
- Missing a skip pipe. One overlooked pipe that jumps past your blocked column means water still flows and your cut is incomplete.
- Blocking the biggest pipe first. It is natural but usually wrong. Small pipes at bottleneck crossings are cheaper targets.
- Forgetting that unblocking is free. If you blocked something and changed your mind, tap it again. Only the final state counts.
- Trying to slow the water instead of stopping it. The puzzle requires a complete cut. Even one surviving route means the spring still reaches the sink.
Thinking about it as a flow problem
If you enjoy this puzzle, the idea behind it shows up in many real problems. Scheduling tasks so that no resource is overloaded, matching workers to jobs so that nobody is idle, and segmenting an image into foreground and background all reduce to the same kind of network flow question.
The game gives you a hands-on feel for why the cheapest cut sits at the bottleneck. Once you have blocked a few networks by hand, the theorem stops being a fact you read and becomes something you have seen work a dozen times over.
Nothing leaves your device
The network is generated and checked entirely in your browser. No puzzle data is sent to a server, there is no account to create, and your best score is saved on this device only. After the page loads, the game keeps working with no connection at all.
