Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPT-S 580-06 Advanced Databases 11 Yinghui Wu EME 49.

Similar presentations


Presentation on theme: "CPT-S 580-06 Advanced Databases 11 Yinghui Wu EME 49."— Presentation transcript:

1 CPT-S 580-06 Advanced Databases 11 Yinghui Wu EME 49

2 Making big data small – compression techniques 22

3 3 The cost of query answering Input: A query Q and a graph G Question: The answer Q(G) to Q in G Reduce the cost of computing Q(G) by making G small! too costly when G is big The cost of computing Q(G): a function f(|G|, Q|) Find a lower function for f? Develop faster algorithm Reduce the size of |Q|? Q( ) G G GQGQ GQGQ Reduce the size of G 3

4 4 Making big graphs small Input: A class Q of queries Question: Can we effectively find, given queries Q  Q and any (possibly big) graph G, a small G Q such that Q(G) = Q(G Q )? How to make G small? Particularly useful for A single dataset G, e.g., the social graph of Facebook Minimum G Q – the necessary amount of data for answering Q Q( ) G G GQGQ GQGQ 4 Much smaller than G

5 5 How to make big graphs small Input: A class Q of queries Question: Can we effectively find, given queries Q  Q and any (possibly big) graph G, a small G Q such that Q(G) = Q(G Q )? Effective methods for making big graphs small A number of methods Q( ) G G GQGQ GQGQ Much smaller than G Error-bounded Graph Compression Query preserving graph compression Boundedly evaluable graph queries Query answering using views Bounded incremental evaluation … 5

6 6 What do we need Input: A class Q of queries Question: Can we effectively find, given queries Q  Q and any (possibly big) graph G, a small G Q such that Q(G) = Q(G Q )? How to characterize this? How to find G Q ? The time taken to find G Q should be independent of |G| Not very likely in the absence of auxiliary information Q( ) G G GQGQ GQGQ Much smaller than G Why? 6

7 Graph compression The cost of query processing: f(|G|, |Q|) Compression For a graph G, G C = R(G) For any Q, Q( G ) = P(Q(G C )) Q( G ) R G GcGc Q P Q Q( Gc ) Compress big G into a smaller G C It is unlikely that we can lower its complexity, but can we reduce the size of its parameter |G|? Compressing Post-processing Q( ) GCGC GCGC G G 7 Lossless: restore G from G C. G C is not much smaller than G Query friendly compression: decompression of G C back to G

8 Query preserving graph compression 8 Query preserving compression for a class Q of queries For any graph G, G C = R(G) For any Q in Q, Q( G ) = P(Q(Gc)) Q( G ) R G GcGc Q P Q Q( Gc ) Compress G w.r.t. to a particular query class Q Compressing Post-processing Q( ) GCGC GCGC G G

9 Query-preserving graph compression 9

10 What is new about query preserving compression? 10 In contrast to lossless compression, no need to restore the original graph G Relative to a class L of queries of users’ choice Better compression ratio: only information about L queries Query preserving compression for a class L of queries For any graph G, Gc = R(G) For any Q in L, Q( G ) = P(Q(Gc)) For any Q in L, Q(Gc) can be directly computed Any algorithms and indexing structures for G can be used for Gc no need to decompress Gc Gc is computed once for all queries Q in L Incrementally maintained Compress G relative to your queries

11 Query-preserving compression 6 Query Preserving Graph Compression, a triple where –R: a compression function, –F: L q ->L q is a query rewriting function, where L q denotes a class of graph queries (in the same class) –P: a post-processing function For any graph G, Gr = R(G) s.t. for all Q ∈ L q, –Q(G) = P(Q’(Gr)), and –Any query evaluation algorithm for Q can be directly used to compute Q’(Gr), without decompressing Gr. Indexing and optimization techniques can be directly applied to Gr Lossy compression; Gr is not necessarily a subgraph of G; Gr can be directly queried without decompression rather than to restore the original graph

12 Query-preserving compression 7 generic, once for all compression Q Q(G) Q’ Q’(Gr) (compression) (post-processing) query rewriting

13 Compress G by leveraging the equivalence relation Equivalence relation: reachability relation R e : a node pair (u,v) ∈ R e iff they have the same set of ancestors and descendants in G. for any graph G, there is a unique maximum R e, i.e., the reachability equivalence relation of G Reachability queries Reachability Input: A directed graph G, and a pair of nodes s and t in G Question: Does there exist a path from s to t in G? O(|V| + |E|) time 13

14 Reachability preserving compression A reachability preserving compression R for G –R maps each node in G to its reachability equivalence class in G C, and each edge to an edge between two equivalence classes 10 Reduction: 95% in average for reachability queries Correctness: –For any query Q R (v,w) over G, v can reach w iff R(v) can reach R(w) in G C –Compression R is in quadratic time –no post-processing function P is required. Nodes in G C : equivalence classes

