Using the decision problem, PATH in order to solve the optimization problem, SHORTEST-PATH in polynomial time
For non-negative weights $0$ is a lower bound and thus sufficient. For arbitrary weights you can binary search in $[l,u]$, for a lower bound $l=\sum_{a\in A\mid d_a&lt;0} d_a$ and an upper bound $u=\sum_{a\in A\mid d_a&gt;0} d_a$ on the length of any simple path.