Space-Efficient Static Trees and Graphs Guy Jacobson IEEE Symposium on Foundations of Computer Science, 1989 Speaker: 吳展碩.

Slides:



Advertisements
Similar presentations
The Dictionary ADT: Skip List Implementation
Advertisements

1 Succinct Representation of Labeled Graphs Jérémy Barbay, Luca Castelli Aleardi, Meng He, J. Ian Munro.
Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
I/O and Space-Efficient Path Traversal in Planar Graphs Craig Dillabaugh, Carleton University Meng He, University of Waterloo Anil Maheshwari, Carleton.
February 12, 2007 WALCOM '2007 1/22 DiskTrie: An Efficient Data Structure Using Flash Memory for Mobile Devices N. M. Mosharaf Kabir Chowdhury Md. Mostofa.
Succinct Representations of Dynamic Strings Meng He and J. Ian Munro University of Waterloo.
Succinct Data Structures for Permutations, Functions and Suffix Arrays
An Array-Based Algorithm for Simultaneous Multidimensional Aggregates By Yihong Zhao, Prasad M. Desphande and Jeffrey F. Naughton Presented by Kia Hall.
Introduction to Computer Science 2 Lecture 7: Extended binary trees
5th July 2004CPM A Simple Optimal Representation for Balanced Parentheses Richard Geary, Naila Rahman, Rajeev Raman (University of Leicester, UK)
Succinct Representation of Balanced Parentheses, Static Trees and Planar Graphs J. Ian Munro & Venkatesh Raman.
An Improved Succinct Dynamic k-Ary Tree Representation (work in progress) Diego Arroyuelo Department of Computer Science, Universidad de Chile.
Paolo Ferragina, Università di Pisa Compressed Rank & Select on general strings Paolo Ferragina Dipartimento di Informatica, Università di Pisa.
IP Routing Lookups Scalable High Speed IP Routing Lookups.
Edited by Malak Abdullah Jordan University of Science and Technology Data Structures Using C++ 2E Chapter 12 Graphs.
A New Compressed Suffix Tree Supporting Fast Search and its Construction Algorithm Using Optimal Working Space Dong Kyue Kim 1 andHeejin Park 2 1 School.
An Efficient IP Address Lookup Algorithm Using a Priority Trie Authors: Hyesook Lim and Ju Hyoung Mun Presenter: Yi-Sheng, Lin ( 林意勝 ) Date: Mar. 11, 2008.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
The Euler-tour technique
Compact Representations of Separable Graphs From a paper of the same title submitted to SODA by: Dan Blandford and Guy Blelloch and Ian Kash.
CS 146: Data Structures and Algorithms June 18 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
Mike 66 Sept Succinct Data Structures: Techniques and Lower Bounds Ian Munro University of Waterloo Joint work with/ work of Arash Farzan, Alex Golynski,
Chapter 19: Binary Trees. Objectives In this chapter, you will: – Learn about binary trees – Explore various binary tree traversal algorithms – Organize.
Succinct Representations of Trees
Introduction n – length of text, m – length of search pattern string Generally suffix tree construction takes O(n) time, O(n) space and searching takes.
Summer School '131 Succinct Data Structures Ian Munro.
TECH Computer Science Dynamic Sets and Searching Analysis Technique  Amortized Analysis // average cost of each operation in the worst case Dynamic Sets.
Topic 17 Introduction to Trees
1 Introduction to trees Instructor: Dimitrios Kosmopoulos.
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
Succinct Data Structures Ian Munro University of Waterloo Joint work with David Benoit, Andrej Brodnik, D, Clark, F. Fich, M. He, J. Horton, A. López-Ortiz,
Trees & Forests D. J. Foreman. A Forest A BC R ST DE F.
Constant-Time LCA Retrieval Presentation by Danny Hermelin, String Matching Algorithms Seminar, Haifa University.
A Study of Balanced Search Trees: Brainstorming a New Balanced Search Tree Anthony Kim, 2005 Computer Systems Research.
Data Structures TREES.
Succinct Ordinal Trees Based on Tree Covering Meng He, J. Ian Munro, University of Waterloo S. Srinivasa Rao, IT University of Copenhagen.
1 5. Abstract Data Structures & Algorithms 5.1 Data Structure Fundamentals.
Week 10 - Friday.  What did we talk about last time?  Graph representations  Adjacency matrix  Adjacency lists  Depth first search.
Chapter 10: Trees A tree is a connected simple undirected graph with no simple circuits. Properties: There is a unique simple path between any 2 of its.
Updating Designed for Fast IP Lookup Author : Natasa Maksic, Zoran Chicha and Aleksandra Smiljani´c Conference: IEEE High Performance Switching and Routing.
1Computer Sciences. 2 HEAP SORT TUTORIAL 4 Objective O(n lg n) worst case like merge sort. Sorts in place like insertion sort. A heap can be stored as.
CMSC 202, Version 5/02 1 Trees. CMSC 202, Version 5/02 2 Tree Basics 1.A tree is a set of nodes. 2.A tree may be empty (i.e., contain no nodes). 3.If.
Chapter 7 Trees_ Part2 TREES. Depth and Height 2  Let v be a node of a tree T. The depth of v is the number of ancestors of v, excluding v itself. 
Trees A non-linear implementation for collection classes.
MA/CSSE 473 Day 26 Student questions Boyer-Moore B Trees.
Succinct Data Structures
Succinct Data Structures
Succinct Data Structures
Succinct Data Structures
Multiway Search Trees Data may not fit into main memory
Lecture Trees Chapter 9 of textbook 1. Concepts of trees
Lecture 22 Binary Search Trees Chapter 10 of textbook
Binary Trees "A tree may grow a thousand feet tall, but its leaves will return to its roots." -Chinese Proverb.
Paolo Ferragina Dipartimento di Informatica, Università di Pisa
Hashing Exercises.
Data Structures and Database Applications Binary Trees in C#
TREES General trees Binary trees Binary search trees AVL trees
COSC2100: Data Structures and Algorithms
Discrete Methods in Mathematical Informatics
Trees & Forests D. J. Foreman.
Forests D. J. Foreman.
Trees CMSC 202, Version 5/02.
Trees (Part 1, Theoretical)
CMSC 202 Trees.
Succinct Representation of Labeled Graphs
CS 583 Analysis of Algorithms
Trees.
Succinct Data Structures
Presentation transcript:

