Implicit Dictionaries with O(1) Modifications per Update and Fast Search
Gianni Franceschini and Ian Munro
Elements kept in 1st n positions of an array Data plus constant number of words Any “structural information” must be encoded
in the ordering of the data Perform insertions, deletions and searches Comparison model … a talk about models
Previous Work: Partial Orders
First approach: Arrange elements according to a fixed partial order (truncated to n positions)
72 63 55 51 22 13
68 62 32 19 9
44 33 22 17
21 18 14 13
13 12 10
11 2
3
Use the standard pairing function
Like a heap … but each element has 2 parents: above and left
Previous Work: Partial Orders
First approach: Arrange elements according to a fixed partial order (truncated to n positions)
72 63 55 51 22 13
68 62 32 19 9
44 21 22 17
33 18 14
13 12 10
11 2
3
Search(x): From bottom left corner move up or right depending on x:A[i]
Search(51)
Previous Work: Partial Orders
First approach: Arrange elements according to a fixed partial order (truncated to n positions)
72 63 55 51 22 13
68 62 32 19 9
4466 2144 22 17
33 1821 1418 6614
13 12 10
11 2
3
Search(x): From bottom left corner move up or right depending on x:A[i]
Insert(x): n++; Put new value in A[n]; move it up or left as needed.
Insert(66)
Previous Work: Partial Orders
First approach: Arrange elements according to a fixed partial order (truncated to n positions)
72 63 55 51 22 13
68 62 32 19 9
44 21 22 17
33 18 14
13 12 10
11 2
3
Method is OPTIMAL if we restrict to partial orders.
Search: must inspect longest antichain
Update: must move longest chain
Search × Update ≥ n
Previous Work: Rotations and Encodings
Sorted/Rotated Lists 2 4 3 7 8 6 13 14 10 11 21 24 26 37 17 O(lg n) search; O(√n) update Defeats partial order lower bound Improve to o(nє) (Frederickson)
Encoding Pointers1 2 9 8 12 23 67 89 91 99 01000011 Leads to O(lg2n) method
Previous Results: More Lower Bounds & Attempts
A natural conjecture … tradeoff based on number of total orders between search time (fast for few orders) and update time (lots of orders means you can move to one ‘easily”). Unlikely …O(lg n) search with √(n!) orders.
Update cost (moves plus exchanges) O(1) search cost Ω(nε) Update cost does not include search (Borodin, Fich, Meyer auf der Heide, Upfal & Wigderson)
This Millenium: Results from Pisa Several papers (key players Franceschini &
Grossi)) O(lg n) time and also cache oblivious
But still leaves open the idea of o(lg n) moves on an update .. and still fast in terms of comparisons. Borodin et al had conjectured “no”.
Specific Issue
Conjecture that any implicit dictionary in which updates used only O(1) moves would become “disorganized” and require Ω(nε) search cost. (i.e. lower bound theorem holds even if we count only count only moves for update) (I agreed! At least in a tradeoff between update moves and search compares.)
The Results Here
Thm: an implicit dictionary using O(lg n) comparisons to search in the worst case and updates in O(1) exchanges and O(lg n) compares in the amortized sense.
Thm: an implicit dictionary using O(lg3n) comparisons to search in the worst case and updates in O(1) exchanges and O(lg3n) compares in the worst case.
The Proofs
Builds heavily on previous implicit encodings and also from “usual model” techniques for maintaining balanced trees with O(1) pointer updates (Levcopoulos & Overmars similar ideas to Dietz & Sleator)
Complex & detailed … see the paper Can bounds be improved to O(lg n) worst
case? … probably