Functional Programming and Intelligent Algorithms

Week 14: The travelling salesperson problem (TSP)

Contents


1 Tutorial: GA for TSP
 1.1 Test problems
 1.2 Test module
 1.3 A continuous GA for the TSP
 1.4 GA settings
 1.5 Genes, chromosomes, and population
 1.6 Encoding functions
  1.6.1 The encodeCity function
  1.6.2 Direct encoding using the encodeTour’ function
  1.6.3 The inverseSequence function
  1.6.4 The encodeTour function
  1.6.5 The encodeTours function
 1.7 Decoding functions
  1.7.1 The fromInverse function
 1.8 Testing the inverseSequence and fromInverse functions
  1.8.1 The decodeGene function
  1.8.2 The decodeChromosome function
  1.8.3 The decodePopulation function
 1.9 Testing of encoding/decoding
 1.10 Randomness functions
  1.10.1 The randGene function
  1.10.2 The randGenes function
  1.10.3 The randChrom function
  1.10.4 The randChroms function
  1.10.5 The randPop function
  1.10.6 The randIndex function
 1.11 Cost functions
  1.11.1 The distance function
  1.11.2 The distanceTour function
  1.11.3 The cityIDToCity function
  1.11.4 The chromToTour function
  1.11.5 The popToTours function
  1.11.6 The chromCost function
  1.11.7 The chromCostPair function
 1.12 Population functions
  1.12.1 The evalPop function
  1.12.2 The sortPop function
  1.12.3 The selection function
  1.12.4 The getParents function
  1.12.5 The toPopulation function
 1.13 Mating functions
  1.13.1 The crossover function
  1.13.2 The matePairwise function
 1.14 Mutation functions
  1.14.1 The replaceAtIndex function
  1.14.2 The mutateChrom function
  1.14.3 The mutateChromInPop function
  1.14.4 The mutIndices and mutatePop functions
 1.15 Evolution functions
  1.15.1 The evolvePopOnce function
  1.15.2 The evolvePop function
 1.16 Alternative encoding/decoding scheme
 1.17 Final remarks
2 Exercises
 2.1 Testing


7th April 2017
Robin T. Bye / robin.t.bye@ntnu.no