15 C1 QRQR MSA 1 BSA 1 MSA 2 BSA 2 … FA 1 C1C1 C3C3 FA 2 C2C2 CkCk FA 3 FA 4 FA 1 FA 3 FA 4 MSA 1 BSA 1 MSA 2 BSA 2 C1C1 FA 2 C2C2 C3C3 … C4C4 CkCk 1. Compute Re and its equivalence classes 2. Construct a node for each node set in the equivalence class 3. Construct G C Algorithm and example O(|V||E|)

16 How does it look like in real life? 18 times faster on average for reachability queries 16

17 Graph pattern matching by graph simulation Input: A directed graph G, and a graph pattern Q Output: the maximum simulation relation R 17 Bisimulation: a binary relation B over V of G, such that for each node pair (u,v) ∈ B, L(u) = L(v) for each edge (u,u’) ∈ E, there exists (v,v’) ∈ E, s.t. (u’,v’) ∈ B, for each edge (v,v’) ∈ E, there exists (u,u’) ∈ E, s.t. (u’,v’) ∈ B Equivalence relation Rb: the unique maximum bisimulation relation Compress G by leveraging the equivalence relation A3A3 B4B4 A4A4 A5A5 B5B5 C3C3 C4C4 A1A1 B1B1 D1D1 C1C1 A2A2 B2B2 D2D2 C2C2 B3B3 G1G1 G2G2

18 Compression for simulation 18 Reduction: 57% in average for graph pattern matching nodes in Gc denote equivalence classes compression function R( ): maximum bisimulation relation on the nodes of G equivalence relation Query preserving compression for graph pattern matching R(G) in O(|E| log (|V|)) time P(Q, Gc): linear time in the size of Q( G ) post-processing function P( ): making use of the inverse of R( ) nodes in Q(Gc ) are expanded to nodes in their equivalence classes, in the size of output Subgraph isomorphism?

19 Compression for simulation 19 msa 1 bsa 1 fa 1 c1c1 msa 2 bsa 2 fa 2 c2c2 fa 3 c3c3 ckck G R(G): computes equivalence classes MSAr BSAr FAr FAr’ CrCr’ msa 1 msa 2 bsa 1 bsa 2 fa 1 fa 2 fa 3 … c1c1 c2c2 c3c3 ckck Gc R(G): constructs Gc with equivalence classes P(Q,Gc): expanded to the nodes in their equivalence classes 19 A1A1 B1B1 A 2 … B2B2 B3B3 AkAk …B k A k+1

20 Experimental Results I: compression ratio Reachability preserving compression Graph Patten preserving compression 19 in average 5% reduce SCC graphs by 81% in average Perform best on social networks due to high connectivity in average 43% Perform best on Internet

21 Experimental Results I: compression ratio 20 Reachability preserving compression ratio w.r.t edge increment Pattern preserving compression ratio w.r.t edge increment

22 Experimental Results I: compression ratio 21 2-hop as index Reduction: 92% of the memory of G in average

23 Experimental Results II: query evaluation 22 Reachability preserving compressionPattern preserving compression Reduction: 70% of the querying time over G in average

24 Experimental Results III: Incremental compression 23 Incremental reachability preserving compression w.r.t edge insertions Incremental graph pattern preserving compression w.r.t batch updates The compressed graphs can be efficiently maintained Changes up to 22%

25 Bounded Access Query Plan 25

26 Boundedly evaluable queries Input: A class Q of queries, an access schema A Question: Can we find by using A, for any query Q  Q and any (possibly big) graph G, a fraction G Q of G such that |G Q | is independent of |G|, Q(G) = Q(G Q ), and moreover, G Q can be identified in time determined by Q and A ? A closer look G Q does not get bigger when G grows -- Q(G Q ) can be efficiently computed The time taken on finding G Q does not increase when G grows effectively find Is this possible in practice? 26

27 Example: subgraph isomorphism Find pairs of leading actors and actresses from the same country and stared in an award-winning movie released in 2011-2014 Find all matches of the pattern in the graph A movie database represented as a graph, for movies from 1880 -- 2014 – Nodes: movies, casts (actors, actresses), awards, etc – Edges: relationships between the nodes 5.1 million nodes and 19.5 million edges awardyear 2011-2014 movie actor actress country 27

28 28 Example: access constraints Hold on the entire graph, regardless of queries posed on it C1: an award is presented to no more than 4 movies each year C2: each movie has at most 30 leading actors and actresses C3: each person has only one country of origin C4-6: there are no more than 134 years (2014  1880), 24 major awards, and 196 countries in the graph awardyear 2011-2014 movie actor actress country real-life limits 28 Build indices accordingly

