1 / 9

update

Persistent Data Structures (Version Control ). Partial persistence. Full persistence. Confluently persistence. Purely functional. Ephemeral. version list. version DAG. version tree. v 0. v 0. v 0. v 0. car cdr. update. never modify only create new pairs only DAGs. v 1.

chance
Download Presentation

update

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Persistent Data Structures (Version Control) Partialpersistence Full persistence Confluently persistence Purelyfunctional Ephemeral version list version DAG version tree v0 v0 v0 v0 carcdr update nevermodify onlycreate new pairs onlyDAGs v1 v1 v1 v2 v1 v2 v2 v2 v3 v6 v3 queryonly v3 v3 v4 v5 v5 update/merge/queryall versions updates at leaves any version canbecopiedquery all versions v4 v4 v5 v5 Retroactive v0 v1 v2 v3 v4 v6 v6 update & query all versions updates in the pastpropragate update& query query

  2. Planar Point Location T1 T2 T3 T4 T5 T6 T7 Partialpersistentsearchtrees update O(n∙log n) preprocessing, O(log n) query

  3. Path Copying (trees) root pointer c c a f f d e g

  4. PartialPersistence [0,8[ [8,13[ [13,[ • Version ID = time = 0,1,2,... • Fat node (any data structure) • record all updates in node (version,value) pairs • fieldupdates O(1) • fieldqueries predecessorwrt version id (searchtree/vEB) • Node copying (O(1) degree data structures) • Persistent node = collection of nodes, each valid for an interval of versions, with  extraupdates,  = max indegree • pointers must have subinterval of the node pointing to; otherwisecopy and insert pointers (cacadingcopying)NB: Needs to keeptrack of back-pointers

  5. Full Persistence 1 4 3 2 increasing version 1 4 7 5 3 6 2 preordertraversal Version list (ordermaintenance data structure) 7 5 6 Version tree (numbers = version ids) [5,3[ [4,3[ [4,5[ [0,5[ [5,[ [0,[ split version 5 • Fat node • Updates (1,x) (6,y) (7,z) to a field • Queries = binarysearchamong versions • Update (7,z): Insert 7 as leftmostchild of 4; insert pairs for 7 and 5=succ(7) • Node splitting (≥ 2 ekstra fields)

  6. PersistenceTechniques [N. Sarnak, R.E. Tarjan, Planar point location using persistent search trees, Communications of the ACM, 29(7), 669-679, 1986] Partialpersistence, trees, O(1) access, amortized O(1) update [J.R. Driscoll, N. Sarnak, D.D. Sleator, R.E. Tarjan, Making Data Structures Persistent, Journal of Computer and System Sciences, 38(1), 86-124, 1989] Partial & fullpersistence, O(1) degree data structures, O(1) access, amortized O(1) update [P.F. Dietz, R. Raman, Persistence, Amortization and Randomization. Proceedings 2nd Annual ACM-SIAM Symposium on Discrete Algorithms, 78-88, 1991][G.S. Brodal, Partially Persistent Data Structures of Bounded Degree with Constant Update Time,Nordic Journal of Computing, volume 3(3), pages 238-255, 1996] Partialpersistence, O(1) degree data structures, O(1) access & updatesupdate [P.F. Dietz, Fully Persistent Arrays. Proceedings 1st Workshop on Algorithms and Data Structures, LNCS 382, 67-74, 1989] Fullpersistence, RAM structures, O(loglog n) access, O(loglog n) amortizedexpectedupdates

  7. Comparison of PersistenceTechniques • Copy data structure for each version • noquery overhead, slowupdates & wastes a lot of space • Recordupdates & keepcurrent version • fast updates & queries to current version, spaceefficient, slowqueries in the past • Pathcopying • applies to trees, noquery overhead, space overhead = depth of update • Fat node • partialpersistence: O(1) updates and space optimal, loglog n query overhead • fullpersistence: O(loglog n) expectedamortizedupdates and space optimal, loglog n query overhead • Node copying/splitting • fast updates & queries (amortizedupdates for fullpersistence) • onlyworks for pointer-basedstructureswith O(1) degree

  8. FractionalCascading L1 2 5 8 11 21 25 27 31 33 42 L2 5 8 12 14 17 19 20 35 37 41 cataloggraph O(1) nodes 18 2 5 8 11 14 20 21 25 27 31 33 41 42 bridges 5 8 12 14 17 19 20 27 35 37 41 • Basic Idea : 2 x BinSearch 1 BinSearch + O(1) L1 L2 • Buildbridges (and pointers to nearest original element) • Searchesto next list : Traverse nearest bridge • Construction : Repeatedlycreate bridges until all gaps O(1) • Generalizes to cataloggraphs of degree O(1)

  9. FractionalCascadingTechniques [Bernard Chazelle, Leonidas J. Guibas, Fractional Cascading: I. A Data Structuring Technique, Algorithmica, 1(2): 133-162, 1986.] [Bernard Chazelle, Leonidas J. Guibas: FractionalCascading: II. Applications. Algorithmica 1(2): 163-191 (1986)] Staticfractionalcascading, O(1) worst-case access [Kurt Mehlhorn, Stefan Näher: Dynamic FractionalCascading. Algorithmica 5(2): 215-241 (1990)] Dynamic fractionalcascading, O(loglogN) worst-case access, amortizedinsert and delete Insertion or deletiononly, O(1) per worst-case access, amortizedinsertor delete

More Related