expert
Algorithm Optimization via DP
Optimize a complex algorithmic problem using dynamic programming.
📝 Prompt Inhoud
Explain how to solve the 'Traveling Salesman Problem' (TSP) for a small number of nodes (n=15) using Dynamic Programming with Bitmasking. Provide the recurrence relation, explain the state transition logic, and analyze the time and space complexity of the solution. Additionally, write pseudocode for the implementation.