Fast Parallel Algorithms for Edge-Switching to Achieve a Target Visit Rate in Heterogeneous Graphs Maleq Khan September 9, 2014 Joint work with: Hasanuzzaman Bhuiyan, Jiangzhuo Chen, and Madhav Marathe
Edge Switch Swaps the end points of two randomly selected edges in a graph A sequence of such operations are performed Preserves the degree of each node Edge switch operations generate a new graphs with the same degree sequence 2 Before switch After switch
Applications Generating random graphs from a given degree sequence Randomly perturb a given network to study the effect of network topology on various dynamics on a network, e.g., disease dynamics on social network Modeling dynamic peer-to-peer networks 3
Edge Switching Problem Input: – A simple graph No loops and parallel edges – The number of edge switches, t Sequential Processing: – Select a pair of edge uniformly at random – switching the edges if the graph remains simple – Repeated the above steps until t number of edge switches are done Output: – A simple graph 4
Constraints of Edge Switch The output remains simple graph after switching – No loop – No parallel edge 5
Constraints of Edge Switch The output remains simple graph after switching – No Loop – No Parallel Edge 6 Before switch After switch
Constraints of Edge Switch 7 Before switch After switch
Visit Rate 8
Dependencies among successive edge switch operations Keeping the graph simple (no self-loop, no parallel edge) It requires complex synchronization and communications among processors Keeping the communication overhead low 9 Challenges in Parallelizing Edge Switch Operation
Parallel Edge Switching 10
Parallel Edge Switching 11 #Edges 1000 #Edges 1000 Set of Edges Sequential Partitioned among 4 processors Parallel
12 Parallel Edge Switching
13 Parallel Edge Switching
14 Parallel Edge Switching
Picking Edges Uniformly at Random Set of Edges Partition of Edges E0E0 E1E1 E2E2 E3E3 Serial Parallel ? ? ? ?
Picking Edges Uniformly at Random Set of Edges Partition of Edges E0E0 E1E1 E2E2 E3E3 Serial Parallel ? ? ? ?
Multinomial Distribution 17
Binomial Distribution 18
Binomial Distribution (Contd.) … …
Multinomial Distribution 20
Property of Binomial and Multinomial Distr. 21
Parallel Multinomial Distribution 22 …
Parallel Multinomial Distribution 23 P0P0 P1P1 P3P3 P2P2
Parallel Multinomial Distribution 24 P0P0 P1P1 P3P3 P2P2
25 Parallel Multinomial Distribution
Parallel Edge Switching Set of Edges Serial Chunk of Edges Parallel
Parallel Edge Switching 27
Parallel Edge Switching 28
Parallel Edge Switching 29
Parallel Edge Switching 30
Parallel Edge Switching 31
Parallel Edge Switching 32
Parallel Edge Switching 33
Parallel Edge Switching 34
Parallel Edge Switching Dataset 35
Performance – Speedup of 85 using 1024 processors – Can switch more than 115B edge switches on a Pref. Attachment graph with 10B edges in less than 3 hours 36 Parallel Edge Switching
Step-size tradeoff 37 Parallel Edge Switching Increased error rate for larger step-size Better speedup for larger step-size
Network Properties Change – Avg. Clustering coefficient and avg. shortest path (approx.) changes similarly for both the sequential and parallel processes 38 Parallel Edge Switching Avg. Clustering coefficient change Avg. shortest path distance change
Future Work – Estimating number of networks for a given degree sequence – Does the parallel algorithm traverses all possible graphs for a given degree sequence? If yes, what is the bounding time? – Assortative edge switch 39 Parallel Edge Switching
40 Thank you!
Questions and Comments 41
Parallel Edge Switching Goal – Avoid parallel edge creation instead of resolving them – Maintain the efficiency of parallelization – Maintain the same distribution of the number of switches across the set of edges as the distribution of the serial algorithm – Make sure that one edge is involved in at most one edge switch operation at the same time 42
Parallel Multinomial Distribution 43 P0P0 P1P1 P p-1 …
Parallel Multinomial Distribution 44 P0P0 P1P1 P p-1 …
Multinomial Distribution q0q0 q1q1 q2q2 q p-1 … X 0 = 0X 1 = 0X 2 = 1 X p-1 = 0
Multinomial Distribution q0q0 q1q1 q2q2 q p-1 … X 0 = 0X 1 = 0X 2 = 1 X p-1 = 0
Parallel Edge Switching 47 Before switch
Picking Edges Uniformly at Random 48 Set of Edges Partition of Edges E0E0 E1E1 E2E2 E p-1 Serial Parallel
Parallel Multinomial Distribution Pseudocode: 49
Constraints of Edge Switch The output remains simple graph after switching – No Loop – No Parallel Edge Avoid useless edge switch – Such switch does not make any change to the network 50 u1 u2 v1 v2 u1=u2 v1 v2
Original and Modified Edge Original Edge: – An edge that has not participated in any edge switch – Remains unchanged Modified Edge: – Any edge participating in any edge-switch is replaced by a new edge – Such a new edge is called modified edge 51