Download presentation
Presentation is loading. Please wait.
Published byNaomi Stevenson Modified over 8 years ago
1
Confluently Persistent Tries Eric Price, MIT joint work with Erik Demaine, MIT Stefan Langerman, Université Libre de Bruxelles
2
Version Control ● Maintain multiple versions of a directory structure – CVS, Subversion, Git, Mercurial,... ● Efficiently branch and merge in changes in a trie – Confluent Persistence
3
Persistence Spectrum ● Partial persistence (version line) – Read old versions ● Full persistence (version tree) – Branch tree ● Confluent persistence (version DAG) – Meld operation between branches ● Functional (no mutation)
4
General Persistence ● Partial & Full persistence – Constant overhead for pointer-machine ● Confluent persistence – Fiat & Kaplan 2003 – space Ω(lg P), P = # paths in version DAG – Possibly exponential number of nodes – Linear bits to represent pointer
5
Problem ● Replace pointers by fingers maintained by DS ● Maintain a trie – Arbitrary degree – Relative labels ● Operations – Insert/delete/modify at a finger – Copy subtree between fingers – Finger movement – Duplicate finger
6
Functional Structure: Path Copying ● Basic Method: Path Copying – O(d lg Δ) per operation, d = depth, Δ = degree – Whenever all pointers point into subtree.
7
Functional Structure: Zipper ● More Advanced: Zipper – Used in Haskell (xmonad) – Finger to an everted element – O(lg Δ) per operation including finger move
8
Our Results ● Fully Persistent Hash Tables: O(lg lg N) – Weight-balanced fully persistent hash tables
9
Globally Balanced Functional Trie ● Link-Cut trees – Store “heavy” paths in weight-balanced BSTs ● Finger movement needs fast predecessor and successor
10
Finger Movement ● Need fast predecessor and successor ● Finger is deque of deques of ancestors in alternating directions – Can find preceding ancestor – Use functional catenable deques with O(1) operation ● Predecessor is preceding ancestor or rightmost descendant of left child – Nodes store deque of left/right spines
11
Functional vs. Confluent Persistent ● Functional structures use BSTs on the children ● Can replace with fully persistent (not confluent) hash tables – Improve O(lg lg UM) arrays in [Dietz 89] for dynamic resizing – Rehash occasionally to keep M small, avoid collisions – Improves O(lg Δ) finger movement to O(lg lg Δ)
12
Weight-Balanced Hash Tables ● Link-cut trees use weight-balanced BSTs – depth v = O(lg(1 / w v )), Σ w v = 1 ● Want structure with O(lg lg 1/w v ) lookups, O(lg 1/w v ) updates – Trick from BST-based working set structure – Triply exponentially sized hash tables (16, 65536, 115792089237316195423570985008687907853269984665640564039457584007913129639936 ) – Weight-balanced BSTs to shift between tables
13
Conclusion
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.