Alleles, loci and the traveling salesman problem