Gridlock Escape

Reading a jam

Crossings, not cars.

A jam looks like a pile of vehicles. It is really a handful of crossings, and once you can see them most of the pile stops mattering.

Every vehicle has one lane

A vehicle slides along its own length and nowhere else. A horizontal vehicle keeps its row for the whole level, and a vertical one keeps its column. So two vehicles can get in each other’s way in only two ways. They can cross, where a horizontal vehicle’s row meets a vertical vehicle’s column. Or they can share a lane, and then they can never pass each other: a car to the left of the hero in the hero’s row stays on its left for good.

That makes the hero’s path easy to read. In every level of the game the hero stands in the third row from the top and leaves through the right-hand curb, so what matters is the strip of squares between its nose and the curb. A vehicle in that strip is a direct blocker. It has to be vertical: a horizontal vehicle in the hero’s row, ahead of the hero, could never get out of the row, and no level has one.

ABCDEFG
Level 2, par 3. Two vehicles cross the shaded strip: D in column 5 and E in column 3. The other vehicles, B, C, F and G, are in other lanes and never have to move.

In level 2 the strip crosses two columns, so only D and E can be in the way. D is a car and can step up one square. E is a truck and can step down one. Two moves clear the strip, and a third takes the hero out.

That is the best case, and it gives a floor. Each blocker has to move at least once and the hero has to make its last slide, so par is never smaller than the number of blockers plus one. Level 2 sits exactly on that floor. Only two of the 200 levels do; every other level hides more work than the strip shows. (Par and hints explains how par is found.)

A truck has one way out

Where can a blocker go? It can only slide along its column, so it has an exit up and an exit down, and the hero’s row sits at a fixed height, third from the top, with two squares above it and three below. That fixes the exits:

The squares a blocker needs in order to leave tell you what to look at next.

ABCDEFG
Level 12, par 4. Truck C crosses the hero’s strip in column 4. It can only drop to rows 4 to 6, and F and G are parked in rows 5 and 6.

In level 12 the only blocker is truck C. It must end in rows 4 to 6 of column 4, and cars F (row 5) and G (row 6) are parked in two of those squares. So the real problem is not C but F and G. Each of them has to leave column 4, and the only way to do that is one square to the right: sliding left would keep them in the column.

Chains of blockers

A blocker that cannot move because another vehicle stands where it must go is a link in a chain. You follow the chain until you reach a vehicle that is free to move, and that is where the solution starts. Level 12 has a short one: the hero waits for C, C waits for F and G, and F and G are free.

  1. ABCDEFG
    Start
  2. ABCDEFG
    1. F slides 1 square right
  3. ABCDEFG
    2. G slides 1 square right
  4. ABCDEFG
    3. C slides 2 squares down
  5. ABCDEFG
    4. A, the hero, slides 3 squares right and drives out

Solved in 4 moves. Par is 4.

Played from the free end, the chain unwinds by itself. In each drawing the vehicle that just moved has a white outline, and the dotted outline shows where it came from.

Why a long chain beats a long list

Count the vehicles in the hero’s path in all 200 levels and the number hardly changes from the first tier to the last. Par changes a great deal, and so does the room to manoeuvre. The table gives, for each tier, the average number of vehicles in the path, the average par, and the average number of empty squares out of the 36:

Averages over the levels of each tier
Tier In the path Par Empty
Learner 1.7 5.4 19.5
Commuter 2.1 12.6 18.1
Courier 2.3 21.8 13.9
Rescue 2.1 32.0 12.9
Legend 2.0 43.1 10.1

What grows is the depth of the chains and how little free space there is to shuffle in. When a level looks hard, do not count what stands in the way. Count the links in the longest chain, and look for the empty squares that chain could use.

A way to read any board

  1. Shade the strip. Which vehicles stand between the hero and the curb? Those are your direct blockers.
  2. Check each blocker’s exits. A truck can only go down. A car can go up into rows 1 and 2, or down into rows 4 to 6. Cross off an exit when the squares it needs are held by a vehicle that cannot get out of the way.
  3. Ask the same of whatever stands in the exit you kept. That vehicle has its own exits and its own blockers.
  4. Stop at a vehicle that can move right now. That is where the plan begins, and you play it from there back toward the hero.

Reading the chain gives you the list of vehicles that matter. Working backwards turns the list into a plan.