Graph Compression Using Quadtrees
- Dr. Amlan Chatterjee
Graph Compression Using Quadtrees Dr. Amlan Chatterjee Computer - - PowerPoint PPT Presentation
Graph Compression Using Quadtrees Dr. Amlan Chatterjee Computer Science Department California State University, Dominguez Hills April 27, 2016 Outline Storing graphs 1 Quadtree representation of graphs 2 Special graphs 3 Modifying
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
2
1 2 3 4 5 6
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
3
1 6 2 3 4 5
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
4
The adjacency matrix representation is given by: 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
5
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
6
The adjacency array representation is given by:
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
7
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
8
(size of pointers) (node numbers) (size of each list)
(size of pointers) (node numbers) (size of each list)
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
9
Considering the previous example graph G = (V,E) For the above graph, n = 8, m = 16. The adjacency matrix size is: 64 bits The adjacency list size is: 2168 bits The adjacency array size is: 632 bits
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
10
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
11
6 3 4 5 2 1
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
12
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
13
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
14
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
15
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
16
Byte representation of the Quadtree: The adjacency matrix: size 64bits Quadtree representation: 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 Graph G = (V,E) Q = {3, 0, 1, 1, 0}
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
17
The adjacency matrix: Quadtree: 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0
Size: 21 elements: 42 bits
Graph G = (V,E)
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
18
The adjacency matrix: Quadtree: 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 Size: 5 elements: 10 bits Graph G = (V,E)
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
19
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
20
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
21
6 4 5 1 3 2
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
22
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
23
1 2 3 4 5 6 7 8
0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 The adjacency matrix: Quadtree: Graph G = (V,E)
Size: Adjacency matrix: 64 bits Quadtree: 82 bits
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
24
3 1 2 5 4 8 6 7
0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 The adjacency matrix: Quadtree: Graph G = (V,E)
Size: Adjacency matrix: 64 bits Quadtree: 106 bits
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
25
1 2 3 4 5 6 7 8
0 1 1 1 0 0 0 0 1 0 1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 1 1 0 1 1 1 1 0 0 0 1 0 1 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 1 0 1 0 0 0 1 1 1 1 0 The adjacency matrix: Quadtree: Graph G = (V,E)
Size: Adjacency matrix: 64 bits Quadtree: 58 bits
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
26
3 1 2 5 4 8 6 7
Given graph G Quadtree representation Size: Adjacency matrix: 64 bits Quadtree: 61 elements; 122 bits 0 1 1 0 0 0 0 0 1 0 1 1 1 0 0 1 1 1 0 1 0 0 0 0 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 The adjacency matrix:
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
27
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
28
3 1 2 5 4 8 6 7
Given graph G PEO: 1 ,3 , 8 , 7 , 6 , 2 , 4 , 5
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
29
Given graph G
0 1 0 0 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 1 0 0 1 1 1 1 1 0
The adjacency matrix:
Quadtree representation
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
30
6 5 1 2 4 3
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
31
0 1 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0
The adjacency matrix: Quadtree representation
Size: 37 elements: 74 bits
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
32
0 1 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0
The adjacency matrix: Quadtree representation
Size: 37 elements: 74 bits This edge has been added to the PEO numbered chordal graph Additional edge info: 6 bits Total space required to store the PEO numbered chordal graph: 80 bits Space reduced by: 10 bits
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
33
0 1 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 1 1 1 1 0 0 0 1 1 0 1 0 1 1 1 0 1 1 0 1 0 1 1 1 0
The adjacency matrix: Quadtree representation
Size: 29 elements: 58 bits
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
34
0 1 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 1 1 1 1 0 0 0 1 1 0 1 0 1 1 1 0 1 1 0 1 0 1 1 1 0
The adjacency matrix: Quadtree representation
Size: 29 elements: 58 bits These edges have been added to the PEO numbered chordal graph Edge (4,8) has been removed Edge information for 3 edges need to be stored (2 removed, 1 added) Extra space required: 18 bits (6 bits per edge) Total space: 76 bits Space Reduced by : 14 bits
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
35
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
36
6 1 2 3 5 4
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
37
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
38
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
39
1 2 3 4 6 5
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
40
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
41
Technique Size (bits) % Compared to Adjacency matrix Adjacency Matrix 1048576 100 2-bit 261370 24.93 1-bit 130873 12.48
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
42
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
43
Technique Size (bits) % Compared to Adjacency matrix Adjacency Matrix 1048576 100 2-bit 261370 24.93 1-bit 130873 12.48 3-bit 300227 28.63 3-bit hybrid 125538 11.97 3-bit hybrid + folding 62889 6
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
44
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
45
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
46
Graph Compression Using Quadtrees 4/27/2016 Amlan Chatterjee
47 [1] L.S. Chandran, L. Ibarra, F. Ruskey, J. Sawada, Generating and characterizing the perfect elimination orderings of a chordal graph, Theoretical Computer Science, 307 (2003), pp. 303–317 [2] H. Samet, Using quadtree to represent spatial data, NATO ASI Series, Vol. F18, pp.229 – 247, 1985
[3] M. Nelson, S. Radhakrishnan, A. Chatterjee, and C. N. Sekharan. On compressing massive streaming graphs with Quadtrees, 2015 IEEE International Conference on Big Data, pages 2409–2417, Oct 2015.