Online bipartite matching in offline...

37
Online bipartite matching in offline time Bartlomiej Bosek 1 Dariusz Leniowski 2 Piotr Sankowski 2 Anna Zych 2 1 Jagiellonian University 2 University of Warsaw FIT 2015, 31 January 2015 BLSZ Online bipartite matching in offline time FIT 2015 1 / 37

Transcript of Online bipartite matching in offline...

Page 1: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Online bipartite matching inoffline time

Bartłomiej Bosek1 Dariusz Leniowski2

Piotr Sankowski2 Anna Zych2

1Jagiellonian University

2University of Warsaw

FIT 2015, 31 January 2015

BLSZ Online bipartite matching in offline time FIT 2015 1 / 37

Page 2: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement

• A bipartite graph G = 〈U ] V,E〉is revealed online.

• The vertices in U are fixed.

• The vertices from V arrive one per turn,each with all its incident edges.

• We want to maintain the maximumcardinality matching, and if possible,keep the number of reallocations low.

BLSZ Online bipartite matching in offline time FIT 2015 2 / 37

Page 3: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 3 / 37

Page 4: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 4 / 37

Page 5: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 5 / 37

Page 6: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 6 / 37

Page 7: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 7 / 37

Page 8: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 8 / 37

Page 9: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 9 / 37

Page 10: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 10 / 37

Page 11: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 11 / 37

Page 12: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 12 / 37

Page 13: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 13 / 37

Page 14: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 14 / 37

Page 15: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 15 / 37

Page 16: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Problem statement — example

BLSZ Online bipartite matching in offline time FIT 2015 16 / 37

Page 17: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Our results

• Bound: it is possible to maintain maximummatching using 2

√n reallocations per vertex.

• Exact: in O(m√

n) total timemaintains the maximum cardinality matching.

• Approximation: in O(ε−1m) total timemaintains (1− ε)-approximation factor.

• Reductions: vertex-decremental (same bounds),weighted (pseudopolynomial bound).

BLSZ Online bipartite matching in offline time FIT 2015 17 / 37

Page 18: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Motivation

• Servers and new jobs to process,edges denote eligibility.

• We want to admit as many requests aspossible — we reallocate them when necessary.

• Applications include streaming contentdelivery, web hosting, remote data storage,job scheduling, hashing, etc.

BLSZ Online bipartite matching in offline time FIT 2015 18 / 37

Page 19: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

History

• Grove, Kao, Krishnan and Vitter, ’95:at most 2 servers per client using O(log n)reallocations per vertex, O(n log n) total.

• Chaudhuri, Daskalakis, Kleinberg and Lin ’09:forests or particular random graphs,total bound of O(n log n).

• General case:only the trivial O(n2) bound was known.

BLSZ Online bipartite matching in offline time FIT 2015 19 / 37

Page 20: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Relation to other models

• Karp, Vazirani and Vazirani, ’90:no reallocations, O(m) total time,approximation factor of (1− 1/e) ≈ 0.63.

• Gupta, Peng ’13: (1− ε)-approximationin O(m

√m) total time.

• Our result: (1− ε)-approximationin O(ε−1m) total time, exact in O(m

√n)

time, matches the running time of theoffline Hopcroft-Karp algorithm.

BLSZ Online bipartite matching in offline time FIT 2015 20 / 37

Page 21: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Main idea

• For each u ∈ U we keep track of its rank,i.e., the number of times it was used byaugmenting paths up to this point.

• Suppose that vertex of V arrives.

• Pick an augmenting path that minimizesthe maximum rank for its every suffix.

BLSZ Online bipartite matching in offline time FIT 2015 21 / 37

Page 22: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Ranks and tiers

RankGiven a vertex u ∈ U

rankt(u) = how many times augmenting paths used u,rankt(P) = max

u∈Prankt(u).

TierGiven a vertex w ∈ V ]U,

tiert(w) = the rank of the lowest-ranked alternatingpath to any unmatched vertex u ∈ U

= minunmatched u∈U

minalternating path P : w→u

rankt(P).

BLSZ Online bipartite matching in offline time FIT 2015 22 / 37

Page 23: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Tiered paths

A path is called tiered if the tiers are non-increasing.

0

( )

tu

1

2

3

0

1

2

3 3

3

rank

because of this rank tier here is 3

because of this rise ( )

yellow path is not tiered

0 0

1

2 3

1

3

0

1

2

green path is tiered:

there is a rise in the ranks,

but the tier is non-increasing

1 2

BLSZ Online bipartite matching in offline time FIT 2015 23 / 37

Page 24: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Tiers — a few notes

• Tiers do not decrease in time.

• tier(w) ≤ distALT(w,unmatched u).

• Tiers are hard to maintain.

• Instead, for any w we keep tierLB(w),a number such that tierLB(w) ≤ tiert(w);set tierLB(w) = 0 and update as necessary.

• Theorem: both tiers and ranks are O(√

n).

BLSZ Online bipartite matching in offline time FIT 2015 24 / 37

Page 25: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — a sketch

1. Add a vertex vt and assume its tierLB is 0.

2. Try to find a tiered augmenting pathof rank at most tierLB(vt).

3a. Failed search means that some tierLBwas too low, so raise it and repeat.

3b. For a successful search raise the ranks.

BLSZ Online bipartite matching in offline time FIT 2015 25 / 37

Page 26: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — example

BLSZ Online bipartite matching in offline time FIT 2015 26 / 37

Page 27: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — example

BLSZ Online bipartite matching in offline time FIT 2015 27 / 37

Page 28: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — example

BLSZ Online bipartite matching in offline time FIT 2015 28 / 37

Page 29: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — example

BLSZ Online bipartite matching in offline time FIT 2015 29 / 37

Page 30: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — example

BLSZ Online bipartite matching in offline time FIT 2015 30 / 37

Page 31: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — example

BLSZ Online bipartite matching in offline time FIT 2015 31 / 37

Page 32: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — example

BLSZ Online bipartite matching in offline time FIT 2015 32 / 37

Page 33: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — example

BLSZ Online bipartite matching in offline time FIT 2015 33 / 37

Page 34: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — example

BLSZ Online bipartite matching in offline time FIT 2015 34 / 37

Page 35: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Algorithm — approximation

• We set an artificial upper bound tierLB ≤ k.

• Vertices that went over are left unmatched.

• If the ranks of all augmenting paths are ≥ k,the matching is (1− 2/k)-approximate.

• With O(ε−1) changes per vertex, we get(1− ε)-approximation in O(ε−1m) time.

BLSZ Online bipartite matching in offline time FIT 2015 35 / 37

Page 36: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Concluding remarks

• New type of augmenting path algorithms.

• The reallocation problem has bound 2√

n.

• Incremental or decremental,exact or approximate versions.

• It’s simple and combinatorial.

• Can the bound of O(n log n) be reached?

BLSZ Online bipartite matching in offline time FIT 2015 36 / 37

Page 37: Online bipartite matching in offline timefit2015.mimuw.edu.pl/.../uploads/2015/01/wierzcholki_prezentacja1.pdf · Online bipartite matching in offline time Bartłomiej Bosek1 Dariusz

Concluding remarks

• New type of augmenting path algorithms.

• The reallocation problem has bound 2√

n.

• Incremental or decremental,exact or approximate versions.

• It’s simple and combinatorial.

• Can the bound of O(n log n) be reached?

BLSZ Online bipartite matching in offline time FIT 2015 37 / 37

Thank you!