Generation of Combinatorial Objects · Backtracking

Lesson 2

Nikolai Chukhin · Alexander S. Kulikov

In a correct arrangement, there is exactly one queen in each row and each column. Therefore, the arrangement can be described by a permutation of numbers \(\{0,1,\dotsc,n-1\}\). On the other hand, not every permutation gives a valid queen placement, as shown in the rightmost figure below.