n × n盤上にn個のクイーンを配置する解の正確な数、すなわち n × n クイーン グラフのサイズ n の独立集合の数については、既知の公式はありません。27 × 27盤は、完全に列挙された最高次の盤です。[ 5 ]次の表は、既知のすべてのケースについて、 nクイーン問題 の解の数を、基本( OEISのシーケンスA002562 )とすべて( OEISのシーケンスA000170 )の両方について示しています。
def queens ( n : int , i : int , a : list , b : list , c : list ): if i < n : for j in range ( n ): if j not in a and i + j not in b and i - j not in c : yield from queens ( n , i + 1 , a + [ j ], b + [ i + j ], c + [ i - j ]) else : yield afor solution in queens ( 8 , 0 , [], [], []): print ( solution )
def property ( perm : list ) -> bool : for k in range ( 0 , len ( perm )): for j in range ( 0 , len ( perm )): if j < k : if perm [ k ] == perm [ j ]: return False elif abs ( perm [ k ] - perm [ j ]) == k - j : return False return Truedef extend ( perm : list , n : int ): new_perm = [ ] for p in perm : for i in range ( 0 , n ): new_perm.append ( p + [ i ] ) return new_permdef n_queens ( n : int ) -> int : domain = list ( range ( 0 , n )) perm = [[]] for i in range ( n ): new_perm = list ( filter ( property , extend ( perm , n ))) perm = new_perm return len ( perm )
↑J. Barr and S. Rao (2006), The n-Queens Problem in Higher Dimensions, Elemente der Mathematik, vol 61 (4), pp. 133–137.
↑Martin S. Pearson. "Queens On A Chessboard – Beyond The 2nd Dimension"(php). Retrieved 27 January 2020.
↑Chatham, Doug (1 December 2018). "Reflections on the n +k dragon kings problem". Recreational Mathematics Magazine. 5 (10): 39–55. doi:10.2478/rmm-2018-0007.
↑G. Pólya, Uber die "doppelt-periodischen" Losungen des n-Damen-Problems, George Pólya: Collected papers Vol. IV, G-C. Rota, ed., MIT Press, Cambridge, London, 1984, pp.237–247
↑Burger, A. P.; Cockayne, E. J.; Mynhardt, C. M. (1997). "Domination and irredundance in the queens' graph". Discrete Mathematics. 163 (1–3): 47–66. doi:10.1016/0012-365X(95)00327-S. hdl:1828/2670. MR1428557.
↑Weakley, William D. (2018). "Queens around the world in twenty-five years". In Gera, Ralucca; Haynes, Teresa W.; Hedetniemi, Stephen T. (eds.). Graph Theory: Favorite Conjectures and Open Problems – 2. Problem Books in Mathematics. Cham: Springer. pp.43–54. doi:10.1007/978-3-319-97686-0_5. ISBN978-3-319-97684-6. MR3889146.
↑"Queens and knights problem". Archived from the original on 16 October 2005. Retrieved 20 September 2005.
↑Bell, Jordan; Stevens, Brett (2009). "A survey of known results and research areas for n-queens". Discrete Mathematics. 309 (1): 1–31. doi:10.1016/j.disc.2007.12.043.
↑O. Demirörs, N. Rafraf, and M.M. Tanik. Obtaining n-queens solutions from magic squares and constructing magic squares from n-queens solutions. Journal of Recreational Mathematics, 24:272–280, 1992
↑ Gent, Ian P.; Jefferson, Christopher; Nightingale, Peter (2017年8月) 「n -Queens Completionの複雑性」人工知能研究ジャーナル59 : 815–848 . doi : 10.1613/jair.5512 . hdl : 10023/11627 . ISSN 1076-9757 . 2017年9月7日取得。
↑ Glock, Stefan; Correia, David Munhá; Sudakov, Benny (2022年7月6日). " n-クイーン完全問題" . Research in the Mathematical Sciences . 9 (41): 41. doi : 10.1007/s40687-022-00335-1 . PMC 9259550 . PMID 35815227 . S2CID 244478527 .
↑ Drakakis, K., Gow, R., Rickard, S. (2009). "コスタス配列間の共通距離ベクトル". Advances in Mathematics of Communications . 3 (1): 35– 52. doi : 10.3934/amc.2009.3.35 . ISSN 1930-5338 .
↑上原隆平 (2019). 「5.1 八女王パズル」. 『パズルを通して学ぶアルゴリズム入門』 . Springer Singapore. pp. 111–118 . doi : 10.1007/978-981-13-3188-6 . ISBN9789811331886。
↑ Rok SosicとJun GuによるNクイーン問題のための多項式時間アルゴリズム(1990年)。メモリの制約により実行できた最大数である50万個のクイーンまでの実行時間を記述している。
↑ Minton, Steven; Johnston, Mark D.; Philips, Andrew B.; Laird, Philip (1 December 1992). "Minimizing conflicts: a heuristic repair method for constraint satisfaction and scheduling problems" . Artificial Intelligence . 58 (1): 161– 205. doi : 10.1016/0004-3702(92)90007-K . hdl : 2060/19930006097 . ISSN 0004-3702 . S2CID 14830518 .
↑ Sosic, R.; Gu, Jun (1994 年 10 月). "衝突最小化による効率的な局所探索: n クイーン問題のケーススタディ". IEEE Transactions on Knowledge and Data Engineering . 6 (5): 661–668 . Bibcode : 1994ITKDE...6..661S . doi : 10.1109/69.317698 . ISSN 1558-2191 .
Allison, L.; Yee, CN; McGaughey, M. (1988). 「3次元NxNクイーン問題」 . オーストラリア、モナシュ大学コンピュータサイエンス学部。
Nudelman, S. (1995). "高次元におけるモジュラーNクイーン問題" . Discrete Mathematics . 146 ( 1–3 ): 159–167 . doi : 10.1016/0012-365X(94)00161-5 .
エンゲルハルト、M. (2010 年 8 月)。「Der Stammbaum der Lösungen des Damenproblems (ドイツ語で、8 クイーン問題の解決策の系統図を意味します)」 . Spektrum der Wissenschaft : 68–71 .
「高次元におけるモジュラー N クイーン問題について」、Ricardo Gomez、Juan Jose Montellano、Ricardo Strausz (2004)、Instituto de Matematicas、Area de la Investigacion Centifica、Circuito Exterior、Ciudad Universitaria、メキシコ。