# Maximize my flags

### You are given the next list of 48 flags.

• For each pair of flags that are side by side, you score 1 point per color they share as a frontier. For instance France and Finland score 1 point thanks to the blue.

• We don't require the exact same blues, or same colors here. Common sense will be requested for you to tell this is approximately the same color. I won't accept white of France is same color as yellow of Vatican :)

• Some other examples are Croatia and Denmark score 2 points, while Spain and Norway score 1.

• Greece and Austria don't score points because they are not neighbors.

### Your aim is to find an optimal 6x8 arrangement of those flags to maximize the score. The current score of the above image is 46+28=74 as shown below.

Please look at edit at the end of the puzzle :)

• You must provide a representation of the arrangement like in the puzzle so we can see your solutions. Only solutions with a visual image should be ticked :)

• You can use other images of the flags if you prefer as long as it's the same 48 flags. For instance, this Wikipedia page seems perfect.

• When you are doubting whether two colors are the same, this means they are close enough and you can use them as the same. If you have no doubt, example red and blue totally different, then they are different!

EDIT thanks to a comment now deleted: The flag of North Macedonia is wrong in the picture so it should be a score of two and this is the flag you should use:

EDIT thanks to @oAlt, another good example is Greece and Hungary score 2 points because there are two different segments where white is shared.

• Is there a standard version of the flags (say, accurate up to pixel level)? Some combinations seem to be really tricky to tell the score (with bare eyes). Also it might be useful to give a list of "standard colors", such as yellow, red, blue, green, white, etc., so that one knows which colors should be considered identical. Nov 5, 2020 at 21:25
• For example, is purple considered as a separate color? Some of the purple (e.g. in Croatia) looks closer to black, while some others look closer to blue, and many seem to be in-between. Nov 5, 2020 at 21:33
• @oAlt, Greece and Hungary score 2 points because there are two different segments where white is shared :) I think it's good we keep these comments for next readers :)
– JKHA
Nov 6, 2020 at 11:08
• This is a cool puzzle. In general this problem is NP-Hard. However this particular case we can probably solve optimally. It would be nice if you provided the scores for each pair of flags matched. See here: en.wikipedia.org/wiki/Edge-matching_puzzle Feb 21, 2022 at 14:15
• And what happens to the non-rectangular flag of Nepal? Feb 21, 2022 at 14:18

I suspect this question can only be definitively answered with some clever programming, but here's a slight improvement using just manual placement of flags:

• That's great! I also believe that because the combinatorics are very big and I also think it's unlikely to find an optimal solution by hand!
– JKHA
Nov 11, 2020 at 17:40
• See update about North Macedonia. Nov 15, 2020 at 14:50

...would you mind if I gave a score of...

125? The numbers indicate sums (rows, columns, or neighboring cells.) Colors on the right side of the screen are accepted colors for this puzzle. This is attempt #1 by the way.

• BTW, there are a few "barely" parts, like F5-G5 as 4 instead of 3. Nov 10, 2020 at 10:36
• That's great! I think your Andorra is 7 instead of 8?
– JKHA
Nov 10, 2020 at 13:12
• There's another pixel-perfect part. (Andorra-Czechia, bottom-left pixel) Nov 11, 2020 at 0:00