有沒有好的演算法程式設計解決數獨的正確答案?

時間 2022-01-22 21:53:53

1樓:苦命人

要培養豐富的想象力,要培養紮實的演算法素養。

2樓:潘民科

介紹乙個大多數回答裡頭沒提過的演算法,Crook's Algorithm。作者提到了乙個概念叫 Preemptive Set —— 一種 "reduces the number of combinations in a clever way" 的方法。

A preemptive set is composed of numbers from the set [1, 29] and is a set of size m, 2 ≤ m ≤9, whose numbers are potential occupants of m cells exclusively, where exclusively means that no other numbers in the set [1, 29] other than the members of the preemptive set are potential occupants of those m cells.

誰看懂了告訴我。

參考文獻

[1] Solve Sudoku more elegantly with Crook』s algorithm in Python

[2] Mathematics and Sudokus: Solving Algorithms (II)

3樓:

Knuth神的dancing links. 我用它寫過解題程式。

4樓:流觴-鶩

有1 Solving Every Sudoku Puzzle

2 Sudoku solving algorithms

有沒有什麼學習程式設計的好方法?

豆腐 其實我覺得如果你還是在學校,可以去學習一下程式設計,如果已經工作了,在沒有機會參與到程式設計工作中,其實沒必要學習,現在都是需要很多部門合作完成的,個人學習很難 Jarvis 1.深入學習一門程式語言比如cpp 2.學習資料結構與演算法,比如刷完leetcode的資料結構與算題3.學習作業系統...

成為數獨高手有哪些好的訓練方法?

喵喵Limo 數獨專業方法數獨學院介紹 數獨專業方法四角對角線法則 多練習就很快了。我之前有部諾基亞的6300,裡面有個Flash的數獨,每天利用空閒的時候玩會,從easy到hard有200關,我玩到199關。速度越來越快。 醜少女 自己要有興趣,然後沒事就玩這個,隨時玩。不開心的時候也玩。多了發現...

有沒有可以解數獨的軟體?

不妨機械降神 import numpy as np f NNNNN3N5N 85NN7NNN4 7N2N5N1NN NNNN67NN5 N8NN916N2 N75NNN9N8 NNNN3N789 NN7NN25N1 5NNN1NNN3 f x for x in f.split n if len x ...