Looking at this picture, a markov chain, what would be your suggestion to get the contribution of B and C to go from A to D ?

Calculating the contribution of B & C is kind of tricky, I got my ideas and solutions but I would like to have your point of views.

And it get more difficult when your Markov model have cycles like this:

Thanks