Wanderer <wande...@dialup4less.com> wrote:

>  How
> do you handle this sort of thing in Python?

I believe that the best thing to do is a Union-Find algorithm.

Depending on the exact nature of your problem, you may also want to
check out the Hoshen-Kopelman Algorithm. Although the algorithm itself
is rather efficient, it was born in the context of percolation, that is
to say with the assumption that the "broken" (or colored) cells are much
more likely than in your context.

-- 
-riko
http://www.enrico-franchi.org/
http://rik0-techtemple.blogspot.com/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to