10.08.2013 Views

Sequential and parallel algorithms for bipartite matching

Sequential and parallel algorithms for bipartite matching

Sequential and parallel algorithms for bipartite matching

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.

Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

<strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong><br />

<strong>matching</strong><br />

Johannes Langguth<br />

April 1, 2011<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

1 Introduction<br />

2 Bipartite Matching<br />

3 Parallel Matching Algorithms<br />

4 2D Partitioning<br />

5 Parallel Algorithm<br />

6 Weighted Bipartite Matching<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Bipartite Matching<br />

Bipartite Cardinality Matching<br />

Given an undirected, <strong>bipartite</strong> graph G = (V1,V2,E),E ⊆ V1 × V2<br />

find a maximum subset M ⊆ E of pairwise nonadjacent edges.<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Bipartite Matching<br />

Bipartite Cardinality Matching<br />

Given an undirected, <strong>bipartite</strong> graph G = (V1,V2,E),E ⊆ V1 × V2<br />

find a maximum subset M ⊆ E of pairwise nonadjacent edges.<br />

Perfect Matching<br />

M is called a perfect <strong>matching</strong> iff |V1| = |V2| = |M|.<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Bipartite Matching<br />

Bipartite Cardinality Matching<br />

Given an undirected, <strong>bipartite</strong> graph G = (V1,V2,E),E ⊆ V1 × V2<br />

find a maximum subset M ⊆ E of pairwise nonadjacent edges.<br />

Perfect Matching<br />

M is called a perfect <strong>matching</strong> iff |V1| = |V2| = |M|.<br />

Old problem<br />

A classical topic in combinatorial optimization<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Bipartite Matching Algorithms<br />

Exact Cardinality Algorithms<br />

Close relation to Max - Flow<br />

Search <strong>for</strong> augmenting paths<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Augmenting Paths<br />

a<br />

Matching size: 2<br />

b<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Augmenting Paths<br />

a<br />

Matching size: 2 Matching size: 3<br />

b b<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong><br />

a


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Bipartite Matching Algorithms<br />

Exact Cardinality Algorithms<br />

Close relation to Max - Flow<br />

Search <strong>for</strong> augmenting paths<br />

Berge’s theorem<br />

Let G = (V ,E) be a graph <strong>and</strong> M a <strong>matching</strong> in G. Then M is of<br />

maximum cardinality if <strong>and</strong> only if there is no M-augmenting path<br />

in G.<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Bipartite Matching Algorithms<br />

Exact Cardinality Algorithms<br />

Close relation to Max - Flow<br />

Search <strong>for</strong> augmenting paths<br />

Berge’s theorem<br />

Let G = (V ,E) be a graph <strong>and</strong> M a <strong>matching</strong> in G. Then M is of<br />

maximum cardinality if <strong>and</strong> only if there is no M-augmenting path<br />

in G.<br />

Obvious Algorithm<br />

Repeatedly find single augmenting paths using BFS or DFS<br />

Running time: O(mn)<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Questions<br />

Questions ?<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Residual Graph<br />

a<br />

Orient edges<br />

b<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Improved Bipartite Matching Algorithms<br />

Problem<br />

Residual graph changes after every augmentation.<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Improved Bipartite Matching Algorithms<br />

Problem<br />

Residual graph changes after every augmentation.<br />

Solution<br />

Find (maximal) sets of disjoint augmenting paths.<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Augmenting Path Based Algorithms<br />

Hopcroft-Karp Algorithm ’73<br />

Maximal set of shortest disjoint augmenting paths.<br />

Uses BFS + DFS<br />

Running time: O(m √ n)<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Augmenting Path Based Algorithms<br />

Hopcroft-Karp Algorithm ’73<br />

Maximal set of shortest disjoint augmenting paths.<br />

Uses BFS + DFS<br />

Running time: O(m √ n)<br />

Pothen-Fan Algorithm ’90<br />

Maximal set of disjoint augmenting paths.<br />

Uses DFS only<br />

Running time: O(mn)<br />

Fairness makes DFS more stable<br />

Approx. 3 times faster<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Push-Relabel Based Algorithms<br />

Goldberg-Tarjan Algorithm ’88<br />

No explicit augmenting paths<br />

Speculative path prefix augmentations - “Push”<br />

Distance Labeling - “Relabel”<br />

Running time: O(mn)<br />

Variable push order<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

s,t Network Flow Problem<br />

1<br />

1<br />

1<br />

1<br />

1<br />

0<br />

0<br />

0<br />

0<br />

0<br />

Distance Labeling<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Computing Maximum Matching Flow<br />

1<br />

1<br />

1<br />

1<br />

1<br />

0<br />

2<br />

0<br />

0<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Computing Maximum Matching Flow<br />

1<br />

1<br />

1<br />

1<br />

1<br />

2<br />

2<br />

2<br />

0<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Computing Maximum Matching Flow<br />

1<br />

1<br />

1<br />

1<br />

1<br />

2<br />

2<br />

2<br />

0<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Double Push<br />

1<br />

1<br />

1<br />

3<br />

1<br />

2<br />

2<br />

2<br />

0<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Single Push<br />

1<br />

1<br />

1<br />

3<br />

1<br />

2<br />

2<br />

2<br />

2<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Global Relabel<br />

1<br />

1<br />

S 1<br />

2<br />

T<br />

3<br />

1<br />

2<br />

2<br />

2<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Global Relabel<br />

1<br />

1<br />

1<br />

3<br />

1<br />

2<br />

2<br />

2<br />

2<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Global Relabel<br />

1 2<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Global Relabel<br />

3<br />

1 2<br />

3<br />

3<br />

4<br />

4<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Global Relabel<br />

5<br />

3<br />

1<br />

3<br />

3<br />

4<br />

6<br />

2<br />

4<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Final Pushes<br />

5<br />

3<br />

1<br />

3<br />

3<br />

4<br />

6<br />

2<br />

4<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Final Matching<br />

5<br />

3<br />

1<br />

3<br />

3<br />

4<br />

6<br />

2<br />

4<br />

2<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Push-Relabel Based Algorithms<br />

Global relabelings<br />

Use BFS from unmatched vertices<br />

Running time: O(m √ n)<br />

One global relabeling per O(n)<br />

Actual frequency heavily affects per<strong>for</strong>mance<br />

Push order:<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Push-Relabel Based Algorithms<br />

Global relabelings<br />

Use BFS from unmatched vertices<br />

Running time: O(m √ n)<br />

One global relabeling per O(n)<br />

Actual frequency heavily affects per<strong>for</strong>mance<br />

Push order:<br />

FIFO (BFS) : Competitive with Pothen-Fan algorithm<br />

LIFO (DFS) : 20 times slower than FIFO<br />

Lowest Label First : 20% slower than FIFO<br />

Highest Label First : more than 20 times slower than FIFO<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Experiments<br />

Erdős - Rényi Graphs<br />

Constant average degree 1 ≤ k ≤ 10<br />

k ≤ 2 trivial<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Experiments<br />

Erdős - Rényi Graphs<br />

Constant average degree 1 ≤ k ≤ 10<br />

k ≤ 2 trivial<br />

k = 3 low number of perfect(maximum) <strong>matching</strong>s<br />

Hard <strong>for</strong> augmenting path <strong>algorithms</strong><br />

k > 3 number of perfect(maximum) <strong>matching</strong>s increases<br />

Progressively easier<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

R<strong>and</strong>om Graphs<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Experiments<br />

Erdős - Rényi Graphs<br />

Constant average degree 1 ≤ k ≤ 10<br />

k ≤ 2 trivial<br />

k = 3 low number of perfect(maximum) <strong>matching</strong>s<br />

Hard <strong>for</strong> augmenting path <strong>algorithms</strong><br />

k > 3 number of perfect(maximum) <strong>matching</strong>s increases<br />

Progressively easier<br />

k = 3 is easy <strong>for</strong> strong heuristics<br />

Karp-Sipser is often optimal (Aronson, Frieze, Pittel ’98)<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Experiments<br />

Real world instances<br />

Sparse matrices<br />

Varying degree<br />

“Easy” instances<br />

Pothen-Fan algorithm is 2 times faster than PR-FIFO here<br />

Strong initialization does not pay off here<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Experiments<br />

Real world instances<br />

Sparse matrices<br />

Varying degree<br />

“Easy” instances<br />

Pothen-Fan algorithm is 2 times faster than PR-FIFO here<br />

Strong initialization does not pay off here<br />

Tradeoff<br />

Push-Relabel algorithm faces a tradeoff between initialization <strong>and</strong><br />

global relabelings<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Parallel Algorithm<br />

Push - Relabel approach<br />

Pushes can be per<strong>for</strong>med in any order (Goldberg-Tarjan ’88)<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Parallel Algorithm<br />

Push - Relabel approach<br />

Pushes can be per<strong>for</strong>med in any order (Goldberg-Tarjan ’88)<br />

Basic Assumptions<br />

Target architechture: traditional supercomputer<br />

Graph (sparse matrix) is 2D partitioned <strong>and</strong> distributed<br />

Graph usually has a perfect <strong>matching</strong><br />

Instances can be huge<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Parallel Algorithm<br />

Push - Relabel approach<br />

Pushes can be per<strong>for</strong>med in any order (Goldberg-Tarjan ’88)<br />

Basic Assumptions<br />

Target architechture: traditional supercomputer<br />

Graph (sparse matrix) is 2D partitioned <strong>and</strong> distributed<br />

Graph usually has a perfect <strong>matching</strong><br />

Instances can be huge<br />

Our Objective<br />

Distributed memory algorithm <strong>for</strong> large <strong>parallel</strong> systems<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

2D Partitioning<br />

⎛<br />

⎜<br />

⎝<br />

0 1 0 2 5<br />

1 1 3 3 0<br />

0 2 6 6 5<br />

3 0 1 0 3<br />

0 1 2 0 5<br />

⎞<br />

⎟<br />

⎠<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

2D Partitioning<br />

⎛<br />

⎜<br />

⎝<br />

0 1 0 2 5<br />

1 1 3 3 0<br />

0 2 6 6 5<br />

3 0 1 0 3<br />

0 1 2 0 5<br />

⎞<br />

⎟<br />

⎠<br />

a<br />

b<br />

c<br />

d<br />

e<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong><br />

u<br />

v<br />

w<br />

x<br />

y


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

2D Partitioning is NP-Hard<br />

CENSORED<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Processor 0<br />

a<br />

b<br />

u<br />

v<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Processor 1<br />

a<br />

b<br />

c w<br />

x<br />

y<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Processor 2<br />

c<br />

d<br />

e<br />

u<br />

v<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Processor 3<br />

d<br />

e<br />

w<br />

x<br />

y<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

2D Partitioning<br />

a<br />

b<br />

c w<br />

d<br />

e<br />

u<br />

v<br />

x<br />

y<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Perfect Matching<br />

a<br />

b<br />

c w<br />

d<br />

e<br />

u<br />

v<br />

x<br />

y<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Connectors<br />

c<br />

a<br />

b<br />

d<br />

e<br />

u<br />

v<br />

w<br />

x<br />

y<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Connector Tokens<br />

c<br />

a<br />

b<br />

∗<br />

d<br />

e<br />

u<br />

v<br />

w<br />

x<br />

y<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Connector Tokens<br />

c<br />

a<br />

b<br />

∗<br />

d<br />

e<br />

u<br />

v<br />

w<br />

x<br />

y<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Token Push<br />

c<br />

a<br />

b<br />

∗<br />

d<br />

e<br />

u<br />

v<br />

w<br />

x<br />

y<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

A New Parallel Algorithm<br />

Ingredients <strong>for</strong> a new Algorithm<br />

1 Maintain locally maximum <strong>matching</strong><br />

2 Find local paths between connectors <strong>and</strong> free left vertices<br />

3 Push free left vertices<br />

4 Use labels to guide pushes<br />

5 Follow at most m/p edges per round to ensure load balancing<br />

6 Apply continous global relabelings to update labels<br />

Challenge<br />

Distributed memory global relabel is inefficient!<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Path on Processor 2<br />

4<br />

2<br />

0<br />

1<br />

3<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Path on Processor 1 <strong>and</strong> 3<br />

2<br />

0<br />

1<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Solution<br />

Relaxed Global Relabeling<br />

1 Per<strong>for</strong>m global relabeling BFS on each processor<br />

2 Search “jumps” one processor per round<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Global Relabeling Round 1<br />

2<br />

0<br />

1<br />

1<br />

1<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Global Relabeling Round 2<br />

2<br />

2<br />

2 1<br />

2<br />

0<br />

1<br />

1<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Solution<br />

Relaxed Global Relabeling<br />

1 Per<strong>for</strong>m global relabeling BFS on each processor<br />

2 Search “jumps” one processor per round<br />

3 Labels are no longer lower bounds on graph distance<br />

4 Labels are lower bounds on processor jump distance<br />

5 Maximum number of jumps J is bounded only by n<br />

6 Tedious to prove running time<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Solution<br />

Relaxed Global Relabeling<br />

1 Per<strong>for</strong>m global relabeling BFS on each processor<br />

2 Search “jumps” one processor per round<br />

3 Labels are no longer lower bounds on graph distance<br />

4 Labels are lower bounds on processor jump distance<br />

5 Maximum number of jumps J is bounded only by n<br />

6 Tedious to prove running time<br />

Running time<br />

O(n(J + r)m)<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Weighted Matching Algorithms<br />

