250 likes | 521 Views
Succinct Dynamic -ary Trees. Joint work with S . Srinivasa Rao In TAMC’11. Pooya Davoodi Aarhus University. Aarhus University, May 18, 2011. Outline. Succinct Data Structures Succinct Trees Dynamic Succinct Trees Dynamic Succinct -ary Trees. Succinct Data Structures.
E N D
Succinct Dynamic -ary Trees Joint work with S. SrinivasaRao In TAMC’11 Pooya Davoodi Aarhus University Aarhus University, May 18, 2011
Outline • Succinct Data Structures • Succinct Trees • Dynamic Succinct Trees • Dynamic Succinct -ary Trees
Succinct Data Structures • Data structures support some operations • Succinct data structures • Efficient operations • Minimum space (information-theoretic) • If you store less, then you cannot solve the problem Data Structure Operations Compress but also preserve accessibility and functionality
Representation of Binary Trees • Support traversal in a binary tree • Left/right child and parent • Pointer-based representation • Θ bits and time • Can we reduce the space?
Information-theoretic lower boundBinary Trees • How many different binary trees? • Catalan Number • Lower bound: bits • Goal: bits bits required
Succinct Binary Trees • Balanced Parentheses • Left/right child • Parent • subtree-size Isomorphism Ordinal tree An application: in text indexing, determining the number of matches without enumerating all of them parentheses: ( ( ( ( ) ) ( ) ) ( (( ) )( )( ) ) ( ) ) DFS (Preorder)
Balanced Parentheses • Support balanced parentheses operations • findclose, findopen, excess, enclose • bits and time ( ( ( ( ) ) ( ) ) ( ( ( ) ) ( ) ( ) ) ( ) )
-ary Cardinal Trees • Each node: at most children • Each edge: a label from • Operations • label-child() • parent 2 3 3 1 2 2
Succinct -ary Trees • Represent without labels • Balanced parentheses • Cannot perform label-child() • Support label-child() • rank() • At each node: a dictionaryof labels • -th child • time? 2 3 ( ( ( ( ) ) ( ) ( ) ) ( ) ) 3 1 2 sorted 2 • rank() • 2nd child
DFS- Unary Degree SequenceDFUDS • Balanced parentheses (DFS) • Instead: • During DFS, at each node • unary degree sequence • -th child • bits and time 2 3 ( ( ( ( ) ) ( ) ( ) ) ( ) ) 3 1 2 2 ( ( ( ) ( ( ( ) ( ) ) ) ) )
Information-theoretic lower bound-ary Trees • DFUDS + Dictionaries • bits • time • Lower bound: bits
Dynamic Succinct Trees • Inserting a node along an edge • Inserting a leaf • Deleting a node with one child • Deleting a leaf “Data optimization is much easier when we can sit back and do it off-line.” Jocobson, 1989
Difficulty of subtree-size • amortized • Subset-rank problem • subtree-size() • rank()= • Insert/delete in insert-leaf/delete-leaf 1 2 3 4 5
Difficulty of -th child • amortized • Reduction from list-representation problem • -th child • Insert/delete in insert-leaf/delete-leaf 1 2
Dynamic Succinct -ary TreesDFUDS + Dictionary • Represent without labels • Dynamic DFUDS • bits and time 2 3 3 1 2 2 1 ( ( ( ) ( ( ( ) ( ) ) ) ) ( ) )
Dynamic Succinct -ary TreesDFUDS + Dictionary • Sequence of labels in DFUDS order • Sequence has labels from {1,2,…,k} • Dynamic dictionary bits and time 2 3 3 1 2 2 1 2 3 1 2 3 2 1 too high
Dynamic Succinct -ary Trees • DFUDS + Dictionary: • time • bits • Decomposition helps? • Each micro tree: • DFUDS + Dictionary • Need restriction subtree-size update
Traversal Model • Operations at a finger (current node) • Applications: Suffix trees, Lempel-Ziv indexes, etc. • Amortize over the movements of the finger
Dynamic Succinct -ary TreesTraversal Model • Decompose into micro trees • Size: • NO global structure • Each micro tree: • DFUDS • Dictionary for sequence of labels • Preorder-number of frontiers • subtree-size of child micro trees • Pointers to neighbors • timebits
Packing, B-Trees, Lookup Tables • Sequences of length • DFUDS, sequence of labels, frontiers, subtree-size bits Packing Sequence
Memory Management • Micro trees: extendible arrays • Add bits • : word size • : number of micro trees Access Grow Shrink ours:
Open Problems • General (traversal model) • query time: • update time: