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
added note for the triangle inequality case in TSP #6995
added note for the triangle inequality case in TSP #6995
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the liberty of refactoring the suggestion so that it satisfies both the docstring standard and the formatting rules.
If the input graph `G` contains edges whose weights do not satisfy the | ||
triangle inequality, then the returned path may contain repeating nodes | ||
(other than the starting node). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also include the case where the graph is not a complete graph (where the triangle inequality definitely doesn't apply -- non-existing edges are length inf
so definitely violate the inequality). Perhaps add a phrase like: e.g. when a graph is not a complete graph.
And perhaps this should appear at the end of the paragraph at line 222 instead of in a separate Notes
section.
@dschult Thank you for the review. I've made the changes. Please let me know if this looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Thanks!
To get this to pass the documentation build tests, we need to include a change to the testing system that has laready been merged into upstream Sometimes rebasing is as easy as: But I'm confident that we can just merge this and the documentation will work. This PR only changed some words in the docs -- not it's structure or format. :) |
d91090b
to
949b041
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thanks @Schefflera-Arboricola for the updates and @dschult for the review & suggestions!
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Closes #6748
Added the following note in the docstring of
traveling_salesman_problem()
function:should we also put a warning message here? because TSP makes sense only for valid graphs, without triangle inequalities. Please let me know what you think.
Thank you :)