Skip to content

Solution of 8 queen problems with heuristic repair method.

License

Notifications You must be signed in to change notification settings

fbasatemur/Eight_Queens_Puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eight_Queens_Puzzle

The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other; thus, a solution requires that no two queens share the same row, column, or diagonal.

The algorithm arranges the queens pre-placed on the 8x8 chessboard according to the rule and gives you the result of the game with the action steps. The result is found with the "heuristic repair method" approach. Take the following pattern is an example:

Queens            => 9  
Available regions => 0
0   0   0   0   0   9   0   0  
0   9   0   0   0   0   0   0  
0   0   0   0   9   0   0   0  
9   0   0   0   0   0   0   0  
0   0   0   9   0   0   0   0  
0   0   0   0   0   0   9   0  
0   0   9   0   0   0   0   0  
0   0   0   0   0   0   0   9  

In the matrix, queens are represented by 9, and appropriate regions with 0. According to this input value, the result will be found as follows.

0   0   0   9   0   0   0   0  
0   9   0   0   0   0   0   0  
0   0   0   0   9   0   0   0  
0   0   0   0   0   0   0   9  
0   0   0   0   0   9   0   0  
9   0   0   0   0   0   0   0  
0   0   9   0   0   0   0   0  
0   0   0   0   0   0   9   0  

Finally, before running the algorithm, make sure that the queens must be expressed in the same row and column without intersection.

Releases

No releases published

Packages

No packages published

Languages