Near Optimal Streaming algorithms for Graph Spanners

Click here to load reader

  • date post

    06-Jan-2016
  • Category

    Documents

  • view

    29
  • download

    5

Embed Size (px)

description

Near Optimal Streaming algorithms for Graph Spanners. Surender Baswana IIT Kanpur. Graph spanner : a subgraph which is sparse and still preserves all-pairs approximate distances. t -spanner. G=(V,E) : an undirected graph, |V|=n, |E|=m, t > 1 - PowerPoint PPT Presentation

Transcript of Near Optimal Streaming algorithms for Graph Spanners

  • Near Optimal Streaming algorithms for Graph SpannersSurender BaswanaIIT Kanpur

  • Graph spanner :

    a subgraph which is sparse and still preserves all-pairs approximate distances.

  • t-spannerG=(V,E) : an undirected graph, |V|=n, |E|=m, t > 1(u,v) : distance between u and v in G.

    A subgraph GS= (V,ES), where ES is a subset of E such thatfor all u,v V, (u,v) S(u,v) t (u,v)

    t : stretch of the spanner.

  • Sparseness versus stretchConsider a graph modeling some network

    Edges correspond to possible links.

    Each edge has certain cost.

    Aim : to select as few edges as possible without increasing the pair wise distance too much.

  • t-spanner

    Computing a t-spanner of smallest possible size is NP-complete. For a graph on n vertices, how large can a t-spanner be ?vu

  • t-spanner

    Computing a t-spanner of smallest possible size is NP-complete. For a graph on n vertices, how large can a t-spanner be ?uv

  • t-spanner

    Computing a t-spanner of smallest possible size is NP-complete. For a graph on n vertices, how large can a t-spanner be ?uv2-spanner may require (n2) edges

  • t-spanner[Erds 1963, Bollobas, Bondy & Simonovits] There are graphs on n vertices for which every 2k-spanner or a (2k-1)- spanner has (n1+1/k) edges.

    G=(V,E) ALGORITHMGS=(V,ES), |ES|=O(n1+1/k) GS is (2k-1)-spanner

  • Algorithms for t-spanner(RAM model)

  • Algorithms for t-spanner(RAM model) avoids distance computation altogether. near optimal algorithms in parallel, external-memory, distributed environment

  • Computing a t-spanner in streaming environment

    Input : n, m, k, and a stream of edges of an unweighted graphAim : to compute a (2k-1)-spanner

    Efficiency measures : 1. number of passes 2. space (memory) required3. time to process the entire stream

  • Computing a t-spanner in streaming environment

    Input : n, m, k, and a stream of edges of an unweighted graphAim : to compute a (2k-1)-spanner

    Algo 1 : Streaming model

    Efficiency measures : 1. number of passes 12. space (memory) requiredO(kn1+1/k) 3. time to process the entire stream O(m)

  • Computing a t-spanner in streaming environment

    Input : n, m, k, and a stream of edges of an unweighted graphAim : to compute a (2k-1)-spanner

    [Feigenbaum et al., SODA 2005]

    Efficiency measures : 1. number of passes 12. space (memory) requiredO(kn1+1/k) for (2k+1)-spanner3. time to process the entire stream O(mn1/k)

  • Computing a t-spanner in streaming environment

    Input : n, m, k, and a stream of edges of a weighted graphAim : to compute a (2k-1)-spanner

    Algo 2 : StreamSort model

    Efficiency measures : 1. number of passes O(k)2. working memory requiredO(log n) bits3. time spent in one stream pass O(m)

  • Relation to previous resultsB. & Sen, 2003 Feigenbaum et al., 2005 Algo 1 Algo 2 slightly different hierarchy simple buffering technique

  • Algorithm 1

  • Intuitionu

  • IntuitionSpanner edgeu

  • IntuitionSpanner edgeu

  • ClusteruvoC(x) : center of cluster containing xRadius : maximum distance from center to a vertex in the clusterClustering : a set of disjoint clusters

  • 012KK-1Preprocessing : Clustering for the initial (empty) graph

  • 012KK-1Sampling probability = n-1/kPreprocessing : Clustering for the initial (empty) graph

  • 012KK-1Sampling probability = n-1/kPreprocessing : Clustering for the initial (empty) graph

  • 012K-1KSampling probability = n-1/knn1-1/kn1-2/kn1/k0Preprocessing : Clustering for the initial (empty) graph

  • 012K-1Knn1-1/kn1-2/kn1/k0Sampling probability = n-1/kPreprocessing : Clustering for the initial (empty) graph

  • Processing the stream of edgesEach vertex u at level i
  • 012K-1Kuvv

  • 012K-1Kuvv

  • 012K-1Kuvvu

  • 012K-1Kuvvuyxxx

  • 012K-1Kuvvuyxxxy

  • 012K-1Kuvvuyxxxyy

  • 012K-1Kuvvuyxxxyy

  • 012K-1Kuvvuyxxxyyu

  • 012K-1K

  • From perspective of a vertex u ui

  • From perspective of a vertex u ui

  • From perspective of a vertex u ui

  • From perspective of a vertex u

  • From perspective of a vertex u ui

  • From perspective of a vertex u i+1

  • Processing an edge (u,v)

    If Ci(v) is a sampled cluster : Ci+1(u) Ci+1(v); add (u,v) to spanner; u moves to level i+1 (or even higher) Else if Ci(v) was not adjacent to u earlier : add edge (u,v) to spanner; Else Discard (u,v) uiuxxyyi+1

  • 012K-1Knn1-1/kn1-2/kn1/k0

  • Size and stretch of spannerExpected number of spanner edges contributed by a vertex = O(k n1/k).

    Radius of a cluster at level i is at most i.

    For each edge discarded, there is a path in spanner of length (2i+1)

  • Size and stretch of spannerExpected number of spanner edges contributed by a vertex = O(k n1/k).

    Radius of a cluster at level i is at most i.

    A single pass streaming algorithm

    A (2k-1)-spanner of expected size O(kn1+1/k)

  • Running time of the algorithmuiIf Ci(v) is a sampled cluster : Ci+1(u) Ci+1(v); add (u,v) to spanner; u moves to level i+1 (or even higher)Else if Ci(v) was not adjacent to u earlier (n1/k) time add edge (u,v) to spanner; Else Discard (u,v) v

  • Slight modificationEach vertex u keeps two buffers for storing edges incident from clusters at its present level. 1. Temp(u) 2. Es(u)

    Whenever u moves to higher level, move all the edges of Temp(u) and Es(u) to the spanner.

  • Modified algorithmiIf Ci(v) is a sampled cluster : Ci+1(u) Ci+1(v); add (u,v) to spanner; u moves to level i+1 (or even higher)

    Else add (u,v) to Temp(u) and Prune(u) if Temp(u) ES(u)

  • uAdding edges to Temp(u)

  • uAdding edges to Temp(u)

  • Prune(u)u

  • Time complexity analysisPrune(u) can be executed in O(|Temp(u)| + |Es(u)|) time using an an auxiliary O(n) space.

    when is Prune(u) executed ?

  • Time complexity analysisPrune(u) can be executed in O(|Temp(u)| + |Es(u)|) time using an an auxiliary O(n) space.

    Prune(u) is executed only when |Temp(u)| |Es(u)|

  • Time complexity analysisPrune(u) can be executed in O(|Temp(u)| + |Es(u)|) time using an an auxiliary O(n) space.

    Prune(u) is executed only when |Temp(u)| |Es(u)|

    We can charge O(1) cost to each edge in Temp(u).

  • Time complexity analysisPrune(u) can be executed in O(|Temp(u)| + |Es(u)|) time using an an auxiliary O(n) space.

    Prune(u) is executed only when |Temp(u)| |Es(u)|

    We can charge O(1) cost to each edge in Temp(u).

    An edge is processed in Temp(u) at most once.

  • Time complexity analysisPrune(u) can be executed in O(|Temp(u)| + |Es(u)|) time using an an auxiliary O(n) space.

    Prune(u) is executed only when |Temp(u)| |Es(u)|

    We can charge O(1) cost to each edge in Temp(u).

    An edge is processed in Temp(u) at most once.Total time spent in processing the stream = O(m)

  • Size of (2k-1)-spannerExpected size of |Es(u)| = O(n1/k)

    Temp(u) never exceeds |Es(u)| +1.

    Expected size of (2k-1)-spanner is O(k n1+1/k)

  • ConclusionTHEOREM 1 : Given any k N, a (2k-1)-spanner of expected size O(kn1+1/k) for any unweighted graph can be computed in one Stream pass with O(m) time to process the entire stream of edges.

    THEOREM 2 : Given any k N, a (2k-1)-spanner of expected size O(kn1+1/k) for any weighted graph can be computed in O(k) StreamSort passes with O(log n) bits of working memory.