Advertisement
SVXX

Dijkstra Variant Problem

Feb 16th, 2014
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. We have a directed graph G = (V, E) for a comm. network with each edge having a probability of not failing r(u, v) (defined as edge weight) which lies in interval [0, 1]. The probabilities are independent, so that from one vertex to another, if we multiply all probabilities, we get the the probability of the entire path not failing. I need an efficient algorithm to find a most reliable path from one given vertex to another given vertex (i.e., a path from the first vertex to the second that is least likely to fail). I am given that log(r · s) = log r + log s will be helpful.
  2.  
  3. My modified algorithm so far -:
  4. DIJKSTRA-VARIANT (G, s, t)
  5. 1 for v in V:
  6. 2 val[v] ← ∞
  7. 3 A ← ∅
  8. 4 Q ← V to initialize Q with vertices in V.
  9. 5 val[s] ← 0
  10. 6 while Q is not ∅ and t is not in A
  11. 7 do x ← EXTRACT-MIN (Q)
  12. 8 A ← A ∪ {x}
  13. 9 for each vertex y ∈ Adj[x]
  14. 10 do if val[x] + p(x, y) < val[y]:
  15. 11 val[y] = val[x] + p(x, y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement