The decision problem is formulated something like "Is there a hamiltonian path of at most length n" for different n. You can get the actual answer by polling the algorithm that answers the decision problem using a binary search plugging in different values for n (since there is a maximum number of possible paths through a graph with a certain number of nodes)