Negative Costs

In some problems, actions can result in rewards that can improve the value of the path. This doesn't make too much sense in terms of driving time, but if our goal is to end up in Newport with the maximum amount of gasoline, it might be worth swinging by Cranston to get some.

What happens to Dijkstra's algorithm when there are negative costs? It might get stuck.

\epsfig {file=l0505.ps,height=3in,angle=270}

Later we'll see how to solve this type of problem using dynamic programming.


next up previous
Next: Better Optimistic Estimate Up: Heuristic Search Previous: Why It Works