Download presentation
Presentation is loading. Please wait.
1
Querying Disjunctive Databases in Polynomial Time Lars Olson Masters Thesis Brigham Young University Supported by NSF Grant #0083127
2
2 Introduction Disjunctive databases Disjunctive graphs Transitive closure
3
3 Introduction: Disjunctive Databases Some values in the database are uncertain and have the form “ a or b or … ” Genealogy is an example application Queries are CoNP-complete in general
4
4 Introduction: Disjunctive Graphs Disjunctive graphPossible interpretation a b c d e f a b c d e f
5
5 Introduction: Transitive Closure Given a node a, what nodes are always reachable from a in all interpretations of the graph? a b c d e f Transitive closure of a: {a, d, e}
6
6 Path Information Given a node a and a path p, what nodes are always reachable from a through p in all interpretations of the graph? a b c d e f A A B B B Only e is reachable from a through path A.B
7
7 System Overview User provides: Data document (XML) Query Repository Conversion to disjunctive graph Path- connection algorithm Answer to query System provides:
8
8 Repository: Disjunctive XML 1 Jan 1801 2 Jan 1801 Repository Conversion to disjunctive graph Path- connection algorithm Answer to query
9
9 Repository: Disjunctive XML... Repository Conversion to disjunctive graph Path- connection algorithm Answer to query
10
10 Repository: Disjunctive XML... 12 Jan 1801 13 Jan 1801... Repository Conversion to disjunctive graph Path- connection algorithm Answer to query
11
11 Conversion to Disjunctive Graph GEDCOM Id=“1” Type=“birth” Disj Date Day Month Year Day Month Year 12 Jan 1801 13 Jan 1801 EventRec Repository Conversion to disjunctive graph Path- connection algorithm Answer to query
12
12 Conversion to Disjunctive Graph GEDCOM:1 Id=“1” Type=“birth” Disj:1 Day:12 Month:Jan Day:13 12 Jan 1801 13 EventRec:1 Date:1 Date:2 Repository Conversion to disjunctive graph Path- connection algorithm Answer to query Year:1801
13
13 Conversion to Disjunctive Graph EventRec Repository Conversion to disjunctive graph Path- connection algorithm Answer to query GEDCOM:1 1 birth Disj:1 Day:12 Month:Jan Day:13 12 Jan 1801 13 EventRec:1 Date:1 Year:1801 Id Date:2 Type Date Day text Month Year Month Day text
14
14 Conversion to Disjunctive Graph Repository Conversion to disjunctive graph Path- connection algorithm Answer to query EventRec GEDCOM:1 1 birth Day:12 Month:Jan Day:13 12 Jan 1801 13 EventRec:1 Date:1 Year:1801 Id Date:2 Type Date Day text Month Day text Year Month Year
15
15 Path-connections Repository Conversion to disjunctive graph Path- connection algorithm Answer to query EventRec GEDCOM:1 1 birth Day:12 Month:Jan Day:13 12 Jan 1801 13 EventRec:1 Date:1 Year:1801 Id Date:2 Type Date Day text Month Day text Year Month Year Theorem 1: finding path-connections is equivalent to executing a query
16
16 Original Transitive Closure Algorithm Dynamic programming—maintain reachability matrix between all pairs of nodes Update matrix each time an edge ( a, S ) is added (or deleted) The only matrix entries that can change are ( x,y ) for x ∊ XSET, y ∊ YSET Repository Conversion to disjunctive graph Path- connection algorithm Answer to query XSET YSET a S
17
17 Executing Path Queries We could extend the process to add path information, except… –There can be an exponential number of paths between nodes –Adding an edge may participate in multiple paths between a single pair of nodes We must limit the number of paths we store—provided in the user query Repository Conversion to disjunctive graph Path- connection algorithm Answer to query
18
18 Executing Path Queries For a given path, add edges in order they occur in the path –For each edge ( {a}, S ), we can limit YSET to just the nodes in S –In fact, YSET = Ø unless | S |= 1 Limit the nodes in XSET to those with a path-connection relevant to the query Repository Conversion to disjunctive graph Path- connection algorithm Answer to query
19
19 Executing Path Queries EventRec.Date.Year.text Repository Conversion to disjunctive graph Path- connection algorithm Answer to query EventRec GEDCOM:1 1 birth Day:12 Month:Jan Day:13 12 Jan 1801 13 EventRec:1 Date:1 Year:1801 Id Date:2 Type Date Day text Month Day text Year Month Year
20
20 Executing Path Queries A.B.C.D Repository Conversion to disjunctive graph Path- connection algorithm Answer to query a b A c d e f g h B B C C D D
21
21 Results (Hand-Generated Data)
22
22 Results (Actual Genealogy Data)
23
23 Results (Genealogy Data with Added Disjunctions)
24
24 Results (Randomly-Generated Data)
25
25 Conclusions We can represent disjunctive data in XML We can execute some useful queries in polynomial time Tests reflect polynomial-time behavior We need to optimize the algorithm more
26
26 Future Work Improvements on running time, query optimization Characterization of graphs—when is backtracking “good enough”? More flexible query language, more complex queries Much more…
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.