How is tsp problem a dp problem

prateek bhaiya has made a video on dp+bitmasking for travelling salesman problem…but where are the overlapping subproblems in that where storing the ans would give us benefit later on??

in this code dp line never runs…why???


Please refer to this video.

Here is has referred to bottom up approach using a formula …but plz tell me according to Prateek bhaiya video…which is available on YouTube as well…since this is CB …and I want to know top down approach overlap problem…where storing result could prove beneficial later on

You can try and build the recursion tree for the problem. There are overlapping subproblems, thats why dp is used.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.