The Eight Queens problem is a problem posed by chess player Max Bethel in 1848 and is a typical case of backtracking algorithm.
The problem is expressed as: Place 8 queens on an 8×8 chessboard so that they cannot attack each other, that is, no two queens can be in the same row, column or diagonal line. How many ways are there? . Gauss believes that there are 76 scenarios. In 1854, different authors published 40 different solutions in the Berlin Chess Journal, and later someone solved 92 results using the method of graph theory. If rotated by ±90 degrees, ±180 degrees, and the pendulum method of diagonal symmetry transformation, there are 42 types in total. After the invention of the computer, there are several computer languages that can be programmed to solve this problem.