# Nonogram Puzzle 規則
- Input 1000 nonogram puzzles with size 25 * 25
- symbol "$" before the puzzles number
- 50 lines of clues (puzzles description)
- The former 25 are clues at the top end from up to down
- The former 25 are clues at thr left end from left to right
- "0" 表示填空白,"1" 表示填黑色
- All the numbers of clues and solutions are separated by TAB
- Each program solves these puzzles in order (cannot skip)
- For the puzzles with multiple solutions, the program only needs to generate 1 solution
- All of the programs will run on the same machine, use single CPU core.
# Solving
一個 NP 完全問題 (NP - complete problems)
# A Three-Stage Nonogram Solving Framework
# Propagation
Contionuously applies line solving to all rows and colums until no more pixels can be painted.
解一行或一列,看填 0 或填 1 有沒有解,如果有解再將相關的行和列再次丟入。
- 確認是否有解
Fix()
: 看 paint 有沒有結束,且有沒有解Fix0()
: 看 paint 填 0 可不可以Fix1()
: 看 paint 填 1 可不可以
- 將有解確定盤面有解的盤面試著填點
Paint()
: 看是否 paint 結束Paint'()
: 需要畫哪個盤面, paint0, paint1, mergePaint0()
: 填入 0Paint1()
: 填入 1Merge()
: 看填入 0 或填入 1 有沒有相同的