Dynamic Graphs in the Sliding-Window Model - Semantic Scholar

Report 2 Downloads 56 Views
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 Ωˆminˆn2 , 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 Ωˆminˆn2 , 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 Ωˆminˆn2 , 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 Ωˆminˆn2 , 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 mˆW  on window W

11/14

Unweighted Matching Question: Max matching size mˆW  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 mˆW  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 mˆW  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 mˆW  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 mˆW  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 mˆW  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 mˆAZ  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 mˆAZ  3

mˆAZ  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 mˆAZ  3

mˆAZ  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 mˆAZ  3

mˆAZ  B # endpoints covered by m ˆ ˆA, m ˆ ˆBZ  matchings

B 2m ˆ ˆA  2m ˆ ˆBZ   m ˆ ˆB  B 2m ˆ ˆBZ   Š

2 1

 1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 mˆAZ  3

mˆAZ  B # endpoints covered by m ˆ ˆA, m ˆ ˆBZ  matchings

B 2m ˆ ˆA  2m ˆ ˆBZ   m ˆ ˆB  B 2m ˆ ˆBZ   Š B

2 1

 1m ˆ ˆ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