I think you could loop until all particles touch a...
# advent-of-code
m
I think you could loop until all particles touch another particle. I guess that check could be a bit cpu-intensive though.