I Solved Klotski
Channel:2swap · Length:12:19 · Published:2025-08-22 · Views:2081728
Summary
2swap explains how he solved the Klotski sliding-block puzzle by mapping its full state space as a graph and visualizing it. The video includes footage of the Guinness world-record solve and links to an interactive graph.
Why HN recommends it
HN people point to it for intuition about why some games are hard to navigate and for its Rush Hour and graph visualizations.
the state space of the game can produce some intuition on why certain games are hard — HN, 2025
Data visualization & information design · Algorithms & data structures · Chess, board games & puzzles
Subtitles (excerpt)
This is a random agent exploring the state space of a sliding block puzzle. The puzzle is called Klotski. These block puzzles are quite common, but aside from just being puzzles, these sliding blocks define graphs, modeling convoluted topologies with their local substructure, as well as their global superstructure. Often, it's a 6x6 grid, where the solution is to free this block from the hole on the right. We can't do that yet, since this piece is in the way... Let's represent the current position of the puzzle as a node. If we make one move on the puzzle, we arrive at a different node. Since these positions are just one move apart, We draw an edge connecting the two nodes. Each node is connected to a few more, forming a labyrinth of paths. You might start to wonder- if we add all the nodes, what would the graph look like? Maybe it has some overarching structure... such as a grid, Or maybe it's a total mess! To build some intuition, here's a few contrived puzzles first. With just one block, there's only one degree of freedom. With two, you get the cartesian product of their coordinates, yielding a grid. Each block defines a different axis of motion. Three blocks make a 3d lattice, and with 4 degrees of freedom, the graph naturally extends to a hypercube!
On Hacker News
This looks similar to the graphs on "2swap"[1]. Worth a watch if you haven't by now. [1] [VIDEO] — sublinear, 2026-02
Great article, very impressive to solve the entire game, rather than just individual puzzles. PS: Good chance that if you're reading these comments that you will appreciate this video by 2swap, visualising solutions to Rush Hour in 3D: [VIDEO] — ohc, 2025-12
This reminds me of this nice video : [VIDEO] basically, the state space of the game can produce some intuition on why certain games are hard, and is demonstrated as a clustering of various states that are only linked to the winning state by a very small number of edges. So a player can easily "get lost" in the maze. — chii, 2025-09
This is an interactive accompaniment to a video that contains more information: [VIDEO] (previously discussed a bit at [LINK] ) — dzaima, 2025-09
Related videos
- Quantum Entanglement & Spooky Action at a Distance · Veritasium · 9:15
- Is AI Safety a Pascal's Mugging? · Robert Miles AI Safety · 13:41
- The Halo Drive · Cool Worlds · 17:33
- Wealth Inequality in America · politizane · 6:23
- Renting vs. Buying a Home: The 5% Rule · Ben Felix · 10:36
- I tried using AI. It scared me. · Tom Scott · 15:49
- Feynman: How to think 1 of 2 FUN TO IMAGINE 11 · Christopher Sykes · 6:24
- TUN: Un-Ruining the MMO · MrBtongue · 14:05
- How close is nuclear fusion power? · Sabine Hossenfelder · 12:49
- Larynx Demo · synesthesiam · 6:39
- Building a Cathedral without Science or Mathematics: The Engineering Method Explained · engineerguy · 11:54
- A Better Default Colormap for Matplotlib | SciPy 2015 | Nathaniel Smith and Stéfan van der Walt · Enthought · 19:08
- Hans Rosling's 200 Countries, 200 Years, 4 Minutes - The Joy of Stats - BBC · BBC · 4:47
- AlphaGo - The Movie | Full award-winning documentary · Google DeepMind · 1:30:28
- CppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step” · CppCon · 59:33
- Computer program that learns to play classic NES games · suckerpinch · 16:17