Skip to content

Add handling for asymmetric TSP#59

Open
mikedbjones wants to merge 4 commits into
jvkersch:mainfrom
mikedbjones:main
Open

Add handling for asymmetric TSP#59
mikedbjones wants to merge 4 commits into
jvkersch:mainfrom
mikedbjones:main

Conversation

@mikedbjones

Copy link
Copy Markdown

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