Skip to main content
. Author manuscript; available in PMC: 2024 Jun 4.
Published in final edited form as: Res Comput Mol Biol. 2020 Apr 21;12074:37–53. doi: 10.1007/978-3-030-45257-5_3

Algorithm 1.

Improved hitting number calculation. Input: G=(V,E)

1: D[|V|][𝓁+1], with [|V|][0] initialized to 1
2: Fcurr[|V|]
3: Fprev[|V|] initialized to 1
4: T[|V|] initialized to 0
5: for 1i𝓁 do:
6: for vVdo:
7:   for (v,u)Edo:
8:    D[v][i]+=D[u][i1]
9: for 1i𝓁+1 do:
10: for vV do:
11:   Fcurr[v]=0
12:   for (u,v)E do:
13:    Fcurr[v]+=Fprev[u]
14:   T[v]+=Fprev[v]D[v][𝓁i+1]
15: Fprev=Fcurr
16: return T