Sample Genetic Algorithm Program

A genetic algorithm is a computer program that models nature's strategy of achieveing a goal in an organism.  That is a combination of genetic encoding, survival of the fittest, sexual reproduction, and random mutation.  Nature encodes an organism's traits into a set of chromosomes.  Analagously, genetic algorithms encode a solution's traits in a string of information. That string of information is subject to testing for fitness (and possible removal depending on its fitness), combination with other strings of information that represent solutions, and random mutation.

More GA info or Google It

     This Genetic Algorithm has the purpose of approximating the shortest possible path with which to connect a given set of points. Possible solutions for connecting n points are represented as a string of the number 0 through n , in any combination.  For example if n=7, a possible solution is 2-0-1-5-6-7-4. Each number in that solution is an index representing one of the points that we are trying to connect (its index is independant of its coordinates).

     This simulator has three parts.  The first part is a very simple command line program that creates either random dots or dots in a circle and outputs a text file with the information about the dots.  This was written in C++, and it doesn't use parallel computing, it can be run on any one computer.  Then, the second part, the actual simulator, is a command line application written in C++ and to be run on the parallel processors. It uses the text datafile that stores information about the points and outputs one more text data file with information about the solutions.  The third part is a visualizer that take the two data files as input and visualizes the points and the solutions. The visualizer is written in C# and is a windows application.

Considerations for Programming

Instructions for Running this Program