Algorithm and data structure for solving the game “Globs”/flood fill/“FloodIt”

后端 未结 7 2185
感情败类
感情败类 2021-01-31 19:35

Suggest an algorithm and data structure for solving the game Globs (http://www.deadwhale.com/play.php?game=131). It\'s pretty fun in a geeky kind of way.

State t

7条回答
  •  南旧
    南旧 (楼主)
    2021-01-31 20:01

    Another approach is to use genetic algorithms. Since any (partial) solution consists of a list of colors, it translates very nicely to a gene. A fitness function could be something like 4 times the connected component minus the number of colors used total (length of gene).

    I tried this on 10x10 boards in Mathematica, with a very non-optimized algorithm, and got a short solution rather quickly. I do not claim it is optimal, but given enough time, the randomness in the process of mutating the genes will ensure that you eventually ends up with an optimal solution.

提交回复
热议问题