Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- My modified algorithm so far -:
- DIJKSTRA-VARIANT (G, s, t)
- 1 for v in V:
- 2 val[v] ← ∞
- 3 A ← ∅
- 4 Q ← V to initialize Q with vertices in V.
- 5 val[s] ← 0
- 6 while Q is not ∅ and t is not in A
- 7 do x ← EXTRACT-MIN (Q)
- 8 A ← A ∪ {x}
- 9 for each vertex y ∈ Adj[x]
- 10 do if val[x] + p(x, y) < val[y]:
- 11 val[y] = val[x] + p(x, y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement