28.06.2013 Views

Advanced Coarsening Schemes for Graph Partitioning - Ilya ... - KIT

Advanced Coarsening Schemes for Graph Partitioning - Ilya ... - KIT

Advanced Coarsening Schemes for Graph Partitioning - Ilya ... - KIT

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong><br />

<strong>for</strong> <strong>Graph</strong> <strong>Partitioning</strong><br />

<strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz<br />

Argonne National Laboratory and Karlsruhe Institute of Technology (<strong>KIT</strong>)<br />

3<br />

4<br />

LEVEL 0<br />

1 <strong>KIT</strong> <strong>Ilya</strong> – Universität Safro, des Peter LandesSanders, Baden-Württemberg Christian und Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

5<br />

2<br />

6<br />

7<br />

LEVEL 1<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II<br />

nationales Groß<strong>for</strong>schungszentrum in der Helmholtz-Gemeinschaft www.kit.edu


Overview<br />

Introduction<br />

Multilevel Algorithms<br />

Algebraic Distance<br />

<strong>Advanced</strong> <strong>Coarsening</strong><br />

Experiments<br />

Summary<br />

2 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Motivation<br />

Social Networks<br />

SNWs are dense (Facebook > 900M, Google+ > 100M)<br />

too large <strong>for</strong> a single machine<br />

analysis required<br />

3 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Motivation<br />

Social Networks<br />

distribute graph over multiple machines<br />

analysis: edges between PEs ↔ communication<br />

vertices ↔ computation<br />

3 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Motivation<br />

Social Networks<br />

<strong>Graph</strong> <strong>Partitioning</strong> Problem:<br />

Partition a graph into (almost) equally sized blocks, such that the<br />

number of edges connecting vertices from different blocks is minimal.<br />

3 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


ɛ-Balanced <strong>Graph</strong> <strong>Partitioning</strong><br />

Partition graph G = (V , E, c : V → R>0, ω : E → R>0)<br />

into k disjoint blocks s.t.<br />

1 + ɛ<br />

total node weight of each block ≤ total node weight<br />

k<br />

total weight of cut edges as small as possible<br />

Applications:<br />

FEM, linear equation systems, VLSI design, route planning, . . .<br />

4 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Multi-Level <strong>Graph</strong> <strong>Partitioning</strong><br />

Successful in existing systems:<br />

Metis, Scotch, Jostle,. . . , KaPPa, KaSPar, KaFFPa, KaFFPaE<br />

5 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


This Talk<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong><br />

algebraic multigrid<br />

contract<br />

6 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

input<br />

graph<br />

...<br />

algebraic distance<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Algebraic Distance<br />

Relaxation Process<br />

Goal: distinguish local and non-local edges<br />

∀ i ∈ V : x i := rand()<br />

Do k times<br />

∀ i ∈ V : x k<br />

i := (1 − α)x k−1<br />

i<br />

7 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

+ α ∑j ωijx k−1<br />

j / ∑ij ωij Conjecture<br />

If |x k<br />

i − xk<br />

j | > |xk u − xk v | then the local connectivity between u and v is<br />

stronger than that between i and j.<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II<br />

40<br />

20


Algebraic Distance<br />

Example<br />

8 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

40<br />

goal: distinguish local and non-local edges<br />

20<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Algebraic Distance<br />

Example - random initialization<br />

assign random values<br />

relaxation steps to equalize<br />

9 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Algebraic Distance<br />

Example - 10 relaxation steps<br />

relaxation steps to equalize<br />

local differences equalize faster<br />

10 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Stationary iterative relaxation<br />

rewrite process as x (k+1) = H JORx (k) , where<br />

11 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

H JOR = (1 − α) I + αD −1 W<br />

⇒ basically the JOR method to solve Lx = 0<br />

L = D − W graph laplacian, α relaxation paramter<br />

algebraic distance ↔ JOR smoothing property<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Stationary iterative relaxation<br />

rewrite process as x (k+1) = H JORx (k) , where<br />

11 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

H JOR = (1 − α) I + αD −1 W<br />

⇒ basically the JOR method to solve Lx = 0<br />

L = D − W graph laplacian, α relaxation paramter<br />

H JOR lazy random walk matrix<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Stationary iterative relaxation<br />

