Interactive demo

Rush Hour

Slide the cars and trucks out of the way and drive the red car out of the traffic jam. Vehicles only move forward and backward along their lane. Every puzzle here was made by a computer, and a solver always knows the shortest way out.

Beginner, level 1

Drag a vehicle along its lane, or select it with Tab and use the arrow keys (with Shift it slides all the way). You can switch between 2D and 3D at any time.

View

Game

Moves
0
Minimum
4

Puzzle

Green dot: solved. Gold dot: solved in the minimum number of moves.

The rules

  1. Vehicles only move forward or backward, never sideways, and cannot pass each other.
  2. Sliding one vehicle, however far, counts as one move.
  3. The puzzle is solved when the red car reaches the exit on the right.

The shortest way out

Every arrangement of the vehicles is a node in a graph, every move an edge. A breadth-first search from the current arrangement visits all arrangements one move away, then two, then three. The first time the red car reaches the exit, no shorter solution exists. The hints and the solution come from this search.

How the puzzles are made

Random vehicles are placed on the board, and every arrangement reachable from them is collected: a cluster. A second search runs backwards from all solved arrangements and gives each one its distance to the goal; the farthest one is the hardest puzzle of the cluster. For expert puzzles, vehicles are added, removed and moved as long as it gets harder. Finally, every vehicle that does not change the solution is taken away. The hardest possible puzzle needs 51 moves.

Credits

  • Rush Hour was invented by Nob Yoshigahara in the 1970s and is sold by ThinkFun, which owns the name: Rush Hour by ThinkFun. This page is a fan-made version with its own computer-generated puzzles.
  • How the puzzles are generated (clusters, their hardest state, leaving out vehicles that do not matter) and the 51-move maximum come from Michael Fogleman's Solving Rush Hour, the Puzzle.