BFS wavefront

BFS wavefront preview
remixableManimCE2Dalgorithmsloop

manim/bfs_wavefront.py

"""BFS wavefront: a front spreading ring by ring across a walled grid.

Render (the driver does this for every palette; these are for eyeballing):
    P=/opt/homebrew/opt/python@3.11/bin/python3.11
    ASSET_MODE=still  $P -m manim -s -t -r 1600,1600 manim/bfs_wavefront.py BfsWavefront
    ASSET_MODE=motion $P -m manim -qh   -r 1600,1600 manim/bfs_wavefront.py BfsWavefrontLoop
"""

from collections import deque

from manim import (
    Line,
    Square,
    Text,
    ValueTracker,
    VGroup,

The full Manim source and the rendered video come with a plan.