Tile Shift: a reversed row pair adds two unavoidable slides.
Turn a distance total of seven into a proven nine-slide minimum, then load the exact board and test a matching route.
A sliding puzzle's distance total counts how far each numbered tile is from home. It does not ask whether two tiles can pass each other. When a pair occupies its correct row in the wrong left-to-right order, that missing question can give you a stronger lower bound before you try a solution.
On the board below, Tile distance total shows seven. We will account for those seven, identify two additional slides that every solution needs, and replay a nine-slide answer. A lower bound and a route of the same length establish the minimum for this one position.
Load the exact row-order example
Choose Practice this example in the side panel, or Load row-order example beneath the Tile Shift board. Loading replaces your current arrangement and resets Moves. Rows R1–R4 run from top to bottom; columns C1–C4 run from left to right. The dot is the gap, not a numbered tile.
1 2 3 4 5 6 7 8 9 14 12 10 13 15 · 11
The goal is 1–4 across row one, 5–8 across row two, 9–12 across row three, and 13, 14, 15, gap across row four. The example is reachable: its supplied construction uses nine legal slides from that goal. You do not need to judge the solvability of an arbitrary hand-arranged board to do this exercise.
Check what the distance total already includes
For each numbered tile, add the absolute row difference and the absolute column difference between its current square and its goal. The gap contributes nothing. Only five numbered tiles contribute on this board:
| Tile | Current → goal | Distance |
|---|---|---|
| 10 | R3C4 → R3C2 | 2 |
| 11 | R4C4 → R3C3 | 2 |
| 12 | R3C3 → R3C4 | 1 |
| 14 | R3C2 → R4C2 | 1 |
| 15 | R4C2 → R4C3 | 1 |
The sum is 2 + 2 + 1 + 1 + 1 = 7. Every legal slide moves exactly one numbered tile one square horizontally or vertically. A slide changes that tile's distance by one, so seven is a lower bound on the remaining slides. It is not yet a promise that seven slides can solve the board.
Use the order of two tiles in their goal row
Read row three from left to right: 9, 14, 12, 10. Both 10 and 12 belong in this row, but 12 is currently left of 10. In the goal, 10 must be left of 12. Ignore 14 when testing this particular pair; its goal is in another row.
Two tiles that remain inside a single row cannot change their relative left-to-right order. They cannot share a square or jump over one another. The gap can separate them, but moving the gap along that row does not let them pass. Therefore at least one of 10 and 12 must leave row three before the board is solved.
Whichever tile leaves must return, because both goal squares are in row three. That requires at least one vertical slide out and one vertical slide back: two vertical slides. Their initial vertical distance was zero, so neither of those slides was included in the seven-distance budget. The necessary horizontal travel is still needed too.
Every solution therefore needs at least 7 + 2 = 9 slides. This is a constraint on all solutions, not just on a route we happened to try. It does not require deciding in advance which of the two tiles will leave the row.
Try a route that matches the bound
Start from the printed example with Moves at zero. Select these tile numbers in order; a repeated number means the same tile at its new position:
- 12: down into R4C3.
- 10: left into R3C3.
- 11: up into R3C4.
- 12: right into R4C4.
- 15: right into R4C3.
- 14: down into R4C2.
- 10: left into R3C2.
- 11: left into R3C3.
- 12: up into R3C4.
After move three, the upper two rows remain unchanged and the lower half is:
9 14 10 11 13 15 12 ·
Tile 12 has left the row so 10 and 11 can move across it. After move six, the lower half is:
9 · 10 11 13 14 15 12
The final three slides place 10, 11, and 12 in their goal squares, leaving the gap at R4C4. The game reports a solution in nine moves. No earlier step in this route finishes the puzzle.
We now have both parts of an optimality check: every solution takes at least nine slides, and one legal solution takes exactly nine. The minimum for this starting board is nine. A nine-slide route by itself would show only that the minimum is no greater than nine; the row-order argument supplies the other direction.
Record the distance changes, then retry
Watch Tile distance total after every slide. From the start through move nine, its values are:
Start: 7 Move: 1 2 3 4 5 6 7 8 9 Total: 8 7 6 5 4 3 2 1 0
The first slide raises the total from seven to eight. It is still part of a shortest solution. Moving 12 downward creates room to change the pair's order. During the whole route, tile 12 travels down, right, then up: three slides for a tile whose initial distance was one. Those two additional vertical slides are exactly the detour proved necessary above.
Choose Retry this board to restore the same arrangement and reset Moves to zero. Try solving without reading the route, then compare your actual count with nine. Retry works after a win as well. Loading another example replaces this board; New puzzle creates a random arrangement. A fixed practice entry reloads its starting example when refreshed, and attempts are not saved as a history.
Check the condition before reusing the idea
Does any reversed pair in a row justify adding two?
No. For this argument both numbered tiles must be in their own common goal row, and their current order must oppose their goal order. For example, 14 is also left of 10 in the starting row, but 14 belongs in row four. Its departure from row three is already represented by its vertical distance. That pair does not justify a separate two-slide charge by this reasoning.
Can you add two for every reversed pair you notice?
Not without further justification. If several pairs share a tile, one departure and return might resolve more than one pair. Counting the same unavoidable detour several times can overestimate a minimum. This lesson uses just the single pair 10 and 12; it supplies no general rule for summing overlapping pairs.
Does the value nine mean there is only one shortest answer?
No. The proof establishes the minimum length and supplies one route of that length. It does not count all shortest routes or claim uniqueness. On another board, the distance total plus one justified two-slide detour may still fall below the actual minimum.
This check applies to this four-by-four puzzle's ordinary adjacent slides without wrapping or jumping. The live distance display still shows the sum of individual tile distances; it does not automatically add a row-order penalty or search for an optimal route. Use the pair test as a separate reasoning step and verify any proposed answer from the same starting board.