29 29 Example: a query plan Visit at most 17922 nodes and 35136 edges, using indices 1. Fetch a set V1 of 134 year nodes, 24 awards and 195 countries 2. Fetch a set V2 of at most 24 * 3 * 4 = 288 award-winning movies released in 2011-2014, with at most 288 * 2 associated edges, by using award and year nodes in V1 3. Fetch a set V3 of at most (30 + 30) * 288 = 17280 actors and actresses with 17280 edges, using nodes in V2 4. Connect the actors and actresses in V3 to country nodes in V1, with at most 17280 edges -- G Q awardyear 2011-2014 movie actor actress country 29 As opposed to 5.1 million nodes and 19.5 million edges By using the indices

30 30 Access constraints: Example S  (l, N) S: a set of node labels, and l is another label N: a natural number -- cardinality Access schema: A set of access constraints Combining cardinality constraints and index For any set Vs of nodes in G with label S, there exist at most N common neighbours of Vs with label l There is an index on S for l Semantics: G satisfies S  (l, N) 30 With distinct labels, in S Connected by an edge to each node in Vs For each set Vs of nodes with label S, find all common neighbours labelled l in O(N) time

31 Example: access constraints Useful special cases:   (l, N), l  (l’, N), C1: an award is presented to no more than 4 movies each year C2: each movie has at most 30 leading actors and actresses C3: each person has only one country of origin C4-6: there are no more than 134 years (2014  1880), 24 major awards, and 196 countries in the graph Access constraints 31 Build indices accordingly (year, award)  (movie, 4) movie  (actor/actress, 30) actor/actress  (country, 1)   (year, 134),   (award, 24),   (country, 196)

32 32 discovering access schema S  (l, N) How to maintain constraints in response to changes to graphs? Functional dependencies X  Y, e.g., movie  (year, 1) Degree bound: l  (l’, N) if a node with label l has a degree N, for any label l’   (l, N), very common, e.g.,   (country, 196) Aggregate queries: group by (year, award), we find (year, award)  (movie, 4) Real-life bounds: 5000 friends per person (Facebook) … Shredding graphs to relations, using, e.g., TANE 32 Local changes: only to common neighbours

33 33 Generating query plans Fetch operations: construct G Q ; then we compute Q(G Q ) A query plan P for a query Q is a sequence of fetching operations fetch(u, Vs, C, q(u)) given a set Vs of nodes fetched earlier, fetch all common neighbours of Vs labelled l, by using access constraint C, the nodes satisfy the condition of u, e.g., year in [2011, 2014] awardyear 2011-2014 movie actor actress country Efficient by using the indices

34 Generating query plans Independent of |G| no matter how big G grows! 1. Fetch a set V1 of 134 year nodes, 24 awards and 195 countries 2. Fetch a set V2 of at most 24 * 3 * 4 = 288 award-winning movies released in 2011-2014, with at most 288 * 2 associated edges, by using award and year nodes in V1 3. Fetch a set V3 of at most (30 + 30) * 288 = 17280 actors and actresses with 17280 edges, using nodes in V2 4. Connect the actors and actresses in V3 to country nodes in V1, with at most 17280 edges -- G Q 34 Boundedly evaluable Boundedly evaluable: if there exists a query plan under an access schema A such that for all graphs G that satisfies A, Its fetch operations finds G Q, and Q(G Q ) = Q(G) The time for all fetch operations is determined by Q and A only, independent of |G|

35 An approach to querying big graphs 35 Given a query Q, and an access schema A 1.Decide whether Q is boundedly evaluable under A 2.If so, generate a bounded query plan P for Q Independent of the size of |G|? 3. Given any graph G, use the query plan P a)Fetch G Q b)Compute Q(G Q ) Questions: the complexity of – deciding bounded evaluability? – generating a boundedly evaluable query plan? Are we done yet?

36 36 Positive: in O(|A| |V Q | |E Q |) time Input: A boundedly evaluable query Q, and an access schema A Output: A boundedly evaluable query plan P for Q under A Graph pattern matching via subgraph isomorphism Independent of any graph G Characterization: Q is boundedly evaluable under A iff VCov(Q, A) = VQ ECov(Q, A) = EQ Q = (V Q, E Q ), small in real life Nodes covered by A, computed by   (l, N) first and inductively by other constraints in A Edges (u1, u2) covered by A: one of them is in VCov and the other has a bounded number of candidates by A Deciding bounded evaluability: independent of |G| Deciding bounded evaluability

37 37 Positive: in O(|A| |E Q | + |A| |V Q | 2 ) time Input: A graph pattern query Q, and an access schema A Questions: Is Q boundedly evaluable under A? Graph pattern matching via subgraph isomorphism Independent of any graph G Q = (V Q, E Q ) Inductively identify covered nodes and edges, and in each step, generate a corresponding fetch operation Yes, since Q is decided boundedly evaluable under A Always possible? Query plan generation: independent of |G| Generating boundedly evaluable query plan

