Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements in "AEC.03 - Solving the TSP with GAs" #1

Open
solarjoe opened this issue Oct 20, 2017 · 0 comments
Open

Improvements in "AEC.03 - Solving the TSP with GAs" #1

solarjoe opened this issue Oct 20, 2017 · 0 comments

Comments

@solarjoe
Copy link

solarjoe commented Oct 20, 2017

Hello,

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.

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 use toolbox.register("mate", tools.cxPartialyMatched) but I don't know what exactly the difference is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant