Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Genetic Algorithm (Second Attempt)

Author
Message
Digger412
19
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 3rd Mar 2011 07:59 Edited at: 3rd Mar 2011 14:25
About a year ago, I tried to make my first GA...worked out well for what I wanted it to do, more or less. Recently, we've had a math-related school project and I decided to create another GA, this time one that would solve the traveling salesman problem for the capitals of the 48 continental US states. It works pretty well, except that it's slow. It usually takes less than 75 generations to form a good solution, but it tends to easily get stuck in local minimums. I also haven't commented the crossover part, just because I got lazy . The type of crossover is called a "Sequential Constructive Crossover", an essay over it can be found at http://www.cscjournals.org/csc/manuscript/Journals/IJBB/volume3/Issue6/IJBB-41.pdf.



I've also attached a .zip with a compiled version, as well as the files needed to run the program (if editing/compiling, Matrix1Utils needed).

It works well, but I need to optimize the crossover more...
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Mar 2011 10:41
Looks interesting, I'll take a look.

PS. You missed the second code bracket at the end of your post

Digger412
19
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 3rd Mar 2011 14:26
Yeah, I had noticed that when I had posted it last night. However, I have limited internet access (can't get on past 1 AM), so I wasn't able to edit it last night
Michael P
20
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 4th Mar 2011 13:47 Edited at: 4th Mar 2011 13:48
Cool stuff.

I did this but for finding the biggest square that can fit on the screen, without overlapping with any other squares (and you draw the initial squares).

To mitigate against getting stuck in local minimums increase the mutation rate. If you haven't implemented mutations then these involve basically just randomly flipping bits occasionally (or w/e is relevant for your implementation).

Login to post a reply

Server time is: 2026-07-16 04:36:16
Your offset time is: 2026-07-16 04:36:16