Triangle Counting in Large Sparse Graph Meng-Tsung Tsai r95065@cise.ntu.edu.tw Triangle Counting in Large Sparse Graph – p.1/31
Problem Setting Triangle Counting in Large Sparse Graph – p.2/31
Problem Setting(1/3) Goal : Calculating the cluster coefficient of a given graph G ( V, E ) , where | V | = n and | E | = m . Triangle Counting in Large Sparse Graph – p.3/31
Problem Setting(1/3) Goal : Calculating the cluster coefficient of a given graph G ( V, E ) , where | V | = n and | E | = m . Cluster coefficient indicates the probability that the friend of one’s friend is also one’s friend. Triangle Counting in Large Sparse Graph – p.3/31
Problem Setting(1/3) Goal : Calculating the cluster coefficient of a given graph G ( V, E ) , where | V | = n and | E | = m . Cluster coefficient indicates the probability that the friend of one’s friend is also one’s friend. Cluster coefficient is one of the important features to examine whether a man-made graph fits to the real one. Triangle Counting in Large Sparse Graph – p.3/31
Problem Setting(1/3) Goal : Calculating the cluster coefficient of a given graph G ( V, E ) , where | V | = n and | E | = m . Cluster coefficient indicates the probability that the friend of one’s friend is also one’s friend. Cluster coefficient is one of the important features to examine whether a man-made graph fits to the real one. In terms of graph theory, CC ( G ) = 3 × number of triangles ∈ G . number of triples ∈ G Triangle Counting in Large Sparse Graph – p.3/31
Problem Setting(1/3) Goal : Calculating the cluster coefficient of a given graph G ( V, E ) , where | V | = n and | E | = m . Cluster coefficient indicates the probability that the friend of one’s friend is also one’s friend. Cluster coefficient is one of the important features to examine whether a man-made graph fits to the real one. In terms of graph theory, CC ( G ) = 3 × number of triangles ∈ G . number of triples ∈ G ✉ ✉ ✔ ❚ ❚ ✔ ❚ ❚ ✔ ✔ triple triangle ✉ ✉ ✉ ✉ Triangle Counting in Large Sparse Graph – p.3/31
Problem Setting(2/3) Example : ❵❵ ③ ❵ ③ ✔ ❚ ✟ ✟✟✟✟ ✁ ✔ ❚ ✁ ✔ ❚ ✁ ③ ③ Triangle Counting in Large Sparse Graph – p.4/31
Problem Setting(2/3) Example : ❵❵ ③ ❵ ③ ✔ ❚ ✟ ✟✟✟✟ ✁ ✔ ❚ ✁ ✔ ❚ ✁ ③ ③ number of triangle = 2 Triangle Counting in Large Sparse Graph – p.4/31
Problem Setting(2/3) Example : ❵❵ ③ ❵ ③ ✔ ❚ ✟ ✟✟✟✟ ✁ ✔ ❚ ✁ ✔ ❚ ✁ ③ ③ number of triangle = 2 number of triple = 8 Triangle Counting in Large Sparse Graph – p.4/31
Problem Setting(2/3) Example : ❵❵ ③ ❵ ③ ✔ ❚ ✟ ✟✟✟✟ ✁ ✔ ❚ ✁ ✔ ❚ ✁ ③ ③ number of triangle = 2 number of triple = 8 cluster coefficient = 3 × 2 / 8 = 0.75 Triangle Counting in Large Sparse Graph – p.4/31
Problem Setting(2/3) Example : ❵❵ ③ ❵ ③ ✔ ❚ ✟ ✟✟✟✟ ✁ ✔ ❚ ✁ ✔ ❚ ✁ ③ ③ number of triangle = 2 number of triple = 8 cluster coefficient = 3 × 2 / 8 = 0.75 Triple counting is easy; therefore, the main difficulty to calculate CC ( G ) is triangle counting. Triangle Counting in Large Sparse Graph – p.4/31
Problem Setting(3/3) Requirement : Seeking for an efficient algorithm to count the number of triangles such that it takes Ω( m ) space and Ω( n 3 ) time. Triangle Counting in Large Sparse Graph – p.5/31
Problem Setting(3/3) Requirement : Seeking for an efficient algorithm to count the number of triangles such that it takes Ω( m ) space and Ω( n 3 ) time. We focus on social network graphs which cluster coefficient is especially important in. Triangle Counting in Large Sparse Graph – p.5/31
Problem Setting(3/3) Requirement : Seeking for an efficient algorithm to count the number of triangles such that it takes Ω( m ) space and Ω( n 3 ) time. We focus on social network graphs which cluster coefficient is especially important in. In social network, the fact that m = ω ( n 2 ) usually holds. Triangle Counting in Large Sparse Graph – p.5/31
Triangle Counting (Trivial Algorithm) Triangle Counting in Large Sparse Graph – p.6/31
Trivial Algorithm ③ ✔ ❚ ✔ ❚ u v ✔ ❚ ③ ③ Triangle Counting in Large Sparse Graph – p.7/31
Trivial Algorithm ③ ✔ ❚ + ✔ ❚ u v ✔ ❚ ③ ③ Triangle Counting in Large Sparse Graph – p.7/31
Trivial Algorithm ③ ✔ ❚ + ✔ ❚ u v u v ✔ ❚ ③ ③ ③ ③ Triangle Counting in Large Sparse Graph – p.7/31
Trivial Algorithm ③ ✔ ❚ + = ✔ ❚ u v u v ✔ ❚ ③ ③ ③ ③ Triangle Counting in Large Sparse Graph – p.7/31
Trivial Algorithm ③ ③ ✔ ❚ ✔ ❚ + = ✔ ❚ ✔ ❚ u v u v ✔ ❚ ✔ ❚ ③ ③ ③ ③ ③ ③ Triangle Counting in Large Sparse Graph – p.7/31
Trivial Algorithm ③ ③ ✔ ❚ ✔ ❚ + = ✔ ❚ ✔ ❚ u v u v ✔ ❚ ✔ ❚ ③ ③ ③ ③ ③ ③ Let M be a matrix such that M i,j is 1 iff an edge to connect vertices i and j exists. Triangle Counting in Large Sparse Graph – p.7/31
Trivial Algorithm ③ ③ ✔ ❚ ✔ ❚ + = ✔ ❚ ✔ ❚ u v u v ✔ ❚ ✔ ❚ ③ ③ ③ ③ ③ ③ Let M be a matrix such that M i,j is 1 iff an edge to connect vertices i and j exists. Let M 2 be M · M . What does M 2 i,j mean? Triangle Counting in Large Sparse Graph – p.7/31
Trivial Algorithm ③ ③ ✔ ❚ ✔ ❚ + = ✔ ❚ ✔ ❚ u v u v ✔ ❚ ✔ ❚ ③ ③ ③ ③ ③ ③ Let M be a matrix such that M i,j is 1 iff an edge to connect vertices i and j exists. Let M 2 be M · M . What does M 2 i,j mean? � M 2 △ = 1 i,j · M i,j 6 Triangle Counting in Large Sparse Graph – p.7/31
Trivial Algorithm ③ ③ ✔ ❚ ✔ ❚ + = ✔ ❚ ✔ ❚ u v u v ✔ ❚ ✔ ❚ ③ ③ ③ ③ ③ ③ Let M be a matrix such that M i,j is 1 iff an edge to connect vertices i and j exists. Let M 2 be M · M . What does M 2 i,j mean? � M 2 △ = 1 i,j · M i,j 6 Simple Matrix Multiplication , Strassen Algorithm , and Winograd Algorithm all require O ( n 2 ) space to obtain M 2 . Not Acceptable! Triangle Counting in Large Sparse Graph – p.7/31
Triangle Counting (Forward Algorithm) Triangle Counting in Large Sparse Graph – p.8/31
Forward Algorithm(1/2) ❵❵❵❵❵ ⑦ ✔ ❚ ❵ ⑦ ✟ ✟✟✟✟✟✟✟✟✟ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ ⑦ ⑦ Triangle Counting in Large Sparse Graph – p.9/31
Forward Algorithm(1/2) 2 4 ❵❵❵❵❵ ⑦ ✔ ❚ ❵ ⑦ ✟ ✟✟✟✟✟✟✟✟✟ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ 1 ✔ ❚ ✁ 3 ✔ ❚ ✁ ⑦ ⑦ Triangle Counting in Large Sparse Graph – p.9/31
Forward Algorithm(1/2) 2 { 1 } 4 { 1 , 2 , 3 } ❵❵❵❵❵ ⑦ ✔ ❚ ❵ ⑦ ✟ ✟✟✟✟✟✟✟✟✟ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ 1 ✔ {} ❚ ✁ 3 { 2 } ✔ ❚ ✁ ⑦ ⑦ Triangle Counting in Large Sparse Graph – p.9/31
Forward Algorithm(1/2) 2 { 1 } { 1 } ∩ { 1 , 2 , 3 } = { 1 } 4 { 1 , 2 , 3 } ❵❵❵❵❵ ⑦ ✔ ❚ ❵ ⑦ ✟ ✟✟✟✟✟✟✟✟✟ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ 1 ✔ {} ❚ ✁ 3 { 2 } ✔ ❚ ✁ ⑦ ⑦ Triangle Counting in Large Sparse Graph – p.9/31
Forward Algorithm(1/2) 2 { 1 } { 1 } ∩ { 1 , 2 , 3 } = { 1 } 4 { 1 , 2 , 3 } ❵❵❵❵❵ ⑦ ✔ ❚ ❵ ⑦ ✟ ✟✟✟✟✟✟✟✟✟ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ 1 ✔ {} ❚ ✁ 3 { 2 } ✔ ❚ ✁ ⑦ ⑦ △ = � edge ( u,v ) ∈ E | N u ∩ N v | Triangle Counting in Large Sparse Graph – p.9/31
Forward Algorithm(1/2) 2 { 1 } { 1 } ∩ { 1 , 2 , 3 } = { 1 } 4 { 1 , 2 , 3 } ❵❵❵❵❵ ⑦ ✔ ❚ ❵ ⑦ ✟ ✟✟✟✟✟✟✟✟✟ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ 1 ✔ {} ❚ ✁ 3 { 2 } ✔ ❚ ✁ ⑦ ⑦ △ = � edge ( u,v ) ∈ E | N u ∩ N v | all triangles can be found Triangle Counting in Large Sparse Graph – p.9/31
Forward Algorithm(1/2) 2 { 1 } { 1 } ∩ { 1 , 2 , 3 } = { 1 } 4 { 1 , 2 , 3 } ❵❵❵❵❵ ⑦ ✔ ❚ ❵ ⑦ ✟ ✟✟✟✟✟✟✟✟✟ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ 1 ✔ {} ❚ ✁ 3 { 2 } ✔ ❚ ✁ ⑦ ⑦ △ = � edge ( u,v ) ∈ E | N u ∩ N v | all triangles can be found + all found objects are triangles Triangle Counting in Large Sparse Graph – p.9/31
Forward Algorithm(1/2) 2 { 1 } { 1 } ∩ { 1 , 2 , 3 } = { 1 } 2 4 { 1 , 2 , 3 } 1 ❵❵❵❵❵ ❵❵❵❵❵ ⑦ ⑦ ✔ ❚ ✔ ❚ ❵ ❵ ⑦ ⑦ ✟ ✟ ✟✟✟✟✟✟✟✟✟ ✔ ❚ ✟✟✟✟✟✟✟✟✟ ✔ ❚ ✁ ✁ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ ✔ ❚ ✁ 1 ✔ {} ❚ ✁ 3 { 2 } 4 ✔ ❚ ✁ 3 ✔ ❚ ✁ ✔ ❚ ✁ ⑦ ⑦ ⑦ ⑦ △ = � edge ( u,v ) ∈ E | N u ∩ N v | all triangles can be found + all found objects are triangles Triangle Counting in Large Sparse Graph – p.9/31
Recommend
More recommend