{"title":"亨利五世:一个线性时间算法解决n皇后问题,只使用5个模式","authors":"A. Dehghani, Reza Namvar, Abdullah Khalili","doi":"10.1109/CSICC58665.2023.10105390","DOIUrl":null,"url":null,"abstract":"It has been known that the time complexity of solving the N-Queens problem, a classic problem with many applications in computer science is Nondeterministic Polynomial (NP). Many different approaches have been proposed for solving the problem since its first presentation in 1848 including genetic algorithms, brute force search and propositional logic statements. In this paper, a novel idea called Layouts have been proposed to solve this problem in θ(n) time complexity. Layouts are patterns for placing queens on the chessboard. Correctness of the proposed approach has been proven for all natural numbers using proof by contradiction and exhaustion. It is shown that by using only 5 layouts, N-Queens with any size can be solved in linear time. The proposed approach has been verified by being applied to 60 different sizes of the N-Queens problem where the size has been chosen by randomly selecting a number between 1000 and 10000.","PeriodicalId":127277,"journal":{"name":"2023 28th International Computer Conference, Computer Society of Iran (CSICC)","volume":"17 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2023-01-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Henry V: A linear time algorithm for solving the N-Queens Problem using only 5 patterns\",\"authors\":\"A. Dehghani, Reza Namvar, Abdullah Khalili\",\"doi\":\"10.1109/CSICC58665.2023.10105390\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"It has been known that the time complexity of solving the N-Queens problem, a classic problem with many applications in computer science is Nondeterministic Polynomial (NP). Many different approaches have been proposed for solving the problem since its first presentation in 1848 including genetic algorithms, brute force search and propositional logic statements. In this paper, a novel idea called Layouts have been proposed to solve this problem in θ(n) time complexity. Layouts are patterns for placing queens on the chessboard. Correctness of the proposed approach has been proven for all natural numbers using proof by contradiction and exhaustion. It is shown that by using only 5 layouts, N-Queens with any size can be solved in linear time. The proposed approach has been verified by being applied to 60 different sizes of the N-Queens problem where the size has been chosen by randomly selecting a number between 1000 and 10000.\",\"PeriodicalId\":127277,\"journal\":{\"name\":\"2023 28th International Computer Conference, Computer Society of Iran (CSICC)\",\"volume\":\"17 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2023-01-25\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2023 28th International Computer Conference, Computer Society of Iran (CSICC)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/CSICC58665.2023.10105390\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2023 28th International Computer Conference, Computer Society of Iran (CSICC)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/CSICC58665.2023.10105390","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Henry V: A linear time algorithm for solving the N-Queens Problem using only 5 patterns
It has been known that the time complexity of solving the N-Queens problem, a classic problem with many applications in computer science is Nondeterministic Polynomial (NP). Many different approaches have been proposed for solving the problem since its first presentation in 1848 including genetic algorithms, brute force search and propositional logic statements. In this paper, a novel idea called Layouts have been proposed to solve this problem in θ(n) time complexity. Layouts are patterns for placing queens on the chessboard. Correctness of the proposed approach has been proven for all natural numbers using proof by contradiction and exhaustion. It is shown that by using only 5 layouts, N-Queens with any size can be solved in linear time. The proposed approach has been verified by being applied to 60 different sizes of the N-Queens problem where the size has been chosen by randomly selecting a number between 1000 and 10000.