Algorithms for Big Data (VII) Chihao Zhang Shanghai Jiao Tong University Nov. 1, 2019 Algorithms for Big Data (VII) 1/17
Review We introduced the graph stream last week. The graph has vertices, but the edges are given in a streaming fashion. Compute graph properties in time. This can be done for connectivity and bipartiteness . Algorithms for Big Data (VII) 2/17
Review We introduced the graph stream last week. The graph has vertices, but the edges are given in a streaming fashion. Compute graph properties in time. This can be done for connectivity and bipartiteness . Algorithms for Big Data (VII) 2/17
Review We introduced the graph stream last week. Compute graph properties in time. This can be done for connectivity and bipartiteness . Algorithms for Big Data (VII) 2/17 The graph has n vertices, but the edges are given in a streaming fashion.
Review We introduced the graph stream last week. This can be done for connectivity and bipartiteness . Algorithms for Big Data (VII) 2/17 The graph has n vertices, but the edges are given in a streaming fashion. Compute graph properties in o ( n 2 ) time.
Review We introduced the graph stream last week. This can be done for connectivity and bipartiteness . Algorithms for Big Data (VII) 2/17 The graph has n vertices, but the edges are given in a streaming fashion. Compute graph properties in o ( n 2 ) time.
Shortest Path Given an undirected simple graph . We want to answer the query “what is the minimum distance between and for ”. Our algorithm computes a subgraph of such that for some constant . Algorithms for Big Data (VII) 3/17
Shortest Path Our algorithm computes a subgraph of such that for some constant . Algorithms for Big Data (VII) 3/17 Given an undirected simple graph G = ( V, E ) . We want to answer the query “what is the minimum distance between u and v for u, v ∈ V ”.
Algorithms for Big Data (VII) Shortest Path 3/17 Given an undirected simple graph G = ( V, E ) . We want to answer the query “what is the minimum distance between u and v for u, v ∈ V ”. Our algorithm computes a subgraph H = ( V, E H ) of G such that ∀ u, v ∈ V, d G ( u, v ) ≤ d H ( u, v ) ≤ α · d G ( u, v ) for some constant α ≥ 1 .
Algorithm Shortest Path Init: end if Algorithms for Big Data (VII) 4/17 E H ← ∅ ; On Input ( u, v ) : if d H ( u, v ) ≥ α + 1 then H ← H ∪ { ( u, v ) } Output: On query ( u, v ) Output d H ( u, v ) .
5/17 . Algorithms for Big Data (VII) In all, we have , it must hold that into , then when we are trying to insert If , then Consider the shortest path from If . Then : in to Clearly, d H ( u, v ) ≥ d H ( u, v ) as H contains less edges.
Then . If , then . If , then when we are trying to insert into , it must hold that In all, we have Algorithms for Big Data (VII) 5/17 Clearly, d H ( u, v ) ≥ d H ( u, v ) as H contains less edges. Consider the shortest path from u to v in G : u = x 1 , x 2 , . . . , x k = v.
, then If . If , then when we are trying to insert into , it must hold that In all, we have Algorithms for Big Data (VII) 5/17 Clearly, d H ( u, v ) ≥ d H ( u, v ) as H contains less edges. Consider the shortest path from u to v in G : u = x 1 , x 2 , . . . , x k = v. Then d G ( u, v ) = ∑ k − 1 i = 1 d ( x i , x i + 1 ) .
If , then when we are trying to insert into , it must hold that In all, we have Algorithms for Big Data (VII) 5/17 Clearly, d H ( u, v ) ≥ d H ( u, v ) as H contains less edges. Consider the shortest path from u to v in G : u = x 1 , x 2 , . . . , x k = v. Then d G ( u, v ) = ∑ k − 1 i = 1 d ( x i , x i + 1 ) . If ( x i , x i + 1 ) ∈ E H , then d H ( x i , x i + 1 ) = d G ( x i , x i + 1 ) .
In all, we have Algorithms for Big Data (VII) 5/17 Clearly, d H ( u, v ) ≥ d H ( u, v ) as H contains less edges. Consider the shortest path from u to v in G : u = x 1 , x 2 , . . . , x k = v. Then d G ( u, v ) = ∑ k − 1 i = 1 d ( x i , x i + 1 ) . If ( x i , x i + 1 ) ∈ E H , then d H ( x i , x i + 1 ) = d G ( x i , x i + 1 ) . If ( x i , x i + 1 ) ̸∈ E H , then when we are trying to insert ( x i , x i + 1 ) into E H , it must hold that d H ( x i , x i + 1 ) ≤ α.
Algorithms for Big Data (VII) In all, we have 5/17 Clearly, d H ( u, v ) ≥ d H ( u, v ) as H contains less edges. Consider the shortest path from u to v in G : u = x 1 , x 2 , . . . , x k = v. Then d G ( u, v ) = ∑ k − 1 i = 1 d ( x i , x i + 1 ) . If ( x i , x i + 1 ) ∈ E H , then d H ( x i , x i + 1 ) = d G ( x i , x i + 1 ) . If ( x i , x i + 1 ) ̸∈ E H , then when we are trying to insert ( x i , x i + 1 ) into E H , it must hold that d H ( x i , x i + 1 ) ≤ α. d H ( u, v ) ≤ α · d G ( u, v ) .
The girth Space Consumption We need a bit of graph theory to analyze the space consumption. of a graph is the length of its shortest cycle. It is clear that . Theorem Let be a sufgiciently large graph with . Let and . Then Algorithms for Big Data (VII) 6/17
The girth Space Consumption We need a bit of graph theory to analyze the space consumption. of a graph is the length of its shortest cycle. It is clear that . Theorem Let be a sufgiciently large graph with . Let and . Then Algorithms for Big Data (VII) 6/17
Space Consumption We need a bit of graph theory to analyze the space consumption. It is clear that . Theorem Let be a sufgiciently large graph with . Let and . Then Algorithms for Big Data (VII) 6/17 The girth g ( G ) of a graph G is the length of its shortest cycle.
Space Consumption We need a bit of graph theory to analyze the space consumption. Theorem Let be a sufgiciently large graph with . Let and . Then Algorithms for Big Data (VII) 6/17 The girth g ( G ) of a graph G is the length of its shortest cycle. It is clear that g ( H ) ≥ α + 2 .
Space Consumption We need a bit of graph theory to analyze the space consumption. Theorem Then Algorithms for Big Data (VII) 6/17 The girth g ( G ) of a graph G is the length of its shortest cycle. It is clear that g ( H ) ≥ α + 2 . Let G = ( V, E ) be a sufgiciently large graph with g ( G ) ≥ k . Let n = | V | and m = | E | . 1 1 + ⌋ . ⌊ k − 1 m ≤ n + n 2
Let be the average degree of , then contains a -core. (Why?) The -core has girth at least , so we can find a BFS tree in it with depth and width . The number of the vertices satisfies This bound is in fact tight, can you prove it? Algorithms for Big Data (VII) 7/17 The k -core of a graph G is a subgraph whose degree is at least k .
The -core has girth at least , so we can find a BFS tree in it with depth and width . The number of the vertices satisfies This bound is in fact tight, can you prove it? Algorithms for Big Data (VII) 7/17 The k -core of a graph G is a subgraph whose degree is at least k . Let d = 2m/n be the average degree of G , then G contains a d/2 -core. (Why?)
The number of the vertices satisfies This bound is in fact tight, can you prove it? Algorithms for Big Data (VII) 7/17 The k -core of a graph G is a subgraph whose degree is at least k . Let d = 2m/n be the average degree of G , then G contains a d/2 -core. (Why?) The d/2 -core has girth at least k , so we can find a BFS tree in it with depth ⌊ k − 1 2 ⌋ and width d 2 − 1 .
7/17 The number of the vertices satisfies Algorithms for Big Data (VII) This bound is in fact tight, can you prove it? The k -core of a graph G is a subgraph whose degree is at least k . Let d = 2m/n be the average degree of G , then G contains a d/2 -core. (Why?) The d/2 -core has girth at least k , so we can find a BFS tree in it with depth ⌊ k − 1 2 ⌋ and width d 2 − 1 . ( d ) ⌊ k − 1 ( m ) ⌊ k − 1 2 ⌋ 2 ⌋ n ≥ 2 − 1 = n − 1 .
7/17 The number of the vertices satisfies Algorithms for Big Data (VII) This bound is in fact tight, can you prove it? The k -core of a graph G is a subgraph whose degree is at least k . Let d = 2m/n be the average degree of G , then G contains a d/2 -core. (Why?) The d/2 -core has girth at least k , so we can find a BFS tree in it with depth ⌊ k − 1 2 ⌋ and width d 2 − 1 . ( d ) ⌊ k − 1 ( m ) ⌊ k − 1 2 ⌋ 2 ⌋ n ≥ 2 − 1 = n − 1 .
The problem of finding maximum matching is a famous polynmial-time solvable Now we try to approximate it in the streaming setuing. Matchings Let be a graph, a matching consisting of edges sharing no vertex. problem. Algorithms for Big Data (VII) 8/17
The problem of finding maximum matching is a famous polynmial-time solvable Now we try to approximate it in the streaming setuing. Matchings problem. Algorithms for Big Data (VII) 8/17 Let G = ( V, E ) be a graph, a matching M ⊆ E consisting of edges sharing no vertex.
Now we try to approximate it in the streaming setuing. Matchings problem. Algorithms for Big Data (VII) 8/17 Let G = ( V, E ) be a graph, a matching M ⊆ E consisting of edges sharing no vertex. The problem of finding maximum matching is a famous polynmial-time solvable
Matchings problem. Algorithms for Big Data (VII) 8/17 Let G = ( V, E ) be a graph, a matching M ⊆ E consisting of edges sharing no vertex. The problem of finding maximum matching is a famous polynmial-time solvable Now we try to approximate it in the streaming setuing.
Recommend
More recommend