This particular implementation can use up to 16 points defined in the
weight matrix stored in travel.dat. This weight matrix can either be
defined by hand or generated using gendat.m from a list of points
stored in points.txt. A chromosome is 64 bits wide, which is 16 points
with 4 bits each. To make sure that every possible chromosome is a
valid solution, the points are selected out of a circular queue. Every
4 bits describes how far along the queue to walk before pulling out a
point. With the circular queue, the chromosome could be as short as 50
bits, but I was trying different things and 64 bits is the simplest
way to represent a solution. Here are some sample chromosomes:
The second number is the fitness value of the chromosome (10000 - path
length). Below is a path found after 20000 iterations:
A much better method would have the genetic algorithm actually know
about the problem at hand, working with nodes rather than bits.
Breeding would make cuts on nodes. Mutations would swap single nodes.
Perhaps this can be written another time.