From 9c61dc874c30fa3f795a2fdaeea53c16585c0ef6 Mon Sep 17 00:00:00 2001 From: minto Date: Fri, 23 Feb 2018 20:51:16 +0100 Subject: [PATCH] readme update with ga --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index acf39cc..6f829f3 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,9 @@ i.e the city k which minimizes d(i, k) + d(k, j) - d(i, j) with <
 - Start from a random city.
 - Find the city k farthest from any node in the tour (i.e the city k which maximizes 
-d(c, k) with c a city in the partial tour), and insert k where it causes the smallest increase in length (by minimizing d(i, k)  + d(k, j) - d(i, j), with (i, j) an edge 
-in the partial tour).  
+d(c, k) with c a city in the partial tour), and insert k where it causes the 
+smallest increase in length (by minimizing d(i, k)  + d(k, j) - d(i, j), with (i, j) 
+an edge in the partial tour).  
 - Repeat until every city has been visited.
 
@@ -123,8 +124,16 @@ a valid tour. If this new tour is shorter, make the change. # Genetic algorithm +pyTSP implements a genetic algorithm with the following properties: +- 3 mutation methods: random swap, insertion or displacement. +- 3 crossover methods: order, maximally preservation, or partially mapped. +- Selection: at each generation, 30 individuals are chosen randomly, and the 10 best are kept for the next generation. +- Mutation and crossover rates default to 50%. They can be modified with sliders. + ![Genetic algorithm](readme/genetic_algorithm.gif) +**Note**: the genetic algorithm is processed by the server, and websockets (or long-polling if the server does not support websockets) are used to update the display client-side every new generation. + # Getting started The following modules are used in pyTSP: