{"id":476,"date":"2024-02-18T09:48:38","date_gmt":"2024-02-18T14:48:38","guid":{"rendered":"https:\/\/www.notexponential.com\/notes\/?page_id=476"},"modified":"2024-02-18T09:48:38","modified_gmt":"2024-02-18T14:48:38","slug":"project-2-csp-nqueens","status":"publish","type":"page","link":"https:\/\/www.notexponential.com\/notes\/artificial-intelligence\/projects\/project-2-constraint-satisfaction-problems-csp\/project-2-csp-nqueens\/","title":{"rendered":"Project 2 &#8211; CSP &#8211; NQueens"},"content":{"rendered":"\n<p>Write a program that solves N-Queen in n*n grid. &nbsp;&nbsp;Start with a random board, with one queen in each column.&nbsp; Use iterative search algorithm.<\/p>\n\n\n\n<p><strong>Constraints:&nbsp; <\/strong>10 &lt;= n &lt;= 1000<\/p>\n\n\n\n<p><strong>Input Format: <\/strong>A file with n lines; each line has the column location of the i-th row\u2019s queen. Read the comments in the sample file. You have n-queen.txt as a sample file. You code should work with any n. <strong><em><br><\/em><\/strong><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Algorithm<\/h1>\n\n\n\n<p>Write a CSP algorithm to solve this problem.&nbsp; The CSP algorithm should have the following components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Search algorithm to solve the CSP<\/li>\n\n\n\n<li>Heuristics (min remaining values, least constraining value, tie breaking rules)<\/li>\n\n\n\n<li>Constraint propagation using AC3.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Write a program that solves N-Queen in n*n grid. &nbsp;&nbsp;Start with a random board, with one queen in each column.&nbsp; Use iterative search algorithm. Constraints:&nbsp; 10 &lt;= n &lt;= 1000 Input Format: A file with n lines; each line has the column location of the i-th row\u2019s queen. Read the comments in the sample file. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":469,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-476","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.notexponential.com\/notes\/wp-json\/wp\/v2\/pages\/476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.notexponential.com\/notes\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.notexponential.com\/notes\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.notexponential.com\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.notexponential.com\/notes\/wp-json\/wp\/v2\/comments?post=476"}],"version-history":[{"count":1,"href":"https:\/\/www.notexponential.com\/notes\/wp-json\/wp\/v2\/pages\/476\/revisions"}],"predecessor-version":[{"id":477,"href":"https:\/\/www.notexponential.com\/notes\/wp-json\/wp\/v2\/pages\/476\/revisions\/477"}],"up":[{"embeddable":true,"href":"https:\/\/www.notexponential.com\/notes\/wp-json\/wp\/v2\/pages\/469"}],"wp:attachment":[{"href":"https:\/\/www.notexponential.com\/notes\/wp-json\/wp\/v2\/media?parent=476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}