slides

advertisement
A Scaling Algorithm for Maximum
Weight Matching in Bipartite Graphs
Ran Duan and Hsin-Hao Su
Speaker: Hsin-Hao Su
Introduction
Max:
4$
3$
6$
6$
5$
6$
3$
7$
6$
19$
Task assignment, marriage matching, etc.

2
Introduction
Maximum Weight Matching (MWM)
i
1000
u
1732
u
v
x
i
1000
-∞
-∞
j
1732
1000
-∞
k
-∞
1732
1000
Total weight: 3464
3
j
1000
v
1732
k
1000
x
Introduction
Maximum Weight Perfect Matching (MWPM)
Every vertex must be matched

i
1000
u
1732
u
v
x
i
1000
-∞
-∞
j
1732
1000
-∞
k
-∞
1732
1000
Total weight: 3000
4
j
1000
v
1732
k
1000
x
Reduction Between MWM and MWPM
n: # vertices
m: # edges
W: the largest edge weight
If MWPM in 𝑓 𝑛, 𝑚, 𝑊 time


3 × 1732 + 1000
3 × 1732 + 1732
MWM in 𝑓 2𝑛, 2𝑚 + 2𝑛, 𝑊 time
3 × 1732 + 1000
1000
1732
3 × 1732 + 1732
If MWM in 𝑔 𝑛, 𝑚, 𝑊 time


5
3 × 1732 + 1000
MWPM in 𝑔 𝑛, 𝑚, (𝑛 + 1)𝑊 time
1000
1732
1000
Problem History
[Kuhn 1955] Hungarian Algorithm


Based on the results of König and Egreváry
Recent discovery of Jacobi’s work in 19th century

6
Results for MWM
n: # vertices
m: # edges
W: the largest edge weight
Classical
1865
Jacobi
1955
Kuhn
1957
Munkres
1964
Balinsky & Gomory
1971
Edmonds & Karp
1977
Tomizawa
1977
1984
2002
2003
Johnson
Fredman & Tarjan
Thorup
Thorup
7
𝑝𝑜𝑙𝑦(𝑛)
Scaling Approach
Gabow
1988
Gabow & Tarjan
1992
Orlin & Ahuja
2012
This result
𝑚 𝑛 log(𝑛𝑊)
𝑚 𝑛 log 𝑊
Dense Graphs
𝑚𝑛 log 𝑛
1996
𝑚𝑛 log 𝑑 𝑛
𝑚𝑛 + 𝑛2 log 𝑛
𝑚𝑛
1999
𝑚𝑛
+ 𝑛2 log log 𝑛
𝑚𝑛3/4 log 𝑊
𝑊𝑚 𝑛
1983
2006
Cheriyan &
Mehlhorn
5
𝑛2 log(𝑛𝑊)
log log 𝑛
log 𝑛
Kao et al.
log 𝑛2 /𝑚
𝑊𝑚 𝑛(
)
log 𝑛
Sankowski
𝑊𝑛2.3727
1
4
Duality and Optimality
Linear Programming Theory


Dual y(u) for every vertex u
1000
M is optimal if and only if ∃𝑦

𝑦 𝑢 + 𝑦 𝑣 ≥ 𝑤 𝑢𝑣 , ∀𝑢𝑣 ∈ 𝐸
2. 𝑦 𝑢 + 𝑦 𝑣 = 𝑤 𝑢𝑣 , ∀𝑢𝑣 ∈ 𝑀
3. 𝑦 𝑢 = 0 ⇔ 𝑢 𝑢𝑛𝑚𝑎𝑡𝑐ℎ𝑒𝑑
1732
1.
1000
1732
1000
8
The Hungarian Algorithm
1000
1414
1000
1414
1000
9
The Hungarian Algorithm
1000
1414
1000
1414
1000
10
The Hungarian Algorithm
1000
1414
1000
1414
1000
11
Gabow and Tarjan’s Scaling Algorithm

