How kumaryash-2808/cube_solver works
This is a full-stack Rubik’s Cube solver: users edit or randomize a cube in a 3D browser interface, then request a solution through the Python server and its documented Kociemba API bridge. Separately, the repository includes an interactive C++ console solver that validates sticker input, converts it to cubie state, and runs the two-phase search. The C++ flow is supported by excerpts and the source index; frontend/server links rely on README descriptions, so details of their internal wiring are not asserted.
Main entry points: main.cpp Console solver · heuristictable.cpp Pruning heuristics · script.js 3D cube UI · kociemba_ph1.cpp Phase one search
Components 20
Web interface
- 3D cube UI
frontend/script.js - UI controls
frontend/index.html - 3D presentation
frontend/style.css
Solver service
- HTTP/API bridge
server.py - Python Kociemba
Cube representation
- Sticker entry
backend/inputproc/cube_inp.cpp - Sticker conversion
backend/main.cpp - Cubie inference
backend/inputproc/stk_to_cub.cpp - Cubie state
backend/inputproc/cubie.hpp
C++ search
- Console solver
backend/main.cpp - Move engine
backend/rubicsmove/cubemove.cpp - Phase one search
backend/kociemba/kociemba_ph1.cpp - Phase one DFS
backend/kociemba/DFS.cpp - Phase two search
backend/kociemba/DFS2.cpp - Pruning heuristics
backend/bfstable/heuristictable.cpp - Coordinate encoding
backend/bfstable/encoder.cpp - Pruning table BFS
backend/bfstable/bfs.cpp - Pruning tables
backend/tables
Other components
- Cube user
- Console user
Connections 23
- Cube user → 3D cube UI: edits cube
README.md - 3D cube UI → UI controls: uses controls
README.md - 3D cube UI → 3D presentation: renders with
README.md - 3D cube UI → HTTP/API bridge: requests solution
README.md - HTTP/API bridge → Python Kociemba: bridges to
README.md - Console user → Console solver: enters stickers
backend/main.cpp - Console solver → Sticker entry: opens editor
backend/main.cpp - Console solver → Sticker conversion: maps colors
backend/main.cpp - Console solver → Cubie inference: infers cubies
backend/main.cpp - Cubie inference → Cubie state: produces state
backend/inputproc/stk_to_cub.cpp - Console solver → Phase one search: starts search
backend/main.cpp - Console solver → Pruning heuristics: loads tables
backend/main.cpp - Phase one search → Phase one DFS: dispatches DFS
backend/kociemba/kociemba_ph1.cpp - Phase one DFS → Move engine: applies moves
backend/kociemba/DFS.cpp - Phase one DFS → Phase two search: starts phase two
backend/kociemba/DFS.cpp - Phase one search → Coordinate encoding: encodes coordinates
backend/kociemba/kociemba_ph1.cpp - Phase one search → Pruning heuristics: reads estimates
backend/kociemba/kociemba_ph1.cpp - Phase two search → Coordinate encoding: encodes coordinates
backend/kociemba/DFS2.cpp - Phase two search → Pruning heuristics: reads estimates
backend/kociemba/DFS2.cpp - Phase two search → Move engine: applies moves
backend/kociemba/DFS2.cpp - Pruning heuristics → Pruning table BFS: generates tables
backend/bfstable/heuristictable.cpp - Pruning heuristics → Pruning tables: loads or saves
README.md - Pruning table BFS → Move engine: traverses moves
backend/bfstable/bfs.cpp