RogerBW's Blog

Map Colouring Strategies 06 May 2025

It has been established that no more than four colours are necessary to colour regions of a map with no adjacent regions the same colour. But hoe does one actually go about doing this?

I'm using the "map" puzzle from Simon Tatham's puzzle collection; you can play that here, though the example screenshots are from an Android implementation. Solid regions are known to be a colour; dots are added manually to indicate that this colour is possible for that region.

The most obvious approach is that if a region has three distinct neighbour colours it must take on the fourth one.

Here, since regions 2, 4 and 9 are distinct and all adjoin region 3, 3 must be in the fourth colour (green). That's enough logic for many Easy puzzles.

The doubled pair approach needs two unknown regions, touching each other and a third region, constrained to the same two colours.

Here, 19 and 18 both touch 16, so 16 can only be red or yellow. 24 and 27 both touch 23, so it is similarly constrained. 16 and 23 touch each other, so they can't be the same colour; between the two of them there must be one red and one yellow.

Therefore region 14 can't be either red or yellow, and must be green or blue. (And if it were next to a green, it would definitely be blue.) This is generally enough logic for Normal mode.

The same principle can be extended with any even-length chain of regions:

Here, 23 and 4 make 21 and 28 red/yellow; 27 and 4 make 25 red/yellow; and 4 and 19 make 18 red/yellow. So the four rejoins must either be red-yellow-red-yellow or yellow-red-yellow-red; and either way, region 15 must be blue or green.

Finally of the tricks I've found, a different sort of constraint.

0/12 and 15 constrain 11 to be red or blue. 0/12 and 16 constrain 9 to be red or yellow.

But up to and including Hard mode, we are told that the map must be solvable by logic without trial and error. If 9 were yellow, then 11 would be entirely surrounded by green and yellow, and it could be either red or blue with no way to decide between them, which is an invalid configuration. Therefore 9 must be red, which forces 11 to be blue.

That's clearly not all the necessary logic; it's not enough to solve all Hard puzzles without occasionally guessing and backtracking. Is this something that's been written about elsewhere? Searching mostly finds proofs that four-colouring is possible, which is fair enough, but not what I'm after…

Tags: computing

Add A Comment

Your Name
Your Email
Your Comment

Note that I will only approve comments that relate to the blog post itself, not ones that relate only to previous comments. This is to ensure that the blog remains outside the scope of the UK's Online Safety Act (2023).

Your submission will be ignored if any field is left blank, but your email address will not be displayed. Comments will be processed through markdown.

Search
Archive
Tags 1920s 1930s 1940s 1950s 1960s 1970s 1980s 1990s 2000s 2010s 2300ad 3d printing action advent of code aeronautics aikakirja anecdote animation anime army astronomy audio audio tech base commerce battletech bayern beer boardgaming book of the week bookmonth chain of command children chris chronicle church of no redeeming virtues cold war comedy computing contemporary cornish smuggler cosmic encounter coup covid-19 crime crystal cthulhu eternal cycling dead of winter disaster doctor who documentary drama driving drone ecchi economics en garde espionage essen 2015 essen 2016 essen 2017 essen 2018 essen 2019 essen 2022 essen 2023 essen 2024 existential risk falklands war fandom fanfic fantasy feminism film firefly first world war flash point flight simulation food garmin drive gazebo genesys geocaching geodata gin gkp gurps gurps 101 gus harpoon historical history horror hugo 2014 hugo 2015 hugo 2016 hugo 2017 hugo 2018 hugo 2019 hugo 2020 hugo 2021 hugo 2022 hugo 2023 hugo 2024 hugo-nebula reread in brief avoid instrumented life javascript julian simpson julie enfield kickstarter kotlin learn to play leaving earth linux liquor lovecraftiana lua mecha men with beards mpd museum music mystery naval noir non-fiction one for the brow opera parody paul temple perl perl weekly challenge photography podcast politics postscript powers prediction privacy project woolsack pyracantha python quantum rail raku ranting raspberry pi reading reading boardgames social real life restaurant review reviews romance rpg a day rpgs ruby rust scala science fiction scythe second world war security shipwreck simutrans smartphone south atlantic war squaddies stationery steampunk stuarts suburbia superheroes suspense television the resistance the weekly challenge thirsty meeples thriller tin soldier torg toys trailers travel type 26 type 31 type 45 typst vietnam war war wargaming weather wives and sweethearts writing about writing x-wing young adult
Special All book reviews, All film reviews
Produced by aikakirja v0.1