Research Article
A Network Sampling Strategy Inspired by Epidemic Spreading
Algorithm 1
Contact process sampling.
Input: an undirect and unweighted graph ; the sample ratio , where ; | āOutput: a sample graph , where , and ; | (1) | Randomly select one node , and let and ; | (2) | whiledo | (3) | Randomly select one node from ; | (4) | Select one node from the neighborhood of , with probability inversely proportional to the degree of ; | (5) | ; | (6) | end while | (7) | fordo | (8) | if and then | (9) | ; | (10) | end if | (11) | end for | (12) | return; |
|