𝜖-tightness
𝑦 𝑢 + 𝑦 𝑣 ≥ 𝑤 𝑢𝑣 , ∀𝑢𝑣 ∈ 𝐸
2. 𝑦 𝑢 + 𝑦 𝑣 ≤ 𝑤 𝑢𝑣 + 𝜖, ∀𝑢𝑣 ∈ 𝑀
3. 𝑦 𝑢 = 0 ⇔ 𝑢 𝑢𝑛𝑚𝑎𝑡𝑐ℎ𝑒𝑑
1.

 error ≤ 𝜖𝑛
𝜖
12
Gabow and Tarjan’s Scaling Algorithm
For 𝜖 =
𝑊
2
to
1
𝑛+1
do
2𝜖-tight to 𝜖-tight
2. 𝜖 ← 𝜖/2
End For
1.
𝜖<
13
1
𝑛
 error < 1  optimal!
log(𝑛𝑊) scales
Modified Hungarian algorithm
Faster Hungarian Search

Idea: do it simultaneously


𝑂( 𝑛) iterations
𝑂 𝑚 time per iter.
1000
1414
1000
1414
1000
14
Our Approach


Each scale takes 𝑂 𝑚 𝑛 time
Gabow & Tarjan: log(𝑛𝑊) scales
Scale:
log 𝑊
1
log 𝑛
2
log 𝑛
1
log 𝑛
2
2 + log 𝑊 scales
Time: 𝑂(𝑚 𝑛 log 𝑊)
15
𝜖
First Half

Choose 𝜖 =
1
log 𝑛
2
𝜖
𝜖
≤ 𝑛 iterations
𝑊
𝑛
log 𝑊
𝑊

𝜖
= 𝑛 iterations
suffice to decrease y(u)
to zero
1
log 𝑛
2
𝜖
1000
1414
1000
1414

𝜖-tightness in 𝑂 𝑚 𝑛
16
1000
Second Half

Balinsky & Gomory: Primal method

Tighten matched edges
1
log 𝑊
log 𝑛
2
1
𝑛
1
𝑛
1
𝑛
0
17
1
𝑛
1
log 𝑛
2
1
𝑛
0
Dilworth’s Lemma

Given a partially ordered set with n elements, there exists
a chain or an anti-chain of size at least 𝑛
18
Anti-Chain

Fix it in linear time
1
𝑛
0
19
1
0
𝑛
1
0𝑛
1
0𝑛
1
𝑛
0
Chain

Fix it in linear time
1
0𝑛
0
20
1
0𝑛
1
𝑛
1
𝑛
1
0𝑛
0
Not a partially ordered set

∃ an augmenting cycle to increase the weight of the
matching
1
𝑤(𝑀) increase by at least 1
𝑛
1
𝑛
1
𝑛
0
21
1
𝑛
1
𝑛
1
𝑛
1
𝑛
0
Win-Win Analysis
Either
1. Dilworth’s Lemma is applicable


𝑛 matched edges will be tighten
There exists an augmenting cycle 1
2.

𝑤 𝑀 increases by at least 1
1
log 𝑛
2

≤ 𝑛 matched edges
Each happens at most 𝑛 times

22
Time: O(𝑚 𝑛)
𝑛
− tight ⇒ error ≤ 𝑛
log 𝑊
1
log 𝑛
2
Conclusion

An 𝑂(𝑚 𝑛 log 𝑊) time algorithm for MWM

An 𝑂(𝑚 𝑛 log(𝑛𝑊)) time algorithm for MWPM


Reduction: if MWM in 𝑔 𝑛, 𝑚, 𝑊 time,
then MWPM in 𝑔 𝑛, 𝑚, (𝑛 + 1)𝑊 time
Open problem:

23
An 𝑂(𝑚 𝑛 log 𝑊) time algorithm for MWPM?
Thank you!
24
Download