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

Add handling for asymmetric TSP #59

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mikedbjones
Copy link

As discussed in #28 , I've made the following changes to handle asymmetric TSP (for example real-world driving/walking problems).

  1. Add symmetricize() function in util.py.
  2. Add is_symmetric boolean property of Problem, so that asymmetric problems can be tracked through to the solution, which necessarily needs to be modified (removing ghost nodes that were added in symmetricize()).
  3. Add remove_ghost_nodes() method to Solution
  4. Add raise ValueError when a non-integer matrix is passed (Concorde provides solution of 0 with float matrices)
  5. Add uk_cities.py example

So far as I'm aware, this code does not break any existing functionality with symmetric matrices, nor other problem solutions.

If you're happy with the changes I've made, I'm happy to explain more in the readme and create another PR.

Thanks!

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

Successfully merging this pull request may close these issues.

1 participant