van emde boas trees l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Van Emde Boas Trees PowerPoint Presentation
Download Presentation
Van Emde Boas Trees

Loading in 2 Seconds...

play fullscreen
1 / 39

Van Emde Boas Trees - PowerPoint PPT Presentation


  • 173 Views
  • Uploaded on

Van Emde Boas Trees. Elif Tosun (252a-aa) CSC 252 – Final Project. Outline . Introduction “Silly” Priority Queue Stratified Tree Structure Operations on the Stratified Tree Structure Conclusions My Contribution References. Introduction. Main problem in operations for Set Manipulation

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Van Emde Boas Trees' - glenna


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
van emde boas trees

Van Emde Boas Trees

Elif Tosun (252a-aa)

CSC 252 – Final Project

outline
Outline
  • Introduction
  • “Silly” Priority Queue
  • Stratified Tree Structure
  • Operations on the Stratified Tree Structure
  • Conclusions
  • My Contribution
  • References
introduction
Introduction
  • Main problem in operations for Set Manipulation
    • Random Access (insert/delete/membership)
    • Ordered Representation (predecessor/successor)
  • Some data structures: binary heap, AVL trees,

2-3 trees, etc.

  • Lower Bounds for a Restricted Universe
  • Motivation: Enumeration Algorithms
silly priority queue
“Silly” Priority Queue
  • Structure
    • n = 2k leaves, height = k
    • Leaves with priorities from {1, 2,…, n}
    • k-bit representation (root to leaf)
      • 0, for left
      • 1, for right
silly pq structure cont d
“Silly” PQ – Structure (Cont’d)
  • Subset S  {1,..,n} Representation
    • Mark leaves in S and all nodes on the paths from root to the marked leaves.
silly pq cont d sketches of algorithms
“Silly” PQ – (Cont’d)Sketches of Algorithms
  • Insert(i)
  • Delete(i)
  • Member(i)
  • Min
  • Predecessor
silly pq cont d sketches of algorithms7
“Silly” PQ – (Cont’d)Sketches of Algorithms
  • Insert(i)
  • Delete(i)
  • Member(i)
  • Min
  • Predecessor
silly pq cont d sketches of algorithms8
“Silly” PQ – (Cont’d)Sketches of Algorithms
  • Insert(i)
  • Delete(i)
  • Member(i)
  • Min
  • Predecessor
silly pq cont d sketches of algorithms9
“Silly” PQ – (Cont’d)Sketches of Algorithms
  • Insert(i)
  • Delete(i)
  • Member(i)
  • Min
  • Predecessor
silly pq cont d sketches of algorithms10
“Silly” PQ – (Cont’d)Sketches of Algorithms
  • Insert(i)
  • Delete(i)
  • Member(i)
  • Min
  • Predecessor
silly pq cont d sketches of algorithms11
“Silly” PQ – (Cont’d)Sketches of Algorithms
  • Insert(i)
  • Delete(i)
  • Member(i)
  • Min
  • Predecessor
improvements
Improvements?
  • Divide and Conquer Strategy.
  • Start with a tree of height 2k, n = 2^(2k)
  • Divide the universe {1, …, n} into n^(1/2) blocks of size n^(1/2). Insert/Delete locally
  • Run time recurrence:

T(n) = T(n^(1/2)) + 1

  • Result : T(n) = O(loglogn)
stratified tree structure
Stratified Tree Structure
  • Based on Divide and Conquer Approach

mentioned before.

  • Two types of information available for each node:
    • Static Information
    • Dynamic Information
static information
Static Information
  • Level: Length of path from a node to its leaves
  • Rank: x, for greatest divisor 2^x of the level of a node. For leaves, rank = k+1 where height= 2^k
  • Position:
    • Leaves: number in {1, …, n} representing the leaf
    • Internal nodes:position of rightmost leaf of its lefthand son.
  • Canonical Subtree of rank d (CS): Binary subtree having as a root node of rank >= d, as leaves descendants at the nearest level of rank >=d.