rewrite process as x (k+1) = H JORx (k) , where<br />

11 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

H JOR = (1 − α) I + αD −1 W<br />

⇒ basically the JOR method to solve Lx = 0<br />

Definition<br />

Extended 2-normed algebraic distance between i and j after k<br />

iterations x (k+1) = Hx (k) on R random initializations<br />

if {i, j} ∈ E, otherwise ρ (k)<br />

ij<br />

ρ (k)<br />

<br />

R<br />

ij := ∑ |x<br />

r=1<br />

(k,r)<br />

i<br />

= 0<br />

− x (k,r)<br />

j | 2<br />

1/2 Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Weighted Aggregation<br />

inspired by AMG<br />

each node may be divided into fractions<br />

different fractions <strong>for</strong>m a coarse node<br />

1. how to select seed nodes<br />

2. how is classical likelihood expressed<br />

3. modification <strong>for</strong> graph partitioning<br />

12 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

contract<br />

input<br />

graph<br />

...<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Coarse Nodes<br />

C-points Selection<br />

find dominating set C ⊂ V s.t. F = V \ C “strongly coupled” to C<br />

each node in C is a seed of a coarse aggregate<br />

SEEDS<br />

13 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Coarse Nodes<br />

C-points Selection<br />

find dominating set C ⊂ V s.t. F = V \ C “strongly coupled” to C<br />

each node in C is a seed of a coarse aggregate<br />

C = ∅, F = V<br />

until<br />

∀u ∈ F : ∑v∈C 1/ρu,v ≥ θ ∑v∈N(u) 1/ρu,v<br />

transfer node from F to C<br />

θ ∈ (0, 1), usually θ = 0.5<br />

14 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

SEEDS<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Coarse Nodes<br />

classical AMG interpolation matrix P<br />

express likelihood of v belonging to c ∈ C → P ∈ R |V |x|C|<br />

Pv,c =<br />

⎧<br />

⎪⎨<br />

⎪⎩<br />

15 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

<br />

Belong to several aggregates<br />

1/ρv,c<br />

∑<br />

k∈N(v)∩C<br />

1/ρ v,k<br />

v ∈ F , c ∈ N(v) ∩ C<br />

1 v ∈ C, v = c<br />

0 otherwise<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Coarse Nodes<br />

classical AMG interpolation matrix P<br />

express likelihood of v belonging to c ∈ C → P ∈ R |V |x|C|<br />

16 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Belong to several aggregates<br />

Lc = P t L f P<br />

volume of c(q ∈ C) := ∑v c(v)Pv,q (sum of weights constant)<br />

wc 1,c 2 = ∑k=l P k,c1 w k,lP l,c2<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Coarse Nodes<br />

modified AMG interpolation matrix P<br />

express likelihood of v belonging to c ∈ C → P ∈ R |V |x|C|<br />

previous (matching based) work:<br />

17 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Belong to several aggregates<br />

vertices should not become too heavy<br />

coarse levels should stay sparse<br />

→ modified algorithm to compute likelihood P<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Modified Algorithm<br />

Likelihood <strong>for</strong> v ∈ V<br />

restrict to at most two strongest connections → sparsity<br />

avoid overloaded vertices<br />

18 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Modified Algorithm<br />

Likelihood <strong>for</strong> v ∈ V<br />

if v ∈ C then Pv,v = 1<br />

restrict to at most two strongest connections → sparsity<br />

avoid overloaded vertices<br />

18 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Modified Algorithm<br />

Likelihood <strong>for</strong> v ∈ V<br />

if v ∈ C then Pv,v = 1<br />

else<br />

find max pair (1/ρe 1 +<br />

1/ρe 2 )<br />

s.t. coarse vertices not<br />

overloaded when<br />

splitting v<br />

restrict to at most two strongest connections → sparsity<br />

avoid overloaded vertices<br />

18 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Modified Algorithm<br />

Likelihood <strong>for</strong> v ∈ V<br />

if v ∈ C then Pv,v = 1<br />

else<br />

...<br />

if no such pair then<br />

find max edge (1/ρe 1 )<br />

s.t. coarse vertices not<br />

overloaded when<br />

aggregating v<br />

