Professional Documents
Culture Documents
Polynomial Time Algorithms For The N-Queen Problem: Rok Sosic and Jun Gu
Polynomial Time Algorithms For The N-Queen Problem: Rok Sosic and Jun Gu
Polynomial Time Algorithms For The N-Queen Problem: Rok Sosic and Jun Gu
dp[i-queen[i]]
Problem remains
Resolve any collision on the diagonal lines
QS1
Pseudo-code
QS1
Gradient-Based Heuristic
QS2
Data Structure
Queen placement same as QS1
An array attack is maintained
Store the row indexes of queens that are under
attack
QS2
Pseudo-code
QS2
Go through the
attacking queen only
Max no. and min no. of queens on the most populated diagonal
in a random permutation
Permutation Statistics
Swap Statistics
Results – Statistics of QS2
Permutation Statistics
Swap Statistics
Results – Statistics of QS3
Swap Statistics