|
Algorithm 1 Sampling context algorithm |
Input: Network G, node attributes A, parameters , , q, e and d; Output:
;
-
1:
ifthen
-
2:
;
-
3:
else
-
4:
;
-
5:
end if
-
6:
ifthen
-
7:
Uniformly sample a random-walk sequence S of length q;
-
8:
if
then
-
9:
Under the condition , sample in S;
-
10:
else
-
11:
Sample in ;
-
12:
end if
-
13:
else
-
14:
if
then
-
15:
Uniformly sample which satisfies ;
-
16:
else
-
17:
Uniformly sample which satisfies ;
-
18:
end if
-
19:
end if
|