A well-known classic chessboard problem is that of placing N Queens on an N × N chessboard such that no two queens are able to attack each other (A Queen can attack in any direction, either in the same row, column or even diagonal). This is further generalized to three dimensions (N × N × N cube). An implementation of double backtracking algorithm to generate solutions for a certain value of N in a three dimensional space is discussed in this paper. The approach finds all the two dimensional solutions for a given N and records these. These two dimensional solutions are then stacked on top of one another such that no queen is present vertically on the same line as another queen. This builds up the three dimensional solution from the entire two dimensional solution set, picking one by one, using the general back tracking algorithm, with the constraint that no queen can attack another queen in the same plane, i.e same row, column or even diagonal, and no queen can attack another queen vertically on the same line across the planes of the cube constructed.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.