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

Update and improve TSP code #148

Merged
merged 6 commits into from
Dec 13, 2019
Merged

Update and improve TSP code #148

merged 6 commits into from
Dec 13, 2019

Conversation

vgoliber
Copy link
Member

@vgoliber vgoliber commented Dec 9, 2019

Resolves issue #147 and also addresses issue #103.

There may be a faster way to check route validity, but this will get the job done.

@codecov-io
Copy link

codecov-io commented Dec 9, 2019

Codecov Report

Merging #148 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #148      +/-   ##
==========================================
+ Coverage   75.32%   75.38%   +0.06%     
==========================================
  Files          26       26              
  Lines        1552     1556       +4     
==========================================
+ Hits         1169     1173       +4     
  Misses        383      383
Impacted Files Coverage Δ
dwave_networkx/algorithms/tsp.py 95.83% <100%> (+0.37%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d7c9c9...5fa311c. Read the comment docs.

@vgoliber vgoliber changed the title Fix route feasibility check Fix TSP route feasibility check Dec 9, 2019
@vgoliber vgoliber changed the title Fix TSP route feasibility check Update and improve TSP code Dec 10, 2019
@vgoliber
Copy link
Member Author

vgoliber commented Dec 10, 2019

Lagrange parameter update and validity check resolve issue #82 by providing a better default value and returning valid routes.

if lagrange is None:
# if no lagrange parameter provided, set to 'average' tour length
if G.number_of_edges()>0:
lagrange = G.size(weight=weight)*G.number_of_nodes()/G.number_of_edges()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add few words in the comment about why it makes sense to set this value for the parameter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@arcondello arcondello merged commit 5ac3cd2 into dwavesystems:master Dec 13, 2019
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.

4 participants