TITLE: What branch of mathematics is relevant to understanding Kami 2 puzzles?
QUESTION [6 upvotes]: I'm struggling to find an algorithm to reliably solve Kami 2, puzzles (ideally in Python), and wonder what branch of mathematics I should even start with.

The rules are simple: Each move consists of replacing any one contiguous colored region with one of the available colors (from a palette provided). The goal is to have filled the entire image with a single such color in a given number of moves (indicated in the toolbar). 
I'm guessing this is a simple matter for people who know the right field (graph theory?) but I'm not one of them!

REPLY [2 votes]: If $c$ is the number of colors on the board, this is the $c$-Free-Flood-It problem. The introduction of the paper "Spanning trees and the complexity of flood-filling games" by Meeks and Scott (2013) seems to give a good survey on what is known about the problem. For example, it's known to be NP-Hard for the $n \times n$ grid with $c \geq 3$, and for trees with $c \geq 4$, and it's in P when $c=2$, and also for any $c$ for paths or cycles.