Skip to main content
. 2021 Oct 31;21(21):7254. doi: 10.3390/s21217254
Algorithm 2: The DFS based tree-filtering algorithm, TF_DFS
Input: An uncertain graph G, an integer k, a weight threshold ω.
Output: top-k RSTs.

1: Q←⌀;ρ←0;T←{Vr}

2: while T←SD_DFS_GROW(T) do

3:    ρ←Q.min().probability()

4:    if W(T)>ω then

5:        prune_rule1()

6:    else if Q.size()==k and T is not a spanning tree and P(T)<ρ then

7:        prune_rule2()

8:    else if Q.size()<k and T is a spanning tree then

9:        Q.insert(T)

10:    else if P(T)>ρ and Q.size()==k then

11:        Q.remove_min();Q.insert(T)

12:    end if

13: end while

14: return Q.all()