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.
This is what I have so far -:
DIJKSTRA-VARIANT (G, s, t)
for v in V:
val[v] ← ∞
A ← ∅
Q ← V to initialize Q with vertices in V.
val[s] ← 0
while Q is not ∅ and t is not in A
do x ← EXTRACT-MIN (Q)
A ← A ∪ {x}
for each vertex y ∈ Adj[x]
do if val[x] + p(x, y) < val[y]:
val[y] = val[x] + p(x, y)
s
is the source vertex and t
is the destination vertex. Of course, I have not exploited the log
property as I am not able to understand how to use it. The relaxation portion of the algorithm at the bottom needs to be modified, and the val
array will capture the results. Without log, it would probably be storing the next highest probability. How should I modify the algorithm to use log
?
log
could be used?" - It is this that I fail to understand.log
to maintain a summation?