You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found your TSP example very useful. There is a small issue that I came across.
I found that using a set() in generate_cities(n) leads to problems with the indexing for larger problems. As a set has no fixed order the expression list(set()) in create_tour used later might reorder the elements.
Instead of toolbox.register("mate", tools.cxOrdered) they use toolbox.register("mate", tools.cxPartialyMatched) but I don't know what exactly the difference is.
The text was updated successfully, but these errors were encountered:
Hello,
I found your TSP example very useful. There is a small issue that I came across.
I found that using a
set()
ingenerate_cities(n)
leads to problems with the indexing for larger problems. As a set has no fixed order the expressionlist(set())
increate_tour
used later might reorder the elements.There is also a TSP example in the DEAP repository:
https://github.com/DEAP/deap/blob/master/examples/ga/tsp.py
Instead of
toolbox.register("mate", tools.cxOrdered)
they usetoolbox.register("mate", tools.cxPartialyMatched)
but I don't know what exactly the difference is.The text was updated successfully, but these errors were encountered: