Dynamic Graphs in the Sliding-Window Model Michael Crouch
Daniel Stubbs
Andrew McGregor
University of Massachusetts, Amherst
September 2, 2013
1/14
Outline
Sliding Window Graphs Connectivity Algorithms Connectivity k-connectivity Other Problems Matching Algorithms Unweighted Matching Weighted Matching
2/14
Outline
Sliding Window Graphs Connectivity Algorithms Connectivity k-connectivity Other Problems Matching Algorithms Unweighted Matching Weighted Matching
3/14
Introduction L Streaming graph problems in the sliding window model
4/14
Introduction L Streaming graph problems in the sliding window model L Streaming graph: L List of edges from n-node graph
4/14
Introduction L Streaming graph problems in the sliding window model L Streaming graph: L List of edges from n-node graph L In-order access L Restricted memory
4/14
Introduction L Streaming graph problems in the sliding window model L Streaming graph: L List of edges from n-node graph L In-order access L Restricted memory O n polylog n
4/14
Introduction L Streaming graph problems in the sliding window model L Streaming graph: L List of edges from n-node graph L In-order access L Restricted memory O n polylog n L Sliding window: L L L
Existing work considers numeric and statistical quantities Window length L Maintain data structure about the most recent L elements
4/14
Introduction L Streaming graph problems in the sliding window model L Streaming graph: L List of edges from n-node graph L In-order access L Restricted memory O n polylog n L Sliding window: L L L L
Existing work considers numeric and statistical quantities Window length L Maintain data structure about the most recent L elements Ask questions about “the last L edges”:
4/14
Introduction L Streaming graph problems in the sliding window model L Streaming graph: L List of edges from n-node graph L In-order access L Restricted memory O n polylog n L Sliding window: L L L L
Existing work considers numeric and statistical quantities Window length L Maintain data structure about the most recent L elements Ask questions about “the last L edges”: L “Do the last L edges describe a connected graph?”
4/14
Introduction L Streaming graph problems in the sliding window model L Streaming graph: L List of edges from n-node graph L In-order access L Restricted memory O n polylog n L Sliding window: L L L L
Existing work considers numeric and statistical quantities Window length L Maintain data structure about the most recent L elements Ask questions about “the last L edges”: L “Do the last L edges describe a connected graph?” L “What’s a large matching on the last L edges?”
4/14
Introduction L Streaming graph problems in the sliding window model L Streaming graph: L List of edges from n-node graph L In-order access L Restricted memory O n polylog n L Sliding window: L L L L
Existing work considers numeric and statistical quantities Window length L Maintain data structure about the most recent L elements Ask questions about “the last L edges”: L “Do the last L edges describe a connected graph?” L “What’s a large matching on the last L edges?”
L
Any edge beyond a certain age is implicitly “deleted”
4/14
Introduction L Streaming graph problems in the sliding window model L Streaming graph: L List of edges from n-node graph L In-order access L Restricted memory O n polylog n L Sliding window: L L L L
Existing work considers numeric and statistical quantities Window length L Maintain data structure about the most recent L elements Ask questions about “the last L edges”: L “Do the last L edges describe a connected graph?” L “What’s a large matching on the last L edges?”
L
Any edge beyond a certain age is implicitly “deleted”
L We present the first sliding-window graph algorithms
4/14
Summary of Results Problem
Approx.
5/14
Space (bits)
Summary of Results Problem
Approx.
Connectivity k-Connectivity
Space (bits) n log n kn log n
5/14
Summary of Results Problem
Approx.
Connectivity k-Connectivity Sparsifiers
1
5/14
Space (bits) n log n kn log n 2 n log4 n
Summary of Results Problem
Approx.
Connectivity k-Connectivity Sparsifiers Bipartiteness
1
5/14
Space (bits) n log n kn log n 2 n log4 n n log n
Summary of Results Problem
Approx.
Connectivity k-Connectivity Sparsifiers Bipartiteness MST
1 1
5/14
Space (bits) n log n kn log n 2 n log4 n n log n 1 n log2 n
Summary of Results Problem
Approx.
Connectivity k-Connectivity Sparsifiers Bipartiteness MST
1 1 1
5/14
Space (bits) n log n kn log n 2 n log4 n n log n 1 n log2 n Ωminn2 , L
Summary of Results Problem
Approx.
Connectivity k-Connectivity Sparsifiers Bipartiteness MST
1 1
n log n kn log n 2 n log4 n n log n 1 n log2 n Ωminn2 , L
3
1 n log2 n
1
Unweighted Matching
5/14
Space (bits)
Summary of Results Problem
Approx.
Connectivity k-Connectivity Sparsifiers Bipartiteness MST
Unweighted Matching Weighted Matching
Space (bits)
1 1
n log n kn log n 2 n log4 n n log n 1 n log2 n Ωminn2 , L
3 9.027
1 n log2 n n log3 n
1
5/14
Summary of Results Problem
Approx.
Connectivity k-Connectivity Sparsifiers Bipartiteness MST
Unweighted Matching Weighted Matching
Space (bits)
1 1
n log n kn log n 2 n log4 n n log n 1 n log2 n Ωminn2 , L
3 9.027
1 n log2 n n log3 n
1
5/14
Outline
Sliding Window Graphs Connectivity Algorithms Connectivity k-connectivity Other Problems Matching Algorithms Unweighted Matching Weighted Matching
6/14
Graph Connectivity Question: Is graph connected (by last L edges)?
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle
1
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle 2 1
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle 2 1 3
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle 4
2
1 3
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle 4
2 5
1 3
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle 4
2 5
1 3 6
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle 4 5
1 3 6
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle 4
2 5
1 3 6
Analysis: L A cycle crosses any cut an even number of times L We never remove the youngest edge across any cut
7/14
Graph Connectivity Question: Is graph connected (by last L edges)? L Maintain the most recent edge across every cut.
Algorithm: L Maintain a set F of timestamped edges, initially F
g
L On reading edge e, add e to F L If this creates a cycle, remove the oldest edge from the cycle 4
2 5
1 3 6
Analysis: L A cycle crosses any cut an even number of times L We never remove the youngest edge across any cut L Store at most n 1 edges 7/14
k-connectivity Question: Are there C k edges across every cut?
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk .
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk .
1
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk .
1
2
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk .
3 1
2
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 4 3 1
2
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 4 3
2
1
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 5 4 3
2
1
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 5 4 3
6 2
1
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 5 6 3
4
2
1
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 5 6 3
4
2
1
7
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 5 6 3
4
2
1
8 7
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 5 6
4 3
2
1
8 7
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 5 6
4 3
2 8 7
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 5 6
4 3
2 8 7
Analysis: L For j B k, F1 , . . . , Fj contain youngest j edges across each cut
8/14
k-connectivity Question: Are there C k edges across every cut? Algorithm: L Maintain edge sets F1 , F2 , . . . , Fk per connectivity algorithm. L Add incoming edges to F1 . L When removing an edge from Fi , insert it in Fi 1 . L Discard edges removed from Fk . 5 6
4 3
2 8 7
Analysis: L For j B k, F1 , . . . , Fj contain youngest j edges across each cut L Store at most k n 1 edges
8/14
Connectivity Problems L Theorem: We can maintain k-connectivity information in the sliding window model using space O kn log n bits
9/14
Connectivity Problems L Theorem: We can maintain k-connectivity information in the sliding window model using space O kn log n bits L Sparsifiers (weighted sparse subgraph, preserves approximate
cut weights)
9/14
Connectivity Problems L Theorem: We can maintain k-connectivity information in the sliding window model using space O kn log n bits L Sparsifiers (weighted sparse subgraph, preserves approximate
cut weights) L
Ahn/Guha/McGregor SODA 2012, sample edges w probability inv. proportional to size of minimum cut containing that edge
9/14
Connectivity Problems L Theorem: We can maintain k-connectivity information in the sliding window model using space O kn log n bits L Sparsifiers (weighted sparse subgraph, preserves approximate
cut weights) L L L
Ahn/Guha/McGregor SODA 2012, sample edges w probability inv. proportional to size of minimum cut containing that edge We keep O log n k-Connectivity sketches for k O 2 log2 n Space O 2 n log4 n bits
9/14
Connectivity Problems L Theorem: We can maintain k-connectivity information in the sliding window model using space O kn log n bits L Sparsifiers (weighted sparse subgraph, preserves approximate
cut weights) L L L
Ahn/Guha/McGregor SODA 2012, sample edges w probability inv. proportional to size of minimum cut containing that edge We keep O log n k-Connectivity sketches for k O 2 log2 n Space O 2 n log4 n bits
L Bipartiteness: Simple reduction, count connected components
9/14
Connectivity Problems L Theorem: We can maintain k-connectivity information in the sliding window model using space O kn log n bits L Sparsifiers (weighted sparse subgraph, preserves approximate
cut weights) L L L
Ahn/Guha/McGregor SODA 2012, sample edges w probability inv. proportional to size of minimum cut containing that edge We keep O log n k-Connectivity sketches for k O 2 log2 n Space O 2 n log4 n bits
L Bipartiteness: Simple reduction, count connected components L MST: 1 approximation in space O 1 n log n bits
9/14
Connectivity Problems L Theorem: We can maintain k-connectivity information in the sliding window model using space O kn log n bits L Sparsifiers (weighted sparse subgraph, preserves approximate
cut weights) L L L
Ahn/Guha/McGregor SODA 2012, sample edges w probability inv. proportional to size of minimum cut containing that edge We keep O log n k-Connectivity sketches for k O 2 log2 n Space O 2 n log4 n bits
L Bipartiteness: Simple reduction, count connected components L MST: 1 approximation in space O 1 n log n bits L
Separate edges into geometric weight classes En < e > E
L L
1 n B w e @ 1 n1
S
Keep spanning tree in each weight class Merge greedily 9/14
Outline
Sliding Window Graphs Connectivity Algorithms Connectivity k-connectivity Other Problems Matching Algorithms Unweighted Matching Weighted Matching
10/14
Unweighted Matching Question: Max matching size mW on window W
11/14
Unweighted Matching Question: Max matching size mW on window W Idea: “Sandwich” the window between two suffixes Stream
A⊇W⊇B
W A
B
“Smooth histograms”, Braverman/Ostrovsky FOCS 2007
11/14
Unweighted Matching Question: Max matching size mW on window W Idea: “Sandwich” the window between two suffixes Stream
A⊇W⊇B
W A
m(A) ≥ m(W) ≥ m(B) B
“Smooth histograms”, Braverman/Ostrovsky FOCS 2007
11/14
Unweighted Matching Question: Max matching size mW on window W Idea: “Sandwich” the window between two suffixes Stream
A⊇W⊇B
W A
m(A) ≥ m(W) ≥ m(B) B
C
D
.........
K
“Smooth histograms”, Braverman/Ostrovsky FOCS 2007
11/14
Unweighted Matching Question: Max matching size mW on window W Idea: “Sandwich” the window between two suffixes Stream
A⊇W⊇B
W A
m(A) ≥ m(W) ≥ m(B) B
C
D
.........
K
“Smooth histograms”, Braverman/Ostrovsky FOCS 2007 Have: Greedy matching m ˆ B ( 12 -approximation of m)
11/14
Unweighted Matching Question: Max matching size mW on window W Idea: “Sandwich” the window between two suffixes Stream
A⊇W⊇B
W A
m(A) ≥ m(W) ≥ m(B) B
C
D
.........
K
“Smooth histograms”, Braverman/Ostrovsky FOCS 2007 Have: Greedy matching m ˆ B ( 12 -approximation of m) Algorithm: L Start a new parallel greedy matching at every element(!) L Prune matchings when A 2 consecutive are within 1
11/14
Unweighted Matching Question: Max matching size mW on window W Idea: “Sandwich” the window between two suffixes Stream
A⊇W⊇B
W A
m(A) ≥ m(W) ≥ m(B) B
C
D
.........
K
“Smooth histograms”, Braverman/Ostrovsky FOCS 2007 Have: Greedy matching m ˆ B ( 12 -approximation of m) Algorithm: L Start a new parallel greedy matching at every element(!) L Prune matchings when A 2 consecutive are within 1
Space Use: O 1 log n greedy matchings 11/14
Unweighted Matching: Approximation Guarantee L We discarded sketches, maintaining 1 factor
A
B
12/14
Unweighted Matching: Approximation Guarantee L We discarded sketches, maintaining 1 factor
A
B
Z
12/14
Unweighted Matching: Approximation Guarantee L We discarded sketches, maintaining 1 factor
A
B
Lemma m ˆ B C 1 m ˆ A
Z
Proof
12/14
m ˆ BZ C
1 mAZ 3
Unweighted Matching: Approximation Guarantee L We discarded sketches, maintaining 1 factor
A
B
Z
Lemma m ˆ B C 1 m ˆ A
Proof
m ˆ BZ C
1 mAZ 3
mAZ B # endpoints covered by m ˆ A, m ˆ BZ matchings
B 2m ˆ A 2m ˆ BZ
12/14
Unweighted Matching: Approximation Guarantee L We discarded sketches, maintaining 1 factor
A
B
Z
Lemma m ˆ B C 1 m ˆ A
m ˆ BZ C
Proof
1 mAZ 3
mAZ B # endpoints covered by m ˆ A, m ˆ BZ matchings
B 2m ˆ A 2m ˆ BZ m ˆ B
12/14
Unweighted Matching: Approximation Guarantee L We discarded sketches, maintaining 1 factor
A
B
Z
Lemma
m ˆ B C 1 m ˆ A
m ˆ BZ C
Proof
1 mAZ 3
mAZ B # endpoints covered by m ˆ A, m ˆ BZ matchings
B 2m ˆ A 2m ˆ BZ m ˆ B B 2m ˆ BZ
2 1
1m ˆ B
12/14
Unweighted Matching: Approximation Guarantee L We discarded sketches, maintaining 1 factor
A
B
Z
Lemma
m ˆ B C 1 m ˆ A
m ˆ BZ C
Proof
1 mAZ 3
mAZ B # endpoints covered by m ˆ A, m ˆ BZ matchings
B 2m ˆ A 2m ˆ BZ m ˆ B B 2m ˆ BZ B
2 1
1m ˆ B
3 m ˆ BZ 1
12/14
Matching Conclusions Unweighted Matching: L Theorem: We can 3 approximate maximum unweighted matching in the sliding window model in O 1 n log2 n bits.
13/14
Matching Conclusions Unweighted Matching: L Theorem: We can 3 approximate maximum unweighted matching in the sliding window model in O 1 n log2 n bits.
Weighted Matching: L Theorem: 9.048-approximation in space O n log3 n L
Adaptation of Epstein et al. 2011
13/14
Matching Conclusions Unweighted Matching: L Theorem: We can 3 approximate maximum unweighted matching in the sliding window model in O 1 n log2 n bits.
Weighted Matching: L Theorem: 9.048-approximation in space O n log3 n L
Adaptation of Epstein et al. 2011
L Separate edges into geometric weight classes L Calculate unweighted matching on each weight class L Merge matchings
13/14
Matching Conclusions Unweighted Matching: L Theorem: We can 3 approximate maximum unweighted matching in the sliding window model in O 1 n log2 n bits.
Weighted Matching: L Theorem: 9.048-approximation in space O n log3 n L
Adaptation of Epstein et al. 2011
L Separate edges into geometric weight classes L Calculate unweighted matching on each weight class L Merge matchings L Error from grouping vs. error from merging
13/14
Matching Conclusions Unweighted Matching: L Theorem: We can 3 approximate maximum unweighted matching in the sliding window model in O 1 n log2 n bits.
Weighted Matching: L Theorem: 9.048-approximation in space O n log3 n L
Adaptation of Epstein et al. 2011
L Separate edges into geometric weight classes L Calculate unweighted matching on each weight class L Merge matchings L Error from grouping vs. error from merging L Analysis differs: our matchings are not guaranteed maximal
13/14
Summary of Results Problem Connectivity k-Connectivity Sparsifiers Bipartiteness MST
Unweighted Matching Weighted Matching
Approx.
Space (bits)
1 1
n log n kn log n 2 n log4 n n log n 1 n log2 n Ω n 2
3 9.027
1 n log2 n n log3 n
1
Thank you!
14/14