Java 22+ · Swing · Explainable search

Play the puzzle.
Inspect the search.

KlotskiPuzzle combines a playable Huarong Dao board with deterministic BFS, Greedy Best-First, A*, and Weighted A* experiments. See what the solver expands, why candidates are accepted or rejected, and how the final path moves the board.

Windows portable package includes its own runtime. Source builds require Java 22+ and Maven 3.9+.

KlotskiPuzzle demonstrates background A star search and Swing solution playback Actual project demo · original generated assets
4search strategies
2movement contracts
72tests on current main
MITcode and original assets

Reproducible evidence on current main

Four strategies, one declared contract

The checked-in report runs BFS, Greedy Best-First, A*, and Weighted A* over the same tutorial puzzle, Cell Step rule, 250,000-state limit, and deterministic tie-breaking. It exports TSV plus four versioned JSON Experiment Records instead of relying on a hand-copied timing table.

This command was added after v2.0.0-beta.1. The Release remains the current Windows and JAR preview; the report belongs to current main.

Read the report and reproduce it →
Expanded states for BFS, Greedy Best-First, A star, and Weighted A star under one tutorial Cell Step contract

One result, three levels of explanation

More than a timing table

01

Search Overview

Follow exact expanded, discovered, frontier, solution, and elapsed metrics while the experiment runs off the Swing event thread.

02

State Inspector

Review an expanded board, its candidate moves, their scores, and the explicit reason each candidate entered or left consideration.

03

Solution Replay

Step backward, play, pause, advance, or jump through a validated solution path, then export a versioned JSON Experiment Record.

Built for algorithm and Java learners

From isolated examples to a runnable system

Use one repository to study multi-cell puzzle modeling, shared human/solver movement rules, deterministic priority ordering, bounded search, background work, EDT-safe playback, bilingual Swing UI, persistence boundaries, and JUnit verification.

Explore the architecture →
Quick start
git clone https://github.com/44-99/KlotskiPuzzle.git
cd KlotskiPuzzle
mvn clean verify
mvn exec:java

Transparent preview boundary

Useful now, not pretending to be finished

The v2.0.0-beta.1 preview includes the interactive walkthrough, inspector, replay, and JSON export. Current main adds a reproducible CLI comparison. Puzzle import/export, complete compressed traces, interactive side-by-side comparison, HTML reports, and broader responsive Play Mode work remain on the public roadmap.

View roadmap

简体中文

可玩的华容道,也是可解释的算法实验室

KlotskiPuzzle 面向算法学习者、Java 学生和初级开发者。你可以运行 BFS、贪心最佳优先、A* 与加权 A*,查看搜索概览、检查候选状态为什么被接受或拒绝、逐步回放最终解法,并导出可复查的 JSON 实验记录。