Parallel Graph Partitioning for Complex...

38
1 Christian Schulz : Parallel Partitioning of Complex Networks Department of Informatics Institute for Theoretical Computer Science Institute for Theoretical Computer Science Parallel Graph Partitioning for Complex Networks Henning Meyerhenke, Peter Sanders, Christian Schulz High-performance Graph Algorithms and Applications in Computational Science – Dagstuhl www.kit.edu

Transcript of Parallel Graph Partitioning for Complex...

Page 1: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

1 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Institute for Theoretical Computer Science

Parallel Graph Partitioningfor Complex NetworksHenning Meyerhenke, Peter Sanders, Christian SchulzHigh-performance Graph Algorithms and Applications in Computational Science – Dagstuhl

www.kit.edu

Page 2: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

ε-Balanced Graph Partitioning

2 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Partition graph G = (V ,E , c : V → R>0,ω : E → R>0)into k disjoint blocks s.t.

total node weight of each block ≤ 1 + ε

ktotal node weight

total weight of cut edges as small as possible

Applications:FEM, linear equation systems, VLSI design, route planning, . . .

Page 3: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Multilevel Graph Partitioning

3 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

input graph

... ...

initial

contra

ctio

n p

hase

local improvement

uncontract

partitioning

contract

outputpartition

uncoars

enin

g p

hase

Successful in many systems (using matchings or AMG for coarsening)

Page 4: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

KaHIPKarlsruhe High Quality Partitioning

4 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

input graph

OutputPartition

contract

... ...

match

partitioning

initial

local improvement

uncontract

[IPDPS10] [ESA11]

[ESA11] W−F−V−

[IPDPS10]

cycles a la multigrid

[SEA13]

[DIMACS12] [ALENEX12] evol. alg.distr.

highly balanced:

[ALENEX12]

[SEA12/14]

[SEA14]

A

C

B

+

edge ratings

flows etc.parallel

MultilevelGraph Partitioning

A B

C0 −1

−1

0

−1

A B

C0 −1

−1

0

−10 0

social separatorsbuffoon

Page 5: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Matching-based Coarsening

5 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

A+B

a+b

B

a b

A

Page 6: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Matching-based Coarsening

5 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

A+B

a+ba b

A B

Page 7: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Matching-based CoarseningProblem

6 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

bad for networks that are highly irregularsubstantial reduction is hard using matchingsmay contract wrong edges!

Page 8: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Matching-based CoarseningProblem

6 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

bad for networks that are highly irregularsubstantial reduction is hard using matchingsmay contract wrong edges!

Page 9: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Basic Idea

7 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

aggressive contraction / simple and fast local searchmain idea: contract clusteringsclustering paradigm: internally dense and externally sparse

Page 10: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Basic IdeaContraction of Clusterings

8 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

A+B+C

a+b+ca bc

A

B

C

contraction: respect balance and cutavoid large blocks: size constraint Uconstruct coarse graph using hashingrecurse until graph is small

Page 11: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Basic IdeaContraction of Clusterings

8 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

A+B+C

a+b+ca bc

A

B

C

contraction: respect balance and cutavoid large blocks: size constraint Uconstruct coarse graph using hashingrecurse until graph is small

Page 12: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label PropagationCut-based, Linear Time Clustering Algorithm [Raghavan et. al]

9 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

cut-based clustering using size-constraint label propagationstart with singletonstraverse nodes in random order or smallest degree firstmove node to cluster having strongest eligible connectionmodification eligible: w.r.t size constraint U

Scan

... ...

Page 13: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label Propagation

10 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Iteration Cut [%]0 1001 8.962 6.153 5.664 5.445 5.286 5.257 5.218 5.18... 5.09

Page 14: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label Propagation

10 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Iteration Cut [%]0 1001 8.962 6.153 5.664 5.445 5.286 5.257 5.218 5.18... 5.09

Page 15: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label Propagation

10 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Iteration Cut [%]0 1001 8.962 6.153 5.664 5.445 5.286 5.257 5.218 5.18... 5.09

Page 16: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label Propagation

10 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Iteration Cut [%]0 1001 8.962 6.153 5.664 5.445 5.286 5.257 5.218 5.18... 5.09

Page 17: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label Propagation

