I'm working on a program supposed to solve a "Virus game". In short, we get a I x J board filled with fields coloured from an n-element colour pool. We start by marking the [0,0] field as "visited". The goal is to mark all fields as visited in the lowest amount of steps, each step being: choose a colour from the pool and colour each visited field with it. Then mark each field in regions neighboring visited fields of the same color as them as visited.
I've got some ideas about how to approach this problem, but I'd appreciate it if someone could point me to some good algorithm that I could modify to work in a reasonable time.
Here is the game link for reference if my explaination is unclear http://www.gry.pl/gra/virus_3