patternMinor
Uniform-cost Search Problem
Viewed 0 times
uniformcostproblemsearch
Problem
Suppose that we take an initial search problem and we add $c > 0$ to the costs on all edges. Will uniform-cost search return the same answer as in the initial search problem?
Definitions: Uniform-cost search is also known as lowest cost first. Initial search problem can be any graph with a start and a goal state. You just apply the uniform cost search algorithm on the graph.
Definitions: Uniform-cost search is also known as lowest cost first. Initial search problem can be any graph with a start and a goal state. You just apply the uniform cost search algorithm on the graph.
Solution
The shortest path may indeed change. This is not because of some property of the uniform cost search, but rather, the property of the graph itself. Note that adding a constant positive cost to each edge affects more severely the paths with more edges. Here is an example, where the shortest path has cost $5$:
Adding a cost of $1$ to each edge changes the shortest path in the graph as:
The original shortest path has a new cost of $10$, whereas the other path has a cost of only $9$. Therefore, any optimal shortest path algorithm, such as Dijkstra's or uniform cost search, will find a different shortest path.
The shortest path will not change if it also has the least number of paths among all paths from source to destination. If the shortest distance is $d_{min}$ and $k_1$ edges, and there is some other path with distance $d_{min} + \Delta$ with $k_2$ edges ($k_2 \frac{\Delta}{k_1 - k_2}$ to all the edges will change the shortest path, and therefore your result.
Scaling the edges by a constant positive factor (multiplying all edges by $c>0$) will not change the shortest path.
Adding a cost of $1$ to each edge changes the shortest path in the graph as:
The original shortest path has a new cost of $10$, whereas the other path has a cost of only $9$. Therefore, any optimal shortest path algorithm, such as Dijkstra's or uniform cost search, will find a different shortest path.
The shortest path will not change if it also has the least number of paths among all paths from source to destination. If the shortest distance is $d_{min}$ and $k_1$ edges, and there is some other path with distance $d_{min} + \Delta$ with $k_2$ edges ($k_2 \frac{\Delta}{k_1 - k_2}$ to all the edges will change the shortest path, and therefore your result.
Scaling the edges by a constant positive factor (multiplying all edges by $c>0$) will not change the shortest path.
Context
StackExchange Computer Science Q#9265, answer score: 6
Revisions (0)
No revisions yet.