10 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Iteration Cut [%]0 1001 8.962 6.153 5.664 5.445 5.286 5.257 5.218 5.18... 5.09

Page 18: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label Propagation

10 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Iteration Cut [%]0 1001 8.962 6.153 5.664 5.445 5.286 5.257 5.218 5.18... 5.09

Page 19: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label Propagation

10 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Iteration Cut [%]0 1001 8.962 6.153 5.664 5.445 5.286 5.257 5.218 5.18... 5.09

Page 20: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label Propagation

10 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Iteration Cut [%]0 1001 8.962 6.153 5.664 5.445 5.286 5.257 5.218 5.18... 5.09

Page 21: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label Propagation

10 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Iteration Cut [%]0 1001 8.962 6.153 5.664 5.445 5.286 5.257 5.218 5.18... 5.09

Page 22: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label Propagation

10 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Iteration Cut [%]0 1001 8.962 6.153 5.664 5.445 5.286 5.257 5.218 5.18... 5.09

Page 23: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label PropagationSimple Local Search

11 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Greedy Local Search:start with partition from coarser leveltraverse nodes in random ordermove node to cluster having strongest eligible connectioneligible: w.r.t size constraint U := (1 + ε) |V |k

Scan

... ...

Augmentations of the partitioning algorithm→ paper

Page 24: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

12 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Parallelization

Page 25: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Graph Distribution over PEs

13 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Graph Distribution: a PE receives n/p vertices and their edges

Processor I Processor II

Communication

ghost nodes: adjacent nodes on other processor (communication!)interface nodes: nodes adjacent to ghost nodes

Page 26: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Label PropagationDistributed Memory

14 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

each PE has a static part of the graph, only block IDs can change

Overlap Computation and Communication (PE centric view):

Scan

V

Phase i Phase i+1Phase i−1

At the end of phase i :send block ID updates of phase i to neighboring PEsreceive block ID updates from neighboring PEs from phase i − 1

* while scanning in phase i , messages are routed through the network* algorithm converged→ nothing will be communicated

+ algorithms to maintain balance of clusters/blocks

Page 27: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Parallel Augmentations

15 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

input graph

... ...local improvement

partitioning

initialuncontractcontract

...

uncontract

local improvement...

contract

V-cycles:don’t contract cut edgesmodify label propagation to respect partition

Node Ordering for LP:perform smallest degree first only locally

Page 28: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

16 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Experiments

Page 29: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Instances

17 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

graph n m graph n mLarge Graphs

p2p-Gnutella04 6 405 29 215 citationCiteseer 268 495 ≈1.2Mwordassociation-2011 10 617 63 788 coAuthorsDBLP 299 067 977 676PGPgiantcompo 10 680 24 316 cnr-2000 325 557 ≈2.7Memail-EuAll 16 805 60 260 web-Google 356 648 ≈2.1Mas-22july06 22 963 48 436 coPapersCiteseer 434 102 ≈16.0Msoc-Slashdot0902 28 550 379 445 coPapersDBLP 540 486 ≈15.2Mloc-brightkite 56 739 212 945 as-skitter 554 930 ≈5.8Menron 69 244 254 449 amazon-2008 735 323 ≈3.5Mloc-gowalla 196 591 950 327 eu-2005 862 664 ≈16.1McoAuthorsCiteseer 227 320 814 134 in-2004 ≈1.3M ≈13.6Mwiki-Talk 232 314 ≈1.5M

Huge Graphsuk-2002 ≈18.5M ≈262M sk-2005 ≈50.6M ≈1.8Garabic-2005 ≈22.7M ≈553M uk-2007 ≈106M ≈3.3G

ε = 3%, k ∈ {2,4,8,16,32,64}, geom. mean of averages, 10 seeds

Page 30: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Experimental ResultsSelected

18 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Algorithm impr. cut t [s]UFast 51.7% 1.5UFastV 54.7% 3.0UEcoV/B 60.9% 11.5UStrong 75.1% 296.4KaFFPaEco 22.2% 36.2KaFFPaStrong 66.2% 640.8kMetis 45.8% 0.4hMetis 60.5% 107.4Scotch baseline 10.6

