Hi all,

You can find my solution here: http://rn86.net/~stevedp/salesman.tar.gz

For this quiz I pretty much just implemented the GA described in the problem: exchanging and reversing.  I pick random indexes in the array of points to decide where to split them before doing these operations.Then I rank by distance and keep the shortest 15 and longest 5 and then run another generation.  I played around with ranking by number of diagonalss well since, for a grid, the best solution will always have either 0 or 1 diagonals but this didn't seem to help at all.  My solution seems to get w/in 5% of the perfect solution for most grid sizes w/in 100 generations.

One thing my solution does is create an SVG animation (scalable vector graphic) of the evolution of the solution.  I've included ruby-svg with my solution so you don't need to install anything.  I've included with my solution, an already made SVG (trips15.svg) of a 15x15 grid being solved over00 generations to w/in 3.2% of the  optimal solution.  You might need to use Firefox for the SVGs to animate, I haven't tried them in IE.

To run my solution just unzip all the files and:
  ruby travel_agency.rb <grid_size> <# of generations to run>
eg:
  ruby travel_agency.rb 7 50

- steve