1: | G(V, E) is the input graph with vertex set V and edge set E. |
---|---|
2: | s is the seed vertex; f is the affinity threshold; d is the distance threshold. |
3: | N ← {Adjacency list of s} ⋃ {s} |
4: | C ← FindCore(N) |
5: | C' ← ExpandCore(C, f, d) |
6: | return C' |
7: | FindCore(N) |
8: | for each v ∈ N |
9: | calculate (N) |
10: | end for |
11: | K min ← min {(N), v ∈ N} |
12: | K max ← max {(N), v ∈ N} |
13: | if K min = K max or () then return N |
14: | else return FindCore(N - {v}, (N) = K min ) |
15: | ExpandCore(C, f, d) |
16: |
|
17: | C' ← C |
18: | for each t ∈ D, t ∉ C, and distance(t, s) <= d |
19: | calculate (D) |
20: | calculate (D) |
21: | if (D) > (D) or (D)/|D| > f then C' ← C' ∪ {t} |
22: | end for |
23: | if C' = C then return C |
24: | else return ExpandCore(C', f, d) |