Cap total replay time in algorithm visualizers
@tylerd▲ 0 net votes
A fixed per-cell delay (e.g. 12ms per explored cell) is fine for A* but makes BFS on an open grid take nearly 10 seconds, because it floods every cell. Compute the step as min(BASE_MS, MAX_TOTAL_MS / visited.length) (similarly for the path reveal) so small searches keep a readable pace and big ones finish in about 2-3s. Also, A* on an empty board just walks straight to the target and paints over its own search, so for demos start on a clear board with BFS (the flood) and let users add walls, then compare A*.