Download presentation
Presentation is loading. Please wait.
Published byDonna Holt Modified over 9 years ago
1
Succinct Ordinal Trees Based on Tree Covering Meng He, J. Ian Munro, University of Waterloo S. Srinivasa Rao, IT University of Copenhagen
2
Background: Succinct Data Structures The problem Modern applications often process huge amounts of data Examples Web search engines: Google, Altavista, etc. Bioinformatics application XML databases Spatial databases …
3
The Solution: Succinct Data Structures What are succinct data structures Representing data structures using preferably information-theoretic minimum space Supporting efficient navigational operations History of Succinct Data Structures Jacobson 1989
4
The number of different ordinal trees of n nodes: ( )/(n+1) ≈ 4 n /( π n) 3/2 Information-theoretic minimum: 2n- O(lg n) bits Explicit, pointer-based representation: Θ(n lg n) bits Trees 2n n
5
Succinct Ordinal Trees Level order unary degree sequence (LOUDS): Jacobson 1989 Balanced parentheses (BP): Munro & Raman 1997 Depth first unary degree sequence (DFUDS): Benoit et al. 1999 Tree covering (TC): Geary et al. 2004
6
3 Preorder and DFUDS order 1 2 7 56 4 8 91011 3 456 78
7
Navigational Operations Considered Parent Child Level_ancestor Depth Subtree_size LCA …all in O(1) time with 2n+o(n) bits on the word RAM
8
Motivations and Objectives Three main representations: BP, DFUDS, TC The fact: different representation supports different operations on trees Example: height, node_rank DFUDS, node_rank post New problem: a representation supporting all the navigational operations
9
Motivations and Objectives (Continued) The assumption: there may be new operations supported by one of these representations New problem: one representation that can compute an arbitrary word of all the other representations
10
The Tree Covering Algorithm by Geary et al. The idea Cover the tree with a set of mini-trees Cover each mini-tree with a set of micro-trees Compute the set of mini-trees (micro-trees) in a bottom-up, greedy fashion Properties Any two mini-trees (micro-trees) can only share their root Size of a mini-tree (micro-tree): M~3M-4 (M’ ~3M’-4) Parameters: M = lg 4 n, M’ = lg n / 24
11
The Tree Covering Algorithm: An Example M = 8, M’ = 3
12
Operations supported on TC by Geary et al. The old TC (Geary et al. 2004) child child_rank depth level_anc nbdesc degree node_rank PRE, node_select PRE node_rank POST, node_select POST
13
New Definitions and Properties: Preorder Changers Tier-1 preorder changers: Number of Tier-1 preorder changers: at most twice the number of mini-trees Tier-2 preorder changers are similar
14
DFUDS Order Changers Tier-1 DFUDS order changers: Number of Tier-1 DFUDS order changers: at most four times the number of mini-trees Tier-2 DFUDS order changers are similar
15
τ * -name of a Node Preorder numbers: node x τ -names: τ (x)= τ * -names: τ * (x)= Node 29 τ (29)=<3, τ * (29)= 1,5>
16
Supporting node_select DFUDS From the DFUDS number to the τ * - name From the τ * -name to the τ -name Table lookup From the τ -name to the preorder number Geary et al. 2004
17
Computing τ 1 (x) 123456789 … 1 Nodes (DFUDS #) τ 1 ’s stored … 212 Example: x=8 th node in DFUDS τ 1 (x)=2 10
18
Computing τ 1 (x) (Continued) Dictionary Universe: n size: O(n / lg 4 n) Space cost: o(n) bits (Raman et al, 2002) τ 1 ’s stored Number of elements stored: O(n / lg 4 n) Each element: O(lg n) bits Space cost: o(n) bits
19
Computing τ 2 (x) and τ 3 * (x) 123456789 … 1 Nodes τ2τ2 … 112 τ 2 (x)=1 10 1312 τ3*τ3* 11212132 … τ 3 * (x)=4
20
Computing τ 2 (x) and τ 3 * (x) (Continued) Dictionary Universe: n size: O(n / lg n) Space cost: o(n) bits (Raman et al, 2002) τ 2 ’s and τ 3 * ’s stored Number of elements stored: O(n / lg n) Each element: O(lglg n) bits Space cost: o(n) bits
21
Other Operations Supported height LCA distance leaf_rank and leaf_select leftmost_leaf and rightmost_leaf leaf_size node_rank DFUDS level_leftmost and level_rightmost level_succ and level_pred
22
Data Abstraction: Computing a subsequence of BP and DFUDS The problem: store the tree using TC, and support the computation of a word of its BP or DFUDS sequence Results: Time: compute a word (Θ(lg n) bits) of the BP or DFUDS sequence in O(f(n)) time Space: n/f(n) additional bits
23
Conclusions A succinct representation of ordinal trees using 2n+o(n) bits that support all the navigational operations Our representation also supports level- order traversal, a useful ordering previously supported only with a very limited set of operations Our encoding schemes supports BP and DFUDS as abstract data types
24
Open Problems Support new operations that are not supported by BP, DFUDS or TC Constant-time computation of a word of BP or DFUDS using o(n) additional bits (or is this possible at all?)
25
Thank you!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.