Higher Order Tries Key = Social Security Number.  441-12-1135  9 decimal digits. 10-way trie (order 10 trie). 0123456789 Height <= 10.

Slides:



Advertisements
Similar presentations
Router/Classifier/Firewall Tables Set of rules—(F,A)  F is a filter Source and destination addresses. Port number and protocol. Time of day.  A is an.
Advertisements

Internet Routers
Spring 2006CS 685 Network Algorithmics1 Longest Prefix Matching Trie-based Techniques CS 685 Network Algorithmics Spring 2006.
Network Algorithms, Lecture 4: Longest Matching Prefix Lookups George Varghese.
AVL Trees1 Part-F2 AVL Trees v z. AVL Trees2 AVL Tree Definition (§ 9.2) AVL trees are balanced. An AVL Tree is a binary search tree such that.
Special Purpose Trees: Tries and Height Balanced Trees CS 400/600 – Data Structures.
Binary Tries (continued) split(k). Similar to split algorithm for unbalanced binary search trees. Construct S and B on way down the trie. Follow with a.
IP Routing Lookups Scalable High Speed IP Routing Lookups.
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
TREES Chapter 6. Trees - Introduction  All previous data organizations we've studied are linear—each element can have only one predecessor and successor.
Binary Trees, Binary Search Trees CMPS 2133 Spring 2008.
Quiz3! Midterm! Assignment2! (most) Quiz4! Today’s special: 4 for 1.
Data Compressor---Huffman Encoding and Decoding. Huffman Encoding Compression Typically, in files and messages, Each character requires 1 byte or 8 bits.
AA Trees another alternative to AVL trees. Balanced Binary Search Trees A Binary Search Tree (BST) of N nodes is balanced if height is in O(log N) A balanced.
Suffix Trees Suffix trees Linearized suffix trees Virtual suffix trees Suffix arrays Enhanced suffix arrays Suffix cactus, suffix vectors, …
Tries Standard Tries Compressed Tries Suffix Tries.
Suffix Trees String … any sequence of characters. Substring of string S … string composed of characters i through j, i ate is.
Digital Search Trees & Binary Tries Analog of radix sort to searching. Keys are binary bit strings.  Fixed length – 0110, 0010, 1010,  Variable.
DictionaryADT and Trees. Overview What is the DictionaryADT? What are trees? Implementing DictionaryADT with binary trees Balanced trees DictionaryADT.
Higher Order Tries Key = Social Security Number.   9 decimal digits. 10-way trie (order 10 trie) Height
Power Efficient IP Lookup with Supernode Caching Lu Peng, Wencheng Lu*, and Lide Duan Dept. of Electrical & Computer Engineering Louisiana State University.
Design a Data Structure Suppose you wanted to build a web search engine, a la Alta Vista (so you can search for “banana slugs” or “zyzzyvas”) index say.
Digital Search Trees & Binary Tries Analog of radix sort to searching. Keys are binary bit strings.  Fixed length – 0110, 0010, 1010,  Variable.
1 Binary Search Trees Implementing Balancing Operations –AVL Trees –Red/Black Trees Reading:
Department of Computer Eng. & IT Amirkabir University of Technology (Tehran Polytechnic) Data Structures Lecturer: Abbas Sarraf Search.
Patricia P ractical A lgorithm T o R etrieve I nformation C oded I n A lphanumeric. Compressed binary trie. All nodes are of the same data type (binary.
Study of IP address lookup Schemes
Red Black Trees Colored Nodes Definition Binary search tree.
1 HEXA: Compact Data Structures or Faster Packet Processing Author: Sailesh Kumar, Jonathan Turner, Patrick Crowley, Michael Mitzenmacher. Publisher: ICNP.
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
General Trees and Variants CPSC 335. General Trees and transformation to binary trees B-tree variants: B*, B+, prefix B+ 2-4, Horizontal-vertical, Red-black.
Univ. of TehranAdv. topics in Computer Network1 Advanced topics in Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr.
Introducing Hashing Chapter 21 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
Address Lookup in IP Routers. 2 Routing Table Lookup Routing Decision Forwarding Decision Forwarding Decision Routing Table Routing Table Routing Table.
Binary Trees Chapter 6.
§6 B+ Trees 【 Definition 】 A B+ tree of order M is a tree with the following structural properties: (1) The root is either a leaf or has between 2 and.
Advanced Algorithms Analysis and Design Lecture 8 (Continue Lecture 7…..) Elementry Data Structures By Engr Huma Ayub Vine.
IP Address Lookup Masoud Sabaei Assistant professor
Chapter 6 Binary Trees. 6.1 Trees, Binary Trees, and Binary Search Trees Linked lists usually are more flexible than arrays, but it is difficult to use.
© 2006 Pearson Addison-Wesley. All rights reserved13 B-1 Chapter 13 (continued) Advanced Implementation of Tables.
Balanced Binary Search Tree 황승원 Fall 2010 CSE, POSTECH.
B + -Trees Same structure as B-trees. Dictionary pairs are in leaves only. Leaves form a doubly-linked list. Remaining nodes have following structure:
Chapter 19: Binary Trees Java Programming: Program Design Including Data Structures Program Design Including Data Structures.
Binary Trees Definition A binary tree is: (i) empty, or (ii) a node whose left and right children are binary trees typedef struct Node Node; struct Node.
1 Searching Searching in a sorted linked list takes linear time in the worst and average case. Searching in a sorted array takes logarithmic time in the.
2-3 Trees Extended tree.  Tree in which all empty subtrees are replaced by new nodes that are called external nodes.  Original nodes are called internal.
1 Tries When searching for the name “Smith” in a phone book, we first locate the group of names starting with “S”, then within those we search for “m”,
A Small IP Forwarding Table Using Hashing Yeim-Kuan Chang and Wen-Hsin Cheng Dept. of Computer Science and Information Engineering National Cheng Kung.
Sets of Digital Data CSCI 2720 Fall 2005 Kraemer.
Chapter 7 Trees_Part3 1 SEARCH TREE. Search Trees 2  Two standard search trees:  Binary Search Trees (non-balanced) All items in left sub-tree are less.
Data Structure II. Outline Heap Binary Search Tree Hash Table Binary Indexed Tree Segment Tree.
CS 261 – Recitation 7 Spring 2015 Oregon State University School of Electrical Engineering and Computer Science.
Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:
Week 15 – Wednesday.  What did we talk about last time?  Review up to Exam 1.
1 Lexicographic Search:Tries All of the searching methods we have seen so far compare entire keys during the search Idea: Why not consider a key to be.
Author : Masanori Bando and H. Jonathan Chao Publisher : INFOCOM, 2010 Presenter : Jo-Ning Yu Date : 2011/02/16.
Search Radix search trie (RST) R-way trie (RT) De la Briandias trie (DLB)
Nov 2, 2001CSE 373, Autumn Hash Table example marking deleted items + choice of table size.
Higher Order Tries Key = Social Security Number.
IP Routers – internal view
Binary search tree. Removing a node
Mark Redekopp David Kempe
Digital Search Trees & Binary Tries
Patricia Practical Algorithm To Retrieve Information Coded In Alphanumeric. Compressed binary trie. All nodes are of the same data type (binary tries use.
Binary Tries (continued)
Digital Search Trees & Binary Tries
Binary Search Trees.
Higher Order Tries Key = Social Security Number.
Trees in java.util A set is an object that stores unique elements
Data Structures Using C++ 2E
Presentation transcript:

Higher Order Tries Key = Social Security Number.   9 decimal digits. 10-way trie (order 10 trie) Height <= 10.

Social Security Trie 10-way trie  Height <= 10.  Search => <= 9 branches on digits plus 1 compare. 100-way trie   Height <= 6.  Search => <= 5 branches on digits plus 1 compare.

Social Security AVL & Red-Black Red-black tree  Height <= 2log ~ 60.  Search => <= 60 compares of 9 digit numbers. AVL tree  Height <= 1.44log ~ 40.  Search => <= 40 compares of 9 digit numbers. Best binary tree.  Height = log ~ 30.

Compressed Social Security Trie #ptr char# char# = character/digit used for branching.  Equivalent to bit# field of compressed binary trie. #ptr = # of nonnull pointers in the node.

Insert Insert Insert Null pointer fields not shown

Insert Insert

Insert Insert

Insert Insert

Insert Insert

Insert

Delete Delete

Delete Delete

Delete Delete

Delete

Variable Length Keys Insert Problem arises only when one key is a (proper) prefix of another.

Variable Length Keys Insert Add a special end of key character (#) to each key to eliminate this problem.

Variable Length Keys End of key character (#) not shown. Insert # 5

Tries With Edge Information Add a new field (element) to each branch node. New field points to any one of the element nodes in the subtree. Use this pointer on way down to figure out skipped-over characters.

Example element field shown in blue # 5

Etc. Expected height of an order m trie is ~log m n. Limit height to h (say 6). Level h branch nodes point to buckets that employ some other search structure for all keys in subtrie.

Etc. Switch from trie scheme to simple array when number of pairs in subtrie becomes <= s (say s = 6).  Expected # of branch nodes for an order m trie when n is large and m and s are small is n/(s ln m). Sample digits from right to left (instead of from left to right) or using a pseudorandom number generator so as to reduce trie height.

Multibit Tries Variant of binary trie in which the number of bits (stride) used for branching may vary from node to node. Proposed for Internet router applications.  Variable length prefixes.  Longest prefix match. Limit height by choosing node strides.  Root stride = 32 => height = 1.  Strides of 16, 8, and 8 for levels 1, 2, and 3 => only 3 levels.

Multibit Trie Example 0 1 0null S =1 S =2 S =

Multibit Tries Node whose stride is s uses s bits for branching.  Node has 2 s children and 2 s element/prefix fields.  Prefixes that end at a node are stored in that node.  Short prefixes are expanded to length represented by node.  When root stride is 3, prefixes whose length is < 3 are expanded to length 3.  P = 00* expands to P0 = 000* and P1 = 001*.  If Q = 000* already exists P0 is eliminated because Q represents a longer match for any destination.

Web Resource See Web writeup for additional applications of tries.  Prefix search.  Automatic command (or phone number or URL) completion.  LZW compression.

Web Resource See Web writeup for alternative node structures for tries.  Array  Chain  Binary search tree  Hash table