Hacker News new | past | comments | ask | show | jobs | submit login

Only using naive algorithms. You can get it down to 2^n time complexity by increasing the space complexity and applying dynamic programming techniques.

https://en.wikipedia.org/wiki/Travelling_salesman_problem#Ex...




Just like the article I didn't say anything about space or time complexity, only about the number of combinations (permutations) of visiting N destinations. That number is constant regardless of how sophisticated your algorithm is :-)


I always find it funny when 2^n is viewed as 'good news'. I realize it's better than the other options, but it still feels like a doctor saying great news you've got cancer!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: