How does the traffic jam puzzle work?
Cars and trucks are packed into a 6×6 parking lot. Each one can only slide forwards or backwards along its own direction, never sideways and never through another vehicle. Drag them to clear a path for the red car to the exit on the right of its row. With a keyboard, Tab to a vehicle and slide it with the arrow keys.
How is your result calculated?
A move is one vehicle sliding, however far it goes. Moving the same vehicle again straight after counts as the same move, because it could have gone there in one slide. Your result is your number of moves, compared with the fewest possible for that level, and your time from your first move.
How do you know the fewest moves?
By trying everything. A computer can list every position a lot can reach and find the shortest way out with a breadth-first search: first every position one move away, then two, and so on until the red car escapes. There are 12 levels here, needing 4 moves at best for the first and 38 for the last, and the site's tests run that search on every level each time the site is built.
The puzzle was invented by Nob Yoshigahara and has been sold since 1996 as the board game Rush Hour. A computer search by Sébastien Collette, Jean-François Raskin and Frédéric Servais through every possible 6×6 starting position found that the hardest needs 93 moves.
How do you solve traffic jam puzzles?
- Work backwards from the red car. Note which vehicles stand in its way, then what is blocking each of those, and so on. That chain is your plan.
- Trucks are the hard part. A truck across the exit row usually has to go all the way up or down, so check early whether there is room for it.
- Make space before you need it. Moves that look useless, like pushing a car into a corner, often open the lane you need three moves later.
For another puzzle about sliding pieces, try the Sliding Puzzle; for a puzzle about getting everyone across, the River Crossing Puzzle.