Hashiwokakero (Bridges), Explained
After reading this you will know how a hashiwokakero puzzle encodes a connected graph, how to solve one by counting bridge capacity, and how a generator proves that exactly one bridge layout works.
What hashiwokakero is
Hashiwokakero, often shortened to Hashi or called Bridges, is a puzzle played on a grid of numbered circles. Each circle is an island. Your job is to draw bridges between islands until every island touches exactly as many bridge ends as the number printed on it. The word means "build bridges" in Japanese.
The rules are short. Bridges run straight, horizontally or vertically, between two islands in the same row or column. At most two bridges may join the same pair of islands. Bridges may not cross each other, and may not pass through a third island. When you finish, every island must be reachable from every other by walking across bridges. That last rule, a single connected network, is what makes the puzzle interesting rather than a set of separate local sums.
Here is a small hook. Suppose two islands sit in the same row, the left one labeled 2 and the right one labeled 2, with no other island between or beside them. The only legal way to satisfy both is a double bridge connecting them. A single bridge would leave each at 1, which is too few, and each island needs all its bridge ends to go to the only neighbor available.
When to reach for it, and when not
Hashi rewards patience and clean counting. It suits a solver who likes deducing forced moves from small numbers, and it scales well: a 7x7 board with 12 islands takes a few minutes, while a 25x25 board with 90 islands can hold attention for half an hour.
Use it in a classroom when you want to teach graph connectivity and degree counting without any equation on the board. A student who solves a Hashi grid has, without noticing, reasoned about vertex degrees and spanning connectivity.
Skip it if your group wants arithmetic practice or Latin-square logic. For those, a Kakuro Generator or a KenKen (Calcudoku) Generator fits better. If you want a loop-drawing puzzle with a similar planar, no-crossing feel, try the Slitherlink Generator.
Hashi is a graph problem in disguise. Islands are vertices, possible bridges are edges with capacity two, and the island number is the required degree. "One connected network" means the finished graph must be a single connected component.
The counting that drives every deduction
Two facts about capacity carry most of the solving. First, an island can connect only to islands directly north, south, east, or west of it with a clear line of sight. Call the number of such neighbors its degree of freedom. Second, each of those connections can carry at most two bridges. So the maximum bridge ends an island can ever receive is
where n is the number of clear neighbors. If an island is labeled with a value equal to B_{\max}, every connection to every neighbor must be a full double bridge, and you can fill them all immediately. An island labeled 8 can only exist in the interior with four neighbors, because 2 \cdot 4 = 8 is the ceiling on a flat grid.
A softer version drives most moves. If an island needs b ends and has n neighbors, then it must send at least
bridges to each single neighbor. Read it as: even if every other neighbor takes its full two, this many ends still have nowhere else to go. For an island labeled 4 with two neighbors, 4 - 2(2-1) = 2, so each neighbor gets a forced double bridge. That single inequality resolves a surprising fraction of any puzzle.
A worked example from the demo grid
A 7x7 board with seven islands
Load the generator with its default settings and press the demo button. You get a small board. The islands and their numbers, given as (row, column) with rows counted from the top, are:
| Island | Row | Column | Number |
|---|---|---|---|
| A | 1 | 1 | 2 |
| B | 1 | 4 | 3 |
| C | 1 | 7 | 1 |
| D | 4 | 1 | 3 |
| E | 4 | 4 | 4 |
| F | 7 | 4 | 2 |
| G | 4 | 7 | 1 |
- Look at island E at (4,4), labeled
4. Its clear neighbors are B above, D to the left, F below, and G to the right: four neighbors. With 4 - 2(4-1) = -2, nothing is forced yet by the soft rule, so hold it. - Look at island B at (1,4), labeled
3, with neighbors A (left), C (right), and E (below): three neighbors. The soft bound gives 3 - 2(3-1) = -1, still nothing forced. Hold it. - Look at island A at (1,1), labeled
2. Its only clear neighbors are B (right) and D (below): two neighbors. Soft bound: 2 - 2(2-1) = 0. Not forced to a specific neighbor, but A must spend both ends across these two links. - Island D at (4,1), labeled
3, has neighbors A (above) and E (right): two neighbors, so 3 - 2(2-1) = 1. At least one bridge goes A to D and at least one goes D to E. Draw both singles as forced minimums. - Now A already has one end used (to D). A needs
2total, so its remaining end goes to B. Draw A to B single. A is complete. - D still needs
3and has one to A. The remaining two must go to E, so draw D to E as a double. D is complete. - E now has D as a double (2 ends). E needs
4. Islands F and G are labeled2and1; C is1. Tracking the remaining requirements, E takes one bridge to B, one to F, giving E its four ends. B then reaches3with A, C, and E singles; C and G take their single bridges; F takes one from E plus one from below-network closure. - Check connectivity: A-B-C, A-D-E, E-F, E-G all hang together through E and B. Every island is reachable. The solution is unique.
Reading and interpreting a finished grid
A solved Hashi grid is a planar graph drawn without crossings. Two numbers describe its shape. The total bridge count equals half the sum of all island labels, because every bridge contributes two ends. In the demo the labels sum to 2+3+1+3+4+2+1 = 16, so the finished grid holds exactly 8 bridge segments.
The second number is the count of double bridges. Doubles concentrate difficulty, because a double looks like two separate decisions until you notice the capacity is forced. A grid where the sum of labels is close to 2 \cdot (\text{islands} - 1) is nearly a tree and tends to be easy; a grid whose sum is much higher packs in cycles and doubles and resists guessing.
How the generator guarantees one solution
The generator does not scatter numbers and hope. It grows a random connected layout first: it places an island, then repeatedly extends a bridge to a new island in a free direction, so the graph is connected by construction. Then it strengthens the layout, promoting some bridges to doubles and adding extra links to create cycles, according to the difficulty setting.
After each change it hands the numbered grid to a backtracking solver. The solver tries to reconstruct a valid bridge layout from the numbers alone. If it finds two or more distinct layouts, the puzzle is ambiguous and the generator adjusts and retries. Only a grid the solver proves has exactly one layout is shown to you.
Difficulty is mostly island density plus the count of doubles and cycles. Hard grids give more islands where several local layouts look plausible, so you must use connectivity, not just degree counting, to rule options out.
Common mistakes
The first mistake is ignoring connectivity until the end. You can satisfy every island's number and still leave two separate clumps. A layout that meets all the counts but splits into a group of A, B, C and a group of D, E is wrong, because the network must be one piece. Always check reachability before declaring victory.
The second is drawing a bridge through an island. A vertical bridge from row 1 to row 7 in column 4 is illegal if any island sits at (4,4) between them. Bridges connect adjacent islands along the line of sight only.
The third is forgetting that a crossing is banned. If a horizontal bridge and a vertical bridge would occupy the same cell, only one of them can exist. Beginners often draw both and satisfy the counts locally, then cannot understand why the solution feels contradictory.
Two clumps that each satisfy every number are the single most common false solution. Before you stop, trace a path from one island to every other. If any island is unreachable, at least one bridge is in the wrong place.
Related logic puzzles
If Hashi appeals, these share its taste for pure deduction with no arithmetic. The Sudoku Generator and the Futoshiki Generator both build on constraint elimination in a grid. For a picture-forming variant, the Nonogram Maker uses run-length clues. The Skyscrapers Puzzle Generator and the Hitori Generator round out a set of grid puzzles that, like Hashi, are all verified to have a single solution.
Frequently asked questions
Can three bridges ever join two islands?
No. The maximum is two bridges between any one pair. That cap is why an island's ceiling is 2n for n neighbors, and why an 8 only appears with four neighbors.
What does the number on an island mean exactly?
It is the total count of bridge ends touching that island. A single bridge to a neighbor counts as one, a double counts as two. An island labeled 5 might have one double and three singles, or other splits that sum to five.
Is every generated puzzle solvable without guessing?
Every puzzle has exactly one solution, verified by a backtracking solver before display. Whether you can reach it by pure logic depends on skill, but the answer is always unique, so any dead end means a step was wrong.
Why did I satisfy all the numbers but the puzzle says I am wrong?
Almost always the network split into two or more disconnected pieces. Connectivity is a rule, not a bonus. Trace a path between every pair of islands to find the break.
Does the puzzle run on the site's servers?
No. Generation, solving, and verification all run in your browser. Your puzzles never leave your device.