Algorithm 2:
Input: (1) Graph G(V, E) |
(2) Starting node s |
(3) Walk length l |
Output: random walk path Ps, l = ( X1, X2,…, Xl ) |
1: Initialization: Let i = 1, walk length = 1, and Xibe the starting node s |
2: while ( walk length hasn't reached l ) |
3: Let node Xi+1 be a random neighbor of node Xi |
4: Add node Xi+1 in the random walk path Ps, l |
5: Let walk length added by 1 |
6: end while |