How marreco202/slidingpuzzlesolver works
Project type and purpose
• This is a single‐language open‐source tool (Python) whose sole responsibility is to solve the 3×3 sliding puzzle.
• It generates the complete state graph (all 9! states), links valid moves as edges, runs a BFS traversal to compute metrics (max depth, node count, edge count, connected components), and outputs results to the console.
File structure
• Top level:
• main.py – the entry point and orchestrator.
• requirements.txt – Python dependencies (e.g., networkx or any graph library).
• README.md – project description, algorithms, and math.
• images/ – sample puzzle images for documentation only.
• .gitignore – standard VCS excludes.
• No backend/frontend split, no database or external service. All work is done in-memory via Python data structures.
Key insights from README
• Graph of size 362,880 vertices (9!).
• Recursive permutation generator without a conventional base case but driven by target length.
• Edge creation based on blank-tile adjacency (up/down/left/right).
• BFS used for solving and for computing graph properties.
• Two connected components arise from parity considerations in permutation groups.