Genetic Algorithms for TSP
[size="2"][size="1"][size="2"]Software Developer, Mintrus
Was there a reason that you chose GA for TSP?
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
You can Gtranslate the following (French <-> English generally works great): http://khayyam.devel...erce/genetique/
Well done!
Incidentally, they have been able to solve 16-node TSP in screaming fast time using swarm theory (think ants that report back on their adventures). Read The Perfect Swarm by Fisher for more info.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
Was there a reason that you chose GA for TSP?
I think I'm with IADaveMark on this one, GAs doesn't strike me as particularly useful for this... it's much less likely to give you the optimal solution (unless it gets really lucky).
Unless there's some kind of hidden logic to the layout of the locations in the kind of environment you're solving that you don't know about and could be teased out by by the GA and applied across many problems, the advantages aren't really very apparent.
Sometimes I'm sure there is such a logic (and in that case, a really good genetic algorithm may be able to figure it out and probably proceed much faster than a random system)... but if this is a more or less random level we're talking about, there may not be anything of the sort that would give a GA an advantage here.
That said, genetic algorithms are just plain fun... so, that could factor in.
they have been able to solve 16-node TSP in screaming fast time using swarm theory (think ants that report back on their adventures). Read The Perfect Swarm by Fisher for more info.
A nice tutorial explaining the implementation of an ant colony algorithm to the traveling salesman problem: http://khayyam.devel...ies-de-fourmis/ (sorry, you'll have to Gtranslate it again)
[/font]
[quote name='IADaveMark' timestamp='1318024048' post='4870273']
Was there a reason that you chose GA for TSP?
I think I'm with IADaveMark on this one, GAs doesn't strike me as particularly useful for this... it's much less likely to give you the optimal solution (unless it gets really lucky).
[/quote]
Even though a GA only approach might be inefficient compared to classical heuristics, it can always be combined with these later if needed (that's the advantage of a metaheuristic method). Crossovers might turn out to be useful. That said, I have never looked closely at TSP but there seem to be myriads of papers on TSP + GA, which tends to make me think the OP's goal isn't too quixotic.
Regards,
Quinn
[size="2"][size="1"][size="2"]Software Developer, Mintrus
Our purpose in this term project is to implement heuristic algorithms and compare and evaluate their respective computational efficiency. Included in this model are greedy, 2-opt, greedy 2-opt, 3-opt, greedy 3-opt, genetic algorithm, simulated annealing, and neural network approach and their improvement versions. The problem size can be adjusted from 2-node up to 10,000-node. Therefore, these algorithms can be evaluated in a wide spectrum of situations[/quote]
Check out LKH for example; winner of the DIMACS challenge for TSPs.
Check out LKH for example; winner of the DIMACS challenge for TSPs.
Interesting, thanks pithlit!
http://www.akira.ruc.dk/~keld/research/LKH/ :
A simple genetic algorithm has been added. New keyword: POPULATION_SIZE. Tours found by the first POPULATION_SIZE runs constitute an initial population of tours. In each of the remaining runs two tours (parents) from the current population is recombined into a new tour (child) using a variant of the Edge Recombination Crossover (ERX). The parents are chosen with random linear bias towards the best members of the population. The child is used as initial tour for the next run. If this run produces a tour better than the worst tour of the population, then the resulting tour replaces the worst tour. Premature convergence is avoided by requiring that all tours in the population have different costs.[/quote]
[color="#1C2837"]So crossovers turned out to be useful and diversity is used in the fitness function in order to avoid premature convergence (= genetic drift in GA terminology), such as illustrated below:
[color="#1C2837"]