Grid Loops

Jan 24, 2005 4 Replies

If you made, say a 100 x 100 Grid of dots and joined some of them together so that they made squares and rectangles, what method do you use (in programming) to find all the possible squares and rectangles (loops) in any generated combination?



----------------------------------------------------------------------- Ashley Clarke



-------------------------------------------------------


I can't help you with the algorithm, but I remember seeing an art exhibition that displayed a 32x32(?) grid of black or white squares, that generated all the possible combinations. I think the program was running for several years, and I think it will take thosands or millions of years on a PC to complete all possible permutations!!! So I hope you have access to a supercomputer or more?

I will see if I can find it for you.

Cheers

Dale

Wouldn't this just use a floodfill algorithm?

Yes for each individual group of dots connected to make the smallest square possible but not when these combine to produce other larger squares and polygons around them.

----------------------------------------------------------------------- Ashley Clarke

Its for only finding the loops in one pattern at a time, not for every possible combination it can generate (I meant - for any combination you throw at it). The grid dots will be connected manually as sets of nodes and vectors.

----------------------------------------------------------------------- Ashley Clarke

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required