Occupation time functionals for a diffusion process or a birth-and-death process on the edges of a graph $\Gamma$ depending only on the values of the process on a part $\Gamma' \subset \Gamma$ of $\Gamma$ are closely related to so-called eigenvalue depending boundary conditions for the resolvent of the process. Under the assumption that the connected components of $\Gamma\backslash\Gamma'$ are trees, we use the special structure of these boundary conditions to give a procedure that replaces each of the trees by only one edge and that associates this edge with a speed measure such that the respective functional for the appearing process on the simplified graph coincides with the original one.
"On occupation time functionals for diffusion processes and birth-and-death processes on graphs." Ann. Appl. Probab. 11 (2) 544 - 567, May 2001. https://doi.org/10.1214/aoap/1015345303