Space-Efficient Static Trees and Graphs Guy Jacobson IEEE Symposium on Foundations of Computer Science, 1989 Speaker: 吳展碩

A pointer needs lg n bits to address n different locations. 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 nil A pointer needs lg n bits to address n different locations. Using pointers to represent the linking relation of a graph will therefore occupy (n lg n) bits.

Outline To store a binary tree in asymptotically optimal space Represent a tree in O(n) bits Efficient tree-traversal in space-efficient trees To store planar graphs in asymptotically optimal space

Binary Trees in 2n+1 bits Mark all the nodes of the tree with 1. Add external nodes to the tree, and mark them all with 0. Read off the makes of nodes of the tree in level-order.

Binary Trees in 2n+1 bits Mark all the nodes of the tree with 1. Add external nodes to the tree, and mark them all with 0. Read off the makes of nodes of the tree in level-order.

How to compute the linking relations in a space-efficient tree?

Rank and Select Define two operations rank(m) and select(m) as follows: rank(m): Counts the number of 1s from position 1 up to position m in a binary string select(m): Finds the m-th 1s in a binary string Example: rank(10) = 7 select(7) = 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Algorithm to Compute Linking Relations left-child(m)  2  rank(m) right-child(m)  2  rank(m)  1 parent(m)  select(m2) 1 1 2 3 2 3 4 5 6 7 4 5 6 8 9 10 11 12 13 7 8 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

How to compute rank(m) and select(m) efficiently? (e.g. constant time)

Compute Rank(m) and Select(m) The rank directory: Conceptually break the bit-string into blocks of length lg2n. Keep a table containing the number of 1s up to the last position in each block. This takes n / lg n bits. Break each block into sub-blocks of length ½lg n. Keep a table containing the number of 1s within the block up to the last position in each sub-block. This takes n lglg2n / lg n bits. Keep a pre-computed table giving the number of 1s up to every possible position in every possible distinct sub-block.

n bits 1 2 3 n/lg2n 101100 110011 001... ... ... ..11 000010 101000 lg2n 3 7 ... ... ... ... 55 56 lg n n / lg n bits ½lg n lglg2n 2n lglg2n / lg n bits

2½lg n  ½lg n  lg½lg n bits 1 2 3 n/lg2n 101100 110011 001... ... ... ..11 000010 101000 lg2n 3 7 ... ... ... ... 55 56 lg n n / lg n bits ½lg n Precomputed Table 2½lg n  ½lg n  lg½lg n bits lglg2n 2n lglg2n / lg n bits

Planar Graphs in O(n) Space Represent a special case of planar graphs called one-page graphs in O(n) bits k-page graphs can be represented in O(kn) bits Any planar graph can be embedded in a four-page graph. Yannakakis, M. "Four pages are necessary and sufficient for planar graphs." Proceedings of the 18th ACM Symposium on Theory of Computing, pages 104-108, 1986.

One-page graph One-page Graph: All edges are lying to one side and can not cross.

One-page graph in O(n) Space All edges are lying to one side and can not cross. | ((( | )( | ( | )) | )( | ))

How to compute the linking relations in the parenthesis string?

Finding the close parenthesis which match the open one First, break the string of parentheses into blocks of length lgn.

Definitions Far parenthesis: An open parenthesis p is called a far parenthesis if and only if p's matching parenthesis lies outside its own block. Pioneer: A far parenthesis is a pioneer if and only if its matching parenthesis lies in a different block that of the previous far parenthesis. The number of pioneers is at most 2lgn. Dotted lines denote the matches of far parentheses Red ones denote the matches of pioneers

Use a Directory Structure of Size O(n) bits for Matching Parentheses

Matching Parentheses For a parenthesis p, its matching parenthesis q can be found out as follows: Case1: p and q are in the same block Using precomputed table lgn

Matching Parentheses Case2: p and q are not in the same block Find the pioneer of p and use it to locate the block containing q Compute the position of q via nesting depths

O(n) bits + number of pioneers  lg n bits

Conclusion References A space-efficient data structure achieve almost optimal space while supporting the required operations almost as efficient as using pointers to represent it. References Dinesh P. Mehta and Sartaj Sahni. Handbook of Data Structures and Applications. Chapman & Hall/CRC, 2005.