Online bipartite matching in offline...

Post on 28-Feb-2019

230 views 0 download

Transcript of Online bipartite matching in offline...

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

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

Problem statement — example

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

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

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

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

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

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

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

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

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

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

Algorithm — example

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

Algorithm — example

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

Algorithm — example

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

Algorithm — example

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

Algorithm — example

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

Algorithm — example

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

Algorithm — example

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

Algorithm — example

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

Algorithm — example

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

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

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

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!