Exact Weighted Bipartite Algorithms<br />

Special case of Minimum Cost Flow<br />

Must find weight augmenting paths<br />

Can be solved using Shortest Path Algorithms<br />

Running time: O(n 3 )<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Weighted Matching Algorithms<br />

Exact Weighted Bipartite Algorithms<br />

Special case of Minimum Cost Flow<br />

Must find weight augmenting paths<br />

Can be solved using Shortest Path Algorithms<br />

Running time: O(n 3 )<br />

Approximate Weighted Bipartite Algorithms<br />

Parallel 1/2 approximation: Bisseling Manne ’07<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Weighted Matching Algorithms<br />

Exact Weighted Bipartite Algorithms<br />

Special case of Minimum Cost Flow<br />

Must find weight augmenting paths<br />

Can be solved using Shortest Path Algorithms<br />

Running time: O(n 3 )<br />

Approximate Weighted Bipartite Algorithms<br />

Parallel 1/2 approximation: Bisseling Manne ’07<br />

2/3 − ǫ approximation: Pettie S<strong>and</strong>ers ’04<br />

Running time: O(m)<br />

Easy on perfect <strong>matching</strong>s<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Weighted Matching Algorithms<br />

Exact Weighted Bipartite Algorithms<br />

Special case of Minimum Cost Flow<br />

Must find weight augmenting paths<br />

Can be solved using Shortest Path Algorithms<br />

Running time: O(n 3 )<br />

Approximate Weighted Bipartite Algorithms<br />

Parallel 1/2 approximation: Bisseling Manne ’07<br />

2/3 − ǫ approximation: Pettie S<strong>and</strong>ers ’04<br />

Running time: O(m)<br />

Easy on perfect <strong>matching</strong>s<br />

Auction <strong>algorithms</strong>: Bertsekas ’91<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Auction Algorithms<br />

Unmatched left vertices make bids<br />

v<br />

u<br />

5<br />

6<br />

7<br />

4<br />

4<br />

2<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

V makes a bid<br />

Unmatched left vertices make bids<br />

v<br />

u<br />

5<br />

6<br />

7<br />

4<br />

4<br />

2<br />

0<br />

Profit = 1<br />

Profit = 4<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

V makes a bid<br />

v<br />

u<br />

5<br />

6<br />

7<br />

4<br />

4<br />

0<br />

2 ∗ (1 + ǫ)<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

U makes a bid<br />

v<br />

u<br />

5<br />

6<br />

7<br />

4<br />

4<br />

0<br />

Profit = 7 − 2 ∗ (1 + ǫ)<br />

Profit = 4<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

U makes a bid<br />

v<br />

u<br />

5<br />

6<br />

7<br />

4<br />

4<br />

0<br />

2 ∗ (1 + ǫ) 2<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

End Result<br />

v<br />

u<br />

5<br />

6<br />

7<br />

4<br />

4<br />

3<br />

0<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Auction Algorithm<br />

Auction algorithm<br />

“Weighted push-relabel”<br />

PTAS <strong>for</strong> maximum weight <strong>matching</strong><br />

Can find maximum cardinality<br />

Global price updates help: Goldberg Kennedy ’96<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Auction Algorithm<br />

Auction algorithm<br />

“Weighted push-relabel”<br />

PTAS <strong>for</strong> maximum weight <strong>matching</strong><br />

Can find maximum cardinality<br />

Global price updates help: Goldberg Kennedy ’96<br />

Easy to <strong>parallel</strong>ize: Riedy ’04; Schenk Saate ’10<br />

Works well on dense instances<br />

For sparse instances: Global price updates help<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Auction Algorithm<br />

Auction algorithm<br />

“Weighted push-relabel”<br />

PTAS <strong>for</strong> maximum weight <strong>matching</strong><br />

Can find maximum cardinality<br />

Global price updates help: Goldberg Kennedy ’96<br />

Easy to <strong>parallel</strong>ize: Riedy ’04; Schenk Saate ’10<br />

Works well on dense instances<br />

For sparse instances: Global price updates help<br />

Challenge<br />

Can we find relaxed <strong>parallel</strong> global price updates ?<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>


Outline Introduction Bipartite Matching Parallel Matching Algorithms 2D Partitioning Parallel Algorithm Weighted Bipartit<br />

Questions<br />

Questions ?<br />

Johannes Langguth <strong>Sequential</strong> <strong>and</strong> <strong>parallel</strong> <strong>algorithms</strong> <strong>for</strong> <strong>bipartite</strong> <strong>matching</strong>

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

Saved successfully!

Ooh no, something went wrong!