Shortest Paths with Negative Weights
Shortest Paths with Negative Weights
Slides by Carl Kingsford
Feb. 12, 2013 Based in part on Section 6.8
1
Shortest Path Problem
Shortest Path with Negative Weights. Given directed graph G with weighted edges d(u, v ) that may be positive or negative, find the shortest path from s to t.
2
Complication of Negative Weights
Negative cycles: If some cycle has a negative total cost, we can make the s - t path as low cost as we want:
3
Complication of Negative Weights
Negative cycles: If some cycle has a negative total cost, we can make the s - t path as low cost as we want:
Go from s to some node on the cycle, and then travel around the cycle many times, eventually leaving to go to t.
s
w
t
Assume, therefore, that G has no negative cycles.
3
Let's just add a big number!
Adding a large number M to each edge doesn't work!
The cost of a path P will become M ? length(P) + cost(P).
If M is big, the number of hops (length) will dominate.
2 24
12 2
s
5
15
-10
0
-4 26
12 2
t
1 11
4
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- forensic toxicology laboratory
- negative numbers in combinatorics geometrical and
- exponent of zero and negative exponents purdue university
- negative numbers multiplication
- cross examination debate basics part i
- grade 5 students negative integer multiplication
- hhm brief is moving during childhood harmful 2
- negative urine drug screen in a patient with chronic
- notes on the negative binomial distribution
- shortest paths with negative weights
Related searches
- car payment calculator with negative trade in
- trading in a car with negative equity
- auto calculator with negative equity
- car payment calculator with negative equity
- lease calculator with negative equity
- can you have autoimmune with negative ana
- company with negative equity
- calculator with negative sign
- calculator with negative button
- google calculator with negative sign
- online calculator with negative button
- online calculator with negative sign