An unexpected fractal
Some time ago I wrote a program for visualizing search algorithms in a grid. A relatively simple Breadth first search that mutates its color on each search depth over a grid.
Nice plots. Extremely slow.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
So I tried to rewrite it in a more efficient fashion, but somewhere on the process I made a mistake in the code, and there it was: an unexpected fractal suddenly appeared.
This is a centered view, the ‘square shape’ repeats as it grows. I still don’t know what went wrong, but I’m happy with the result.
Galery
I decided that before fixing the bug I would make a few more tests. Funny thing is that when changing the kernel (neighborhood) the fractal nature is conserved, presumably linear transformations of a fractal transformation are indeed fractals. Here are some of the results for different kernels and number of seeds.



