38 Instance-bounded in a graph G 38 1.Decide whether Q is effectively bounded under A 2.If so, generate a bounded query plan P for Q For any finite set Q of pattern queries, access schema A and a graph G satisfying A, there exists M such that all queries in Q are M-bounded in G under A 38 Can we do anything if Q is not boundedly evaluable under A? Extending A by to A M adding constraints of the form   (l, M), l  (l’, M) such that G satisfies A M Query Q is M-bounded in G if there is G Q of G such that Q(G) = Q(G Q ), and G Q can be found in time determined by Q and A M M: may depend on |G| M  L Q (L Q + 1)/2, L Q : the number of labels in G Instance-bounded: on an individual graph, e.g., Facebook

39 Effectiveness of bounded evaluability Bounded evaluability: effective for graph pattern queries 39 How effective is this approach? 60% of subgraph queries and 33% of simulation queries are boundedly evaluable under small access schema Improvement: 4 orders of magnitudes for subgraph queries, and 3 orders of magnitudes for simulation queries A small M of 0.016% of |G| makes all queries M-bounded Graph pattern matching via subgraph isomorphism: data locality Does the same approach work on graph simulation, without data locality? All the results remain intact on graph pattern matching via simulation Revised node and edge covers 28587 times faster

40 Reading 40 1. M. Arenas, L. E. Bertossi, J. Chomicki: Consistent Query Answers in Inconsistent Databases, PODS 1999. http://web.ing.puc.cl/~marenas/publications/pods99.pdf 2. Indrajit Bhattacharya and Lise Getoor. Collective Entity Resolution in Relational Data. TKDD, 2007. http://linqs.cs.umd.edu/basilic/web/Publications/2007/bhattacharya:tkdd07/bhattac harya-tkdd.pdf 3. P. Li, X. Dong, A. Maurino, and D. Srivastava. Linking Temporal Records. VLDB 2011. http://www.vldb.org/pvldb/vol4/p956-li.pdf 4. W. Fan and F. Geerts , Relative information completeness, PODS, 2009. 5. Y. Cao. W. Fan, and W. Yu. Determining relative accuracy of attributes. SIGMOD 2013. 6. P. Buneman, S. Davidson, W. Fan, C. Hara and W. Tan. Keys for XML. WWW 2001.

41 41 G. Gou and R. Chirkova. Efficient algorithms for exact ranked twig- pattern matching over graphs. In SIGMOD, 2008. http://dl.acm.org/citation.cfm?id=1376676 H. Shang, Y. Zhang, X. Lin, and J. X. Yu. Taming verification hardness: an efficient algorithm for testing subgraph isomorphism. PVLDB,2008. http://www.vldb.org/pvldb/1/1453899.pdf R. T. Stern, R. Puzis, and A. Felner. Potential search: A bounded-cost search algorithm. In ICAPS, 2011. (search Google Scholar) S. Zilberstein, F. Charpillet, P. Chassaing, et al. Real-time problem solving with contract algorithms. In IJCAI, 1999. (search Google Scholar) W. Fan, X. Wang, and Y. Wu. Diversified Top-k Graph Pattern Matching, VLDB 2014. (query-driven approximation) W. Fan, X. Wang, and Y. Wu. Querying big graphs with bounded resources, SIGMOD 2014. (data-driven approximation) Readings

42 42 Comments of your reviews Issues: – Empty words/sentences that tell nothing. “the paper talks about new methods X, Y, Z.” “the approach can be applied to other query classes.” “the index method can be improved/optimized.” “can be applied to other graph algorithms.” “It scales well.” – No Technique Description. – Hand-weaving. “it makes me thinking…” “there is a long list of..” “one thing I can think of is…” – Extension. “what they want to do is…” – Terms/Notations/Symbols left unexplained.

43 43 Suggestion Issues: – For each claim, give brief technique summaries/evidence/statistics “can be applied to other graph algorithms. For example, … [and how]?” “It scales well. For example, the efficiency improves by x% when number of machines varies from x to y” – Give brief summaries using your own words for the most important technique idea. – Scientific writing. http://www.cs.joensuu.fi/pages/whamalai/sciwri/sciwri.pdf http://www.cs.joensuu.fi/pages/whamalai/sciwri/sciwri.pdf No handweaving; no grandmothering; no empty words and vague statement. – Extension. Be creative. If you give extensions, give some idea on how it could be possibly done, or at least be verified.


Download ppt "CPT-S 580-06 Advanced Databases 11 Yinghui Wu EME 49."

Similar presentations


Ads by Google