Skip to content

Latest commit

 

History

History
34 lines (20 loc) · 773 Bytes

README.md

File metadata and controls

34 lines (20 loc) · 773 Bytes

sudoku 数独

Objective

Fill a 9x9 grid with digits

Rules

  1. Each row contains the numbers 1 to 9
  2. Each column contains the numbers 1 to 9
  3. Each box contains the numbers 1 to 9

Binary Constraint Satisfaction Problem

Variables

Variable for each tile in the sudoku grid with a total of 81 variables. Variable is a combination of a letter indicating the row, and a digit indicating the column.

X = {X1, X2, ..., X81}

Domains

Each variable Xi has the domain of the digits [1,9]

D = {D1, D2, ..., D81}

Di = {1, 2, 3, 4, 5, 6, 7, 8, 9}

Constraints

The value of each variable Xi cannot be equal to any value in its:

  • Row
  • Column
  • Box