🐍 Snake Path Planning Lab: Hamiltonian Cycle, Safe Shortcuts and BFS vs Greedy
Watch a snake solve its board with a Hamiltonian cycle (guaranteed completion), cycle shortcuts, BFS and greedy chasing; the measured moves to fill the board are checked against the closed-form expectation N^2(N^2-3)/4.
Algorithms & AI3DModerate60 FPS📱 Mobile-adapted🟠 Blender
⚙ Under the hood
A snake that fills its whole board without crashing: follow a Hamiltonian cycle, take safe shortcuts along it, or plan with BFS and greedy chasing. The measured moves to fill the board are compared with the closed form N^2(N^2-3)/4 and the best shortcut cut-off is found by experiment.
hamiltonian cyclepath planningBFSexpected valuegrid graph
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install