A DP Approach to Hamiltonian Path Problem