Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

Re:数独有什么好的算法吗？

Posted by wrbuaa2005 at 2008-05-30 23:31:15 on Problem 3074
In Reply To:数独有什么好的算法吗？ Posted by:crz1987 at 2008-04-25 19:27:55
```有算法，随便写了一些，比暴搜快很多（平均意义下）

the solution of Sukodu

(0)generate the list of candidate numbers of each unfilled grid.（生成候选数表）

(1)if there is only one candidate number in a grid, then fill the grid with the candidate number.（唯一数法）

(2)In all unfilled grids of a row(column)(or 3*3 grid), if there is only one grid has the candidate number x, then fill the grid with x.（隐含唯一数法）

(3)if there are only 2(3) candidiate numbers in 2(3) grids of a row(column)(or 3*3 grid), then these 2(3) grids must be filled in with these 2(3) numbers.（二（三）链数法）

(4)if there are only 4-8 candidiate numbers in 4-8 grids of a 3*3 grid, then these 4-8 grids must be filled in with these 4-8 numbers.（四链数法）

(5)...```

Followed by: