N Queens

The goal of the N Queens problem is to place N queens in an N x N chessboard such that no queen attacks any other. A queen attacks another queen if the two are in the same row, column or diagonal.
 
10 queens problem
A Solution to the 10 Queens Problem
 
GENETIC ALGORITHMS
 
Representation: Each gene corresponds to a column on the chessboard, and each allele corresponds to the row that the queen occupies in that column.
 
Fitness function: Defined as the number of nonattacking pairs of queens multiplied by -1. A solution to the problem must have a fitness value of 0.
 
10 queens problem - fitness function
Individual with a Fitness Value of -4
 
APPLICATIONS: desktopGA