CodingTrain / website-archive

Archive of the Coding Train website (first version)
https://codingtrain.github.io/website-archive/
MIT License
5.72k stars 5.66k forks source link

Traveling Salesman Problem to fix #3240

Closed jjuniorc closed 2 years ago

jjuniorc commented 3 years ago

After read books about Traveling Salesman Problem it is considered a Non-deterministic Polynomial Time Complete as it consider that salesman will back to start point. So your solution may be incomplete because you are not considering that salesman need to return to beginning.

Here is where I am checking this information: Cormen, Thomas H., ed. (2013) Algorithms Unlocked. The MIT Press

But in my mind it can also be a NP Time Complete algorithm without return to start point. I did a checkbox to include the return to beginning in distance count. I believe that you can improve your solution to be better suited to some computer science literature's.

Please, let me know if I am correct in my analysis

ksnip_20210613-174103

KobeLiesenborgs commented 2 years ago

Hi Junior!

The algorithm can definitely be improved and changed for actual use, for the website however we tend to stick to the examples from the videos! Your point is valid for sure though!

P.S. you should join our community discord for questions and remarks you might have in the future!