Travelling Salesman - DP Optimisation using BitManipulation
Is your feature request related to a problem? Please describe. In this algo we are going to use Bitmasking technique to solve famous NP-hard Traveling Salesman Problem. As we know working with bits decreases the time complexity little bit.
Describe the solution you'd like For min. distance between two cells we are going to use BFS. For the overall we are going to maintain a dp state to track the visited houses and the last visited house to uniquely identify a state in this problem. Therefore, we will be taking dp[index][mask] as our DP state.
Describe alternatives you've considered. I didn't find the implementation of naive approach too. I will implement that also.
Additional context The Time complexity of naive approach is (n!) where as the TC of bitmask dp approach will be (n^2 * 2^n) which is better than the naive approach.
Hi @siriak I will love to work on this feature. Please assign me.
Can you assign me this if not done? @siriak
Hello, I want to work over this, please assign it to me.
Hi @siriak i was working on this project.
Here is my fix @siriak. Please review.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Please reopen this issue once you add more information and updates here. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!