faster algorithms for semimatching problems
DESCRIPTION
I am finding a creative way for presenting mathematics.TRANSCRIPT
Faster algorithms for min-delay time semi-matching
Bundit LaekhanukitC&O, University of Waterloo
joint work withJ. Fakcharoenphol and D. Nanongkai
Agenda
● Definition of min-delay semimatching problem● Previous works & Our results● Unit cost
– Reduction to min-cost flow
– An algorithm for unit cost
● General cost– Reduction to weighted bipartite matching
– Sketch of an algorithm for general cost
Semimatching on bipartite graphs
U V
Matching MU V
Semimatching M'
No restrictionincident to= 1 M'-edge
incident to≤ 1 M-edge
U V
u1
x
u2
y
3
z
u4
Jobs Machines
u1 u2 u3
Wait for being processed1 unit of time
u3 Wait for u1 and itself to be processed1 + 1 units of time
Unit cost
U V
u1
x
u2
y
3
z
u4
Jobs Machines
u1 u2 u3
u3
Delay time at machine a = 1 + 2 + 3 units of time
Unit cost
U V
u1
x
u2
y
3
z
u4
Jobs Machines
u3
Total delay time (cost of semimatching) = 6 + 1 units of time
Delay time is flow time in scheduling terminology
Unit cost
U V
u1
x
u2
y
3
z
u4
Jobs Machines
u1 u2 u3
u3
Delay time at machine x = 1 + (1+2) + (1+2+3)units of time
2
1
3
2 1 3
u2 u1 u3
1 2 3Reorder to minimize delay
2
General cost
Previous works & Our results
Previous Works & Our results
● Unit cost
Harvey, Ladner, Lovász, and Tamir (2003) :
O(nm)-algorithm using modified Hungarian method
Our algorithm : O(n1/2m log n)
● General cost
Bruno, Coffman, and Sethi (1974) :
O(n3)-algorithm using a reduction to bipartite matching
Our algorithm : O(nm log n)
n : number of vertices, m : number of edges
Unit cost
Harvey et. al. reduction from unit cost semimatching to min-cost flow
U V
u1
x
u2
y
3
z
u4
u3
A reduction to min-cost flow
U V
u1
x
u2
y
3
z
u4
u3
s t
C1
C2
C3
Capacity = 1, Cost = 0
Infinite capacity
Capacity = 1, Cost = 0
Cost=1
Cost=2
Cost=3
A reduction to min-cost flow
Cost centers
U V
u1
x
u2
y
3
z
u4
u3
s t
C1
C2
C3
Capacity = 1, Cost = 0
Infinite capacity
Capacity = 1, Cost = 0
Cost=1
Cost=3
Cost=2
Cost centers
A reduction to min-cost flow
min-cost flow = min-delay semimatching
An algorithm for unit cost
Running timeDirectly apply min-cost flow : O(nm log2 n)
Previous best (Harvey et. al. 2003) : O(nm)
Our algorithm : O(n1/2m log n)
Use the reduction to min-cost flow and divide & conquer technique
High Level Details
U tV
LowCost
s
HighCost
Start from any semimatching and construct flow
High Level Details
U tV
LowCost
s
HighCost
Push flow to lowercost centers
Source and Sink can be ignored
High Level Details
U V LowCost
HighCost
Divide into two subproblems and recursively solve them
U V
No residual path from G2 to G1
G1
G2
U V
Start from an arbitrary semimatching
u1
u2
3
u4
u3
u5
u4
x
y
z
U V
Construct a corresponding flow
u1
u2
3
u4
u3
u5
u4
Cost=1
Cost=3
Cost=2
Cost=4
t
x
y
z
C1
C2
C3
C4
s
Cost centers
U V
A flow is not a cheapest
u1
u2
3
u4
u3
u5
u4
Cost=1
Cost=3
Cost=2
Cost=4
ts
C1
C2
C3
C4
x
y
z
Cost centers
U V
Find a max-flow to lower cost centers
u1
u2
3
u4
u3
u5
u4
x
y
z
C1
C2
C3
C4
T'
S'
Cost centers
Source and Sink are ignored
U V
An improved flow
u1
u2
3
u4
u3
u5
u4
x
y
z
C1
C2
C3
C4
Cost centers
Divide & recursively solve subproblems
u1
u2
3
u4
u3
u5
u4
x
y
z
C1
C2
C3
C4
Reachable from C3 , C4 by residual paths
Not reachable from C3 , C4 by residual paths
G1
G2
Separated by min-cut
Divide & recursively solve subproblems
u1
u2
3
u4
u3
u5
u4
x
y
z
C1
C2
C3
C4
Solve subproblems
Push flow in G1
G1
G2
No flow path in G2
A min-cost flow
u1
u2
3
u4
u3
u5
u4
x
y
z
C1
C2
C3
C4
ts
A min-delay semimatching
u1
u2
3
u4
u3
u5
u4
x
y
z
Running time
Running time analysis
● Push flow to lower cost centers O(n1/2m)
(Dinitz's blocking flow algorithm with analysis similar to Kazanov 1973, Even & Tarjan 1974)
● Total running time
T(n, m, c) = T(n1, m
1, c/2) + T(n
2, m
2, c/2) + O(n1/2m)
= . . . = O(n1/2m log n)
n = number of vertices, m = number of edges
c = number of cost centers ≤ n
General cost
Bruno et. al. reduction toweighted bipartite matching
U V
u1
x
u2
y
3
z
u4
Jobs Machines
u3
Delay time at machine a = 1 + (1+2) + (1+2+3)= 3 · 1 + 2 · 2 + 1 · 3units of time
2
1
3
u2 u1 u3
1 2 3
2
A reduction to bipartite matching
U V
u1
x
u2
y
3
z
u4
u3
2
1
3
2
3
5
x1
2 · 1
1 · 1
3 · 1
x2
2 · 2
1 · 2
3 · 2
x3
2 · 3
1 · 3
3 · 3
A reduction to bipartite matching
u1
x3u2
y13
z1u4
u3
639
2
3
5
x1213
x24
26
z2
410
A reduction to bipartite matching
u1
x3u2
y13
z1u4
u3
x1
x2
z2
10
639
2
3
5
213
42
6
4
Equivalent to assign u1, u2 to x
A reduction to bipartite matching
min-weight matching = min-delay semimatching
An algorithm for general cost
Running timeDirectly apply matching algorithm : O(nm2)
Previous best (Bruno et. al. 1974) : O(n3)
Our algorithm : O(nm log n)
Use the reduction to bipartite matching exploit structure of potential function
U
z
y
High level details
x
Copies of vertices of V
Reduce to bipartite matching
U
z
y
High level details
xAugment matching byshortest augmenting paths(Edmond & Karp 1970,Tomizawa 1971)
U
z
y
High level details
xCost of matching edgesare negative
- 10
7
Assign potentialfunction to make non-negativereduced cost
U
z
y
High level details
xCost of matching edgesare negative
- 10
7
Use distancelabels fromprevious round as potentialfunction
u1
xk
x1
xi
Distances has a break point
Distances areweakly decreasing
Distances areweakly increasing
Dual variables forx1 ,x2, ..., xk havea break point
xj is a copy of x with edge costs multiplied by j
U
z
y
Data structure for fast query
x
Create datastructures ateach set forfast distancequery
Use a data structureexploiting the propertyto find a shortest augmenting path
Running time analysis
● Using a special data structure, a shortest augmenting path can be found in O(n + m log n)
● Augmenting the matching n times● Total running time O(nm log n)
Summary
● Unit cost– Previous best running time O(nm)
– Our running time O(n1/2m log n)
● General cost– Previous best running time O(n3)
– Our running time O(nm log n)
Open ProblemsIs it possible to meet the running time of bipartite matching?
● Unit cost– The best running time O(n1/2m) (Hopcroft & Karp 1973)
– Our algorithm O(n1/2m log n)
● General cost– The running time
● O(nm) (Edmond & Karp 1970, Tomizawa 1971)● O(n1/2m log nWmax) (Gabow & Tajan 1989)
– Our algorithm O(nm log n)
Thank you for your attention
Questions ?