Brute force approach of TSP

pls can any1 help me with the logic of the brute force approach for this problem I mean the recursive code that is optimised to get dp code.