static information cont d
Static Information(Cont’d)
  • Left Canonical Subtree(LCS): Includes all left hand side descendants
  • Upper Canonical Subtree(UC): Subtree of rank d, having the node as a leaf.
  • Lower Canonical Subtree(LC): Subtree of rank d, having the node as a root.
  • Reach: LC+UC
dynamic information
Dynamic Information
  • Internal Nodes:
    • lmin: leftmost present leaf in LLC(v)
    • lmax: rightmost present leaf in LLC(v)
    • rmin: leftmost present leaf in RLC(v)
    • rmax: rightmost present leaf in RLC(v)
    • ub: +, if there exists a branchpoint on the path between the top of LC and v.

-, otherwise

some definitions
Some definitions…
  • Branch Point: An internal node with 2 present sons
  • Active Node: A present node that has at least one dynamic field that doesn’t equal null.

Note: For some operations to be done in O(1) nodes are prevented from being active unless needed.

properness condition
Properness Condition

Let v be a present internal node.

V is active there exists a branchpoint in the interior of the reach of v.

Note: a leaf is active it’s present

root is active set  null

representation of s
Representation of S
  • Leaves corresponding to elements of S and their ancestors are marked to be present.
  • Information on which present nodes are active is computed. – using Properness Condition
  • Dynamic fields of all active and non-active nodes are given their proper values.
operations on the stratified tree
Operations on the Stratified Tree
  • Insert:Let l to be the leaf to be inserted.

If (no present leaves exists on l’s side of the tree)

insert as before

Else

compute the fathers of l(=hl) and

the present leaf p (=hp).

if no branchpoint exists on l’s side of CS

hp is present without being active.

hl is present iff hp = hl

operations insert cont d
Operations- Insert (Cont’d)

if hl is present

insert l under hp = hl

if hl is not present

insert l as a leaf to a node

above hp.

operations insert cont d32
Operations – Insert (Cont’d)

If a branch point does exist on l’s side of CS

hl is present iff it’s active

if hl is active

insert leaf as a child to hl

if hl is not active

insert leaf as a child to a node

above hp

operations on the stratified tree33
Operations on the Stratified Tree
  • Delete:

Makes a leaf non-present as well as its ancestors up to the lowest branch point.

    • Compute hl
    • Proceed to the upper branch point of hl
    • Consider the other son of the branchpoint
    • Change path from that son to the root of tree so that hl is not included
    • Mark as non-present the leaf and the path above until the “former” upper brachpoint of hl
summary
Summary
  • What is important in these operations is that when inserting or deleting you only deal with the canonical subtree of the father of a leaf.
  • Basically the operations are done on the subtree of height k, which affects the whole tree of height 2^k, without touching the rest of the tree. And that’s why the time complexity of operations is O(loglogn) instead of O(logn).
conclusions
Conclusions
  • Comparisons
conclusions cont d
Conclusions(Cont’d)
  • Advantages
    • Efficient PQ to work with VERY large amounts of data
  • Disadvantages
    • VERY difficult to implement
    • Can’t be used for Real-Valued Priority Queues.
    • Space – uses a full tree just for leaves
my contributions
My Contributions
  • Research on Subject
    • Web
    • Periodicals
    • Books
    • LEDA
  • Reading Papers
  • UNDERSTANDING the Data Structure
references
References
  • P.van Emde Boas, R.Kaas, E.Zulstra. Design and Implementation of an Efficient Priority Queue. Mathematical Systems Theory. 1977:vol10, pgs 99-127
  • P.van Emde Boas. An O(nloglogn) Online Algorithm for the Insert/Extract Min Problem. 1974
  • http://www.cs.mcgill.ca/~mwozni/cs251/welcome.html
  • LEDA
      • eb_tree.h
      • _eb_tree.c