restrict to at most two strongest connections → sparsity<br />

avoid overloaded vertices<br />

18 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Modified Algorithm<br />

Likelihood <strong>for</strong> v ∈ V<br />

if v ∈ C then Pv,v = 1<br />

else<br />

...<br />

...<br />

if no such edge then<br />

move v to C<br />

restrict to at most two strongest connections → sparsity<br />

avoid overloaded vertices<br />

18 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Modified Algorithm<br />

Likelihood <strong>for</strong> v ∈ V<br />

N c v ← selected C-nodes<br />

Pv,c ←<br />

1/ρvc<br />

∑ k∈N c v 1/ρ vk , c ∈ N c v<br />

restrict to at most two strongest connections → sparsity<br />

avoid overloaded vertices<br />

18 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Experiments<br />

Algorithm Configurations<br />

ECO KaFFPaEco, a good trade-off of quality and runtime<br />

ECO-ALG matching based coarsening, refinement as in ECO, rating<br />

function ex alg(e) := expansion ∗2 (e)/ρe<br />

STRONG matching based coarsening, strong refinement scheme<br />

AMG-ECO AMG coarsening based, refinement as in ECO<br />

AMG AMG coarsening based, refinement as in STRONG<br />

expansion ∗2 ({u, v}) := ω({u,v})2<br />

c(u)c(v)<br />

19 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Experimental Results<br />

Social Networks - Algebraic Distance Helps!<br />

20 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

ECO<br />

ECO-ALG<br />

ECO<br />

ECO-ALG<br />

k quality full time<br />

2 1.38 0.77<br />

4 1.24 1.32<br />

8 1.15 1.29<br />

16 1.09 1.27<br />

32 1.06 1.18<br />

64 1.06 1.13<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Experimental Results<br />

Social Networks - AMG helps!<br />

ECO-ALG<br />

AMG-ECO<br />

21 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

ECO-ALG<br />

AMG-ECO<br />

k quality uncoar. time<br />

2 1.16 3.62<br />

4 1.11 2.14<br />

8 1.07 1.94<br />

16 1.06 1.69<br />

32 1.00 1.60<br />

64 1.01 2.99<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Experimental Results<br />

Potentially Hard <strong>Graph</strong>s<br />

potentially hard mixtures (star-like structures)<br />

mixtures of snw, fem graphs, VLSI, ...<br />

S 0, . . . , St connected center S 0 by ≤ 3% random edges<br />

ECO<br />

ECO-ALG<br />

22 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

ECO<br />

ECO-ALG<br />

k quality full time<br />

2 1.42 0.51<br />

4 1.15 0.88<br />

8 1.12 1.08<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Experimental Results<br />

Potentially Hard <strong>Graph</strong>s<br />

potentially hard mixtures (star-like structures)<br />

mixtures of snw, fem graphs, VLSI, ...<br />

S 0, . . . , St connected center S 0 by ≤ 3% random edges<br />

ECO-ALG<br />

AMG-ECO<br />

ECO-ALG<br />

AMG-ECO<br />

23 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

STRONG<br />

AMG<br />

STRONG<br />

AMG<br />

k quality uncoar. time quality uncoar. time<br />

2 1.18 0.55 1.15 2.11<br />

4 1.23 0.64 1.13 1.69<br />

8 1.08 0.98 1.05 1.37<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


Conclusion<br />

Experiments<br />

algebraic distance and AMG help on irregular instances<br />

on regular instances (FEM, ...) no significant difference<br />

Further Material in the Paper<br />

more details<br />

more experiments<br />

Future Work<br />

apply AMG and algebraic distance to other multilevel algorithms<br />

implementation within KaFFPa<br />

Lunch<br />

24 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II


25 <strong>Ilya</strong> Safro, Peter Sanders, Christian Schulz:<br />

<strong>Advanced</strong> <strong>Coarsening</strong> <strong>Schemes</strong> <strong>for</strong> <strong>Graph</strong> Partititoning<br />

Thank you!<br />

Contact: christian.schulz@kit.edu<br />

sanders@kit.edu<br />

safro@mcs.anl.gov<br />

Department of In<strong>for</strong>matics<br />

Institute <strong>for</strong> Theoretical Computer Science, Algorithmics II

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!