Say we have a directed graph where each edge contains a tuple (d,p) where d is the distance that must be traveled and p is the profit you'll get by traversing that edge, and after traversing an edge, it's profit is set to 0. My question is, given a starting node and maximum distance D (such that Σd < D across all edges traversed), solve for the maximum profit, where profit is defined as Σp across all edges traversed.
You can revisit nodes and re-traverse edges.
I've attempted to modify dijkstra to no success, since dijkstra doesn't know when to stop it's flood fill, and as far as I can tell there's no way to guarantee the best solution with dijkstra before checking all possibilities. I've also looked into variations of TSP, and this problem seems much more path-finding related. Any references, pseudocode, or already understood algorithms would be appreciated. I am, of course, not looking for brute-force algorithms.