I have an undirected weighted graph $G=(V,E)$
In this graph, the weight of the edge $(v[i],v[j])$ is the probity $p$ of a direct transition between $v[i]$ and $v[j]$ ($0<p<1$).
I am trying to calculate the probability of transition between $2$ nodes $v, u$.
What I did so far:
I found all paths from $v$ to $u$ (using all_simple_paths)
$[v -0.1 \to a -0.2 \to c -0.3 \to u]$
$[v -0.1 \to a -0.2 \to c -0.2 \to b -0.4 \to d -0.5 \to u]$
$[v -0.1 \to b -0.2 \to c -0.3 \to u]$
$[v -0.1 \to b -0.4 \to d -0.5 \to u]$
but I don't sure how to union the probability of the different paths with shared nodes. I think I can do that by union and intersection between paths, but I'm searching after a simple programable algorithm.
