Week 10 (Streaming Algorithms) Flashcards
(9 cards)
What is a streaming algorithm?
For a model with a known set of vertices V and edges that arrive one-by-one, we can decide to keep them or not.
What is the upper bound with streaming algorithms?
Upper bound of O(n^2) bits to store the whole adjacency matrix or O(n^2 log n) if we want to remember each edge and endpoint
What is the lower bound for many simple problems for streaming algorithms?
Ω(n^2) bits
What is the index problem?
Alice has X = {X1,…,Xn} ∈ {0,1}^N and Bob has an index i ∈ [N] and wants to find Xi
What is the one-way communication method for the index problem?
If we allow one way communication, Alice must send over all n bits giving an upper bound of n bits.
What is the two-way communication method for the index problem?
With two way communication, Bob can tell Alice the index i using log(i) bits and Alice can return Xi for an overall complexity of log(n) + 1 bits
What is the proof behind the lower bound of the index problem?
Alice needs to send at least N bits. Alice has a possible 2^N inputs.
Suppose Alice sends over <= (N-1) bits to Bob which gives <= 2^n-1 different information to Bob. Propose two pieces of information X and X’ which aren’t equivalent. After removing one index, Alice sends over the same information to Bob for both X and X’, so Bob gets the same value for Xi but X != X.
There is a lower bound of Ω(n^2) bits on 1-way communication from Alice to Bob even allowing randomisation, with probability > 1/2
How can we see if a graph has a cycle using a streaming algorithm?
(Uses the index problem)
Let [r] = {1,…,r} and [N] = {1,…,N}
- Alice and Bob fix a bijection Φ: [r]x[r] -> [N]
- For each i ∈ [N], if Xi = 1 then Alice adds an edge between as and bt where (s,t) = Φ^-1 (i)
- Bob has index I ∈ [N] and computes Φ^-1 (I) = (s, t)
- Bob adds a new vertex z and adds two edges as* - z and bt* - z
- If G has a cycle, then Xi = 1
If Xi = 1, then there exists a cycle between a,b and z. If Xi = 0 then there is no edge between a and b and so no cycle.
Any streaming algorithm for checking if ∃ a cycle can solve the index problem, which has a lower bound of Ω(n^2) bits. Because G has (2r+1) vertices, checking if ∃ a cycle on n-vertex graphs has Ω(n^2) bits lower bound.
What is the streaming algorithm for minimum vertex cover?
Let [r]={1,…,r} and [N] = {1,…,N}
- Alice and Bob fix a bijection Φ: [r]x[r] -> [N]
- For each i ∈ [N], if Xi = 1 then Alice adds an edge between as and bt where (s,t) = Φ^-1 (i)
- Bob has index I ∈ [N] and computes Φ^-1 (I) = (s, t)
- Bob adds two leaves for each vertex in A\as* and B\bt*
- If G is a MinVC of size 2(r-1)+1 then Xi = 1