Home▸Algorithms & AI▸Snake Path Planning Lab (2D): Hamiltonian Cycle, Shortcuts, BFS and Greedy

🐍 Snake Path Planning Lab (2D): Hamiltonian Cycle, Shortcuts, BFS and Greedy

2D snake path planning lab: Hamiltonian cycle, safe shortcuts, BFS and greedy strategies with measured moves to fill the board checked against N^2(N^2-3)/4.

Algorithms & AI2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
Snake Path Planning Lab (2D): Hamiltonian Cycle, Shortcuts, BFS and Greedy ↗ Open standalone
⚙ Under the hood

2D board view of a self-playing snake: Hamiltonian cycle, safe cycle shortcuts, BFS with tail check, unsafe BFS, greedy and manual play, with the measured moves to fill the board compared with the closed form N^2(N^2-3)/4 and three in-page checks.

SnakeHamiltonian CyclePath PlanningBFSAlgorithms

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)