I've been doing some old competitive programming tasks and found one, for which I cannot find a general solution or a solving principle.
The math part of the question is:
You have N vertices, labeled $1$ to $N$. For each vertex $v$, you are given a neighbour $u$ and a probability $p_{vu}$, that you will visit $u$ from $v$. You finish this random walk when you reach $N$. Backwards loops are possible ($p_{vv}$ can be greater than $0$). Also, a probability of a $vu$ path can be $0$.
What is the expected time $T$ of this random walk, if one passage from $v$ to $u$ symbolises $1$ time unit? If reaching N is impossible, you stop and say it is impossible.
I am thinking of a backwards approach but don't know, how to find a general system of equations that solve this, that aren't case specific.