# Nonogram Puzzle 規則

  1. Input 1000 nonogram puzzles with size 25 * 25
  2. symbol "$" before the puzzles number
  3. 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
  4. "0" 表示填空白,"1" 表示填黑色
  5. All the numbers of clues and solutions are separated by TAB
  6. Each program solves these puzzles in order (cannot skip)
  7. For the puzzles with multiple solutions, the program only needs to generate 1 solution
  8. 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 有沒有解,如果有解再將相關的行和列再次丟入。

  1. 確認是否有解
    • Fix() : 看 paint 有沒有結束,且有沒有解
    • Fix0() : 看 paint 填 0 可不可以
    • Fix1() : 看 paint 填 1 可不可以
  2. 將有解確定盤面有解的盤面試著填點
    • Paint() : 看是否 paint 結束
    • Paint'() : 需要畫哪個盤面, paint0, paint1, merge
    • Paint0() : 填入 0
    • Paint1() : 填入 1
    • Merge() : 看填入 0 或填入 1 有沒有相同的

# Fully Probing

# Backtracking