Sign up ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I wrote a small program in C++ to arrange wall tiles so that it minimised patterns. I did not want a 'random' pattern as that would have allowed 2 red tiles next to each other. I did this by defining a set of patterns and weighting each set then iterating many times over a grid of tiles moving them, re-scoring the result and keeping the best. I imagine there is a more mathematical way to achieve this but I don't know what to search for.

share|cite|improve this question
What sort of patterns do you want to minimize? – Jonah Sinick Nov 1 '12 at 15:40
If you consider two of the same color being neighbors a "pattern," that's a broader meaning of pattern than tends to be used by mathematicians. "Pattern" is usually used to describe a global property - "all red squares are next to a blue square" is a pattern. Even "50% of red squares are next ot a blue square" is a pattern. "One red square is next another red square" is not a pattern. – Thomas Andrews Nov 1 '12 at 15:47
In fact, banning adjacent tiles having the same colour can lead to very strong patterns. If you have two colours in a square grid, and you don't allow two (orthogonally) adjacent squares to be the same colour, then you've forced yourself into a regular chessboard pattern. – Chris Eagle Nov 1 '12 at 15:52
I had 4 colours and as I said weighted rather than banned patterns. The kitchen is now tiled and it achieved exactly the effect I wanted (no patterns) but I ran the program overnight to achieve a kitchen's worth of arrangement. – Ant Nov 1 '12 at 16:04
@Jonah Anything that the human identifies as a pattern. So same coloured tiles in a row, more than 3 diagonally, crosses made of only 2 colours. Anything that doesn't look 'random' in the 'no pattern' sense of the word. – Ant Nov 1 '12 at 16:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.