5 kyu
Travelling salesman problem - Optimal solution
Loading description...
Mathematics
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Haskell translation
Thank you for the Haskell translation. It has been approved.
Also, thank you for correcting the spelling and grammar errors. Much appreciated.
This error comes up when I try without any of my code:
div = max(abs(actual), abs(expected), 1) ^^^^^^^^^^^ TypeError: bad operand type for abs(): 'NoneType'
Maybe it's something personal, because I'm practicing for interviews where I won't have the help of Google. But it would be interesting to have the Haversine formula available in the question statement
Also typo
travel_expenses
Thank you. This is fixed now.
Perhaps add links to other katas mentioned in description
They have got retired, but planning to re-do them and then will include the links.
Thank you for suggestion.
Every valid random test expects a large value, and
tolerance = 0.1
, so even, say, a constant difference of 2000 still passes all the random tests, and only fails the fixed test.Thank you. I have change tolerance to 0.00001, which accepts difference up to 0.01%. Also updated task from fixed amount of money to %.
There's something wrong with your tests. See my solution.
This comment has been hidden.
Looks like tolerance has to be less than 1?
Are you sure about the first sample test?
edit:
looks like you other kata specified the distance as an
int
, but this one is afloat
?I think for continuity both katas should be reconciled to have the same distance calc. For now I think this is fixed.
.
Sample tests still uses
tolerance = 1
.