Блог пользователя Gary2005

Автор Gary2005, история, 5 лет назад, По-английски

There is a graph with n nodes.The edges are generated with different probabilities.

P[i][j] is the probability of generating the edge i->j .

For every i, you want to know the probability that the first node can go to the i-th node through the generated edges .

n<=80

I don't know how to solve it ,can you help me?

  • Проголосовать: нравится
  • +24
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Auto comment: topic has been updated by Gary2005 (previous revision, new revision, compare).

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Divide the vertices in two set A,B each having $$$\dfrac{n}{2}$$$ vertices. For each Set, you separetely calculate the answer, let $$$f(S)$$$ return the probability matrix for vertices in $$$S$$$.

Now, to combine the answer, you can iterate over the path $$$a\rightarrow b\rightarrow c\rightarrow d$$$ where $$$a,b,c,d \in A,B$$$ and not all of them belong in the same set. This will be $$$f(A)[a][b] \times P[b][c] \times f(B)[c][d]$$$.

The overall complexity should be $$$\mathcal{O}(n^4\log n)$$$

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I think Gaussian elimination will be helpful here
https://mirror.codeforces.com/blog/entry/60003
See the Markov chain and cyclic expected value.