UStrong best quality, running time ≤ KaFFPaStrongbest cut of hMetis 6% worse than avg. cut of UStrongUEcoV/B outperforms hMetis, order of magnitute less timeUFast better quality but slower

Page 31: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Experimental ResultsSelected

18 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Algorithm impr. cut t [s]UFast 51.7% 1.5UFastV 54.7% 3.0UEcoV/B 60.9% 11.5UStrong 75.1% 296.4KaFFPaEco 22.2% 36.2KaFFPaStrong 66.2% 640.8kMetis 45.8% 0.4hMetis 60.5% 107.4Scotch baseline 10.6

UStrong best quality, running time ≤ KaFFPaStrongbest cut of hMetis 6% worse than avg. cut of UStrongUEcoV/B outperforms hMetis, order of magnitute less timeUFast better quality but slower

Page 32: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Experimental ResultsSelected

18 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Algorithm impr. cut t [s]UFast 51.7% 1.5UFastV 54.7% 3.0UEcoV/B 60.9% 11.5UStrong 75.1% 296.4KaFFPaEco 22.2% 36.2KaFFPaStrong 66.2% 640.8kMetis 45.8% 0.4hMetis 60.5% 107.4Scotch baseline 10.6

UStrong best quality, running time ≤ KaFFPaStrongbest cut of hMetis 6% worse than avg. cut of UStrongUEcoV/B outperforms hMetis, order of magnitute less timeUFast better quality but slower

Page 33: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Parallel Solution QualityPerformance k = 2 blocks, 32PEs

19 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

instances: meshes and social networks/web graphs

ParMetis has ineffective coarsening (matching-based)due to memory consumption of coarsest graph (dist. among PEs)→ could not solve arabic-2005, sk-2005 and uk-2007

solved instances (ParMetis):fast and eco yield 19.2% and 27.4% improvementfast and eco slower on average

social networks/web graphs:fast: 38% less cut edges and > 2×fastereco: 45% less cut edges and slowerbest instance: 18×faster and 61.6% less cut edgesimpr. quality over FB or matching-based algorithms (other inst.)

Page 34: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Strong ScalingSocial Networks

20 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

10

100

1000

1 2 4 8 16 32 64 256 1K 2K

tota

l ti

me

[s]

number of PEs p

Fast sk-2007Fast arabic-2005

Fast uk-2002

Fast uk-2007Minimal uk-2007

uk-2007 can be partitioned in 15.2 seconds (seq. 10.5min)more scaling results in the paper

Page 35: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Conclusion

21 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

cluster contraction improves running time and solution qualityefficient parallelization dominates ParMetis on social networks∃(semi-)external variant of the algorithmmuch more results in the papers

Page 36: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

References

22 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Partitioning Complex Networks via Size-constrained ClusteringH. Meyerhenke, P. Sanders and C. SchulzArXiv:1402.3281

Parallel Graph Partitioning for Complex NetworksH. Meyerhenke, P. Sanders and C. SchulzArXiv:1404.4797

(Semi-)External Algorithms for Graph Partitioning and ClusteringY. Akhremtsev, P. Sanders and C. SchulzArXiv:1404.4887

Recent Advances in Graph PartitioningA. Buluc, H. Meyerhenke, I. Safro, P. Sanders and C. SchulzArXiv:1311.3144

Page 37: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

Open ProblemsMostly from Recent Advances in GP

23 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

large values of k : multilevel looses attractivenessmulti-k -recursive parallel partitioning w.r.t. structure of clusterother metrics:

max. comm volume, max. quotient graph degree, pareto objectivesreal performance benchmarksfixed k questionable if application tolerates node failures→ repartitioning with changed kmapping blocks onto communication networksusing GP for graph tools such as Pregelexact ML algorithms for node separatorsusing GP has a hammer for optimization problems, e.g.

independent setgraph coloringmax clique

Page 38: Parallel Graph Partitioning for Complex Networksalgo2.iti.kit.edu/schulz/collection/talks/talk_dagstuhl.pdf · Parallel Partitioning of Complex Networks Department of Informatics

24 Christian Schulz:Parallel Partitioning of Complex Networks

Department of InformaticsInstitute for Theoretical Computer Science

Thank you!

KaHIP: algo2.iti.kit.edu/documents/kahipon Twitter: twitter.com/ProjectKaHIP