View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Genetic Algorithm for n-queen problem

4.0 | 6 ratings Rate this file 23 Downloads (last 30 days) File Size: 5.42 KB File ID: #35820 Version: 1.3
image thumbnail

Genetic Algorithm for n-queen problem



22 Mar 2012 (Updated )

N-queen generalized genetic algorithm. Parameters can be changed and tested

| Watch this File

File Information

EACH INDIVIDUAL:- [1*8] where each column value tells the position of queen in that particular column

FINAL SOLUTION:- each row gives one unique solution in the 'solution' matrix

It has very basic but effective functions of selection,crossover and mutation.
Queens are randomly positioned in the beginning.
I have written it for n-queens.
It gives a good amount of solutions for queens > 8.
Also you can change parameters and test for yourself.
The cross-over logic is given in the attached PDF-cross-over_logic.


Travelling Salesman Problem With Genetic Algorithm inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7.8 (R2009a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
20 Dec 2016 Reza Rad

19 Apr 2016 ahmed khaled

27 Nov 2014 Stéfano Acosta

19 Oct 2014 nazish niaz

13 Feb 2014 Hank

Hank (view profile)


04 Nov 2012 Chaowarin

04 Nov 2012 Chaowarin


Comment only
13 Jun 2012 rafik

rafik (view profile)


Comment only
23 Mar 2012 Swapnil Marathe

guys..this is my first attempt in genetic algorithm direction.....plz suggest me more problems and improvements in this one...

Comment only
24 Mar 2012 1.1

description of how the each individual has been defined

08 May 2012 1.3

Modified the file to calculate the fitness function for 'n' queens and not 8 queens

Contact us