Skip to main content
100%

Best-First Search II

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Apr 28, 2014

Best-first search solves a maze generated with Wilson’s algorithm, animating the exploration on a black canvas. The solver expands cells in order of Euclidean distance to the goal, highlighting the current best path in magenta while marking visited cells. The maze is drawn cell-by-cell using Canvas 2D `fillRect` calls, with the frontier managed by a custom binary heap. The animation steps through ten frontier expansions per frame via `d3.timer`, and the path is traced by backtracking through parent pointers.

AI-generated description

This maze is generated using Wilson’s algorithm and then solved using best-first search. Compare to random search. See best-first search on a maze generated using random traversal.

gpl-3.0 Licensed

Similar vizzes