Higher Order Tries Key = Social Security Number.

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
Network Algorithms, Lecture 4: Longest Matching Prefix Lookups George Varghese.
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.
Digital Search Trees & Binary Tries Analog of radix sort to searching. Keys are binary bit strings.  Fixed length – 0110, 0010, 1010,  Variable.
Higher Order Tries Key = Social Security Number.   9 decimal digits. 10-way trie (order 10 trie) Height
Digital Search Trees & Binary Tries Analog of radix sort to searching. Keys are binary bit strings.  Fixed length – 0110, 0010, 1010,  Variable.
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
Univ. of TehranAdv. topics in Computer Network1 Advanced topics in Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr.
Address Lookup in IP Routers. 2 Routing Table Lookup Routing Decision Forwarding Decision Forwarding Decision Routing Table Routing Table Routing Table.
IP Address Lookup Masoud Sabaei Assistant professor
B + -Trees Same structure as B-trees. Dictionary pairs are in leaves only. Leaves form a doubly-linked list. Remaining nodes have following structure:
Higher Order Tries Key = Social Security Number.   9 decimal digits. 10-way trie (order 10 trie) Height
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.
Search Radix search trie (RST) R-way trie (RT) De la Briandias trie (DLB)
DS.T.1 Trees Chapter 4 Overview Tree Concepts Traversals Binary Trees Binary Search Trees AVL Trees Splay Trees B-Trees.
Generic Trees—Trie, Compressed Trie, Suffix Trie (with Analysi
Tries 4/16/2018 8:59 AM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and.
Lecture 23 Red Black Tree Chapter 10 of textbook
AA Trees.
CSCE 3110 Data Structures & Algorithm Analysis
G64ADS Advanced Data Structures
Red Black Trees Colored Nodes Definition Binary search tree.
AVL Trees 5/17/2018 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M.
B/B+ Trees 4.7.
Tries 07/28/16 11:04 Text Compression
Red Black Trees Colored Nodes Definition Binary search tree.
Higher Order Tries Key = Social Security Number.
Multiway Search Trees Data may not fit into main memory
IP Routers – internal view
Binary search tree. Removing a node
B-Trees Large degree B-trees used to represent very large dictionaries that reside on disk. Smaller degree B-trees used for internal-memory dictionaries.
Mark Redekopp David Kempe
B+-Trees.
Multiway search trees and the (2,4)-tree
B+-Trees.
B+-Trees.
Red-Black Trees 9/12/ :44 AM AVL Trees v z AVL Trees.
Tries 9/14/ :13 AM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and.
Radix search trie (RST) R-way trie (RT) De la Briandias trie (DLB)
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 Trees, Binary Search Trees
AVL Tree A Balanced Binary Search Tree
Red-Black Trees 11/13/2018 2:07 AM AVL Trees v z AVL Trees.
Data Structures and Algorithms
Binary Tries (continued)
Multi-Way Search Trees
Red-Black Trees 11/26/2018 3:42 PM AVL Trees v z AVL Trees.
B-Tree.
Digital Search Trees & Binary Tries
Multiway Trees Searching and B-Trees Advanced Tree Structures
Binary Search Trees.
Packet Classification Using Coarse-Grained Tuple Spaces
(2,4) Trees 2/15/2019 (2,4) Trees (2,4) Trees.
AVL Trees 2/23/2019 AVL Trees v z AVL Trees.
Tries 2/23/2019 8:29 AM Tries 2/23/2019 8:29 AM Tries.
General Trees A general tree T is a finite set of zero or more nodes such that there is one designated node r, called the root of T, and the remaining.
Red-Black Trees 2/24/ :17 AM AVL Trees v z AVL Trees.
B-Trees Large degree B-trees used to represent very large dictionaries that reside on disk. Smaller degree B-trees used for internal-memory dictionaries.
File Organization.
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.
Trees in java.util A set is an object that stores unique elements
Red-Black Trees 5/19/2019 6:39 AM AVL Trees v z AVL Trees.
B-Trees Large degree B-trees used to represent very large dictionaries that reside on disk. Smaller degree B-trees used for internal-memory dictionaries.
Data Structures Using C++ 2E
Red Black Trees Colored Nodes Definition Binary search tree.
Presentation transcript:

Higher Order Tries Key = Social Security Number. 441-12-1135 9 decimal digits. 10-way trie (order 10 trie). 1 2 3 4 5 6 7 8 9 Height <= 10.

Social Security Trie 10-way trie 100-way trie Height <= 10. Search => <= 9 branches on digits plus 1 compare. 100-way trie 441-12-1135 Height <= 6. Search => <= 5 branches on digits plus 1 compare. 10-way trie => at most 10 cache misses for a search! Up to 9 branch levels and 1 element level. 100-way => at most 6 misses.

Social Security AVL & Red-Black Red-black tree Height <= 2log2109 ~ 60. Search => <= 60 compares of 9 digit numbers. AVL tree Height <= 1.44log2109 ~ 40. Search => <= 40 compares of 9 digit numbers. Best binary tree. Height = log2109 ~ 30. With 1million entries, height of red-black tree is at most 40.

Compressed Social Security Trie Branch Node Structure #ptr 1 2 3 4 5 6 7 8 9 char# char# = character/digit used for branching. Equivalent to bit# feld of compressed binary trie. #ptr = # of nonnull pointers in the node.

Insert Insert 012345678. 012345678 Insert 015234567. 2 5 012345678 015234567 3 Null pointer fields not shown.

Insert 2 5 012345678 015234567 3 Insert 015231671.

Insert 2 5 012345678 015234567 3 1 4 6 015231671 Fall off root during search for insert key. Find any key in subtree you fall off of and find first character where this key and insert key differ. In the example, this is character/digit 2. Insert 079864231.

Insert 2 5 012345678 015234567 3 1 4 6 015231671 7 079864231 Insert 012345618.

Insert 1 7 8 2 5 012345678 015234567 3 1 4 6 015231671 079864231 7 012345618 Insert 011917352.

Insert 1 7 2 1 2 5 3 079864231 011917352 1 4 1 7 8 6 012345678 012345618 015231671 015234567

Delete 1 7 8 2 5 012345678 015234567 4 6 015231671 079864231 012345618 3 011917352 Delete 011917352.

Delete 1 7 2 2 5 3 079864231 1 4 1 7 8 6 012345678 Can back up at most one level. 012345618 015231671 015234567 Delete 012345678.

Delete 1 7 2 2 5 3 079864231 1 4 6 012345618 Can back up at most one level. 015231671 015234567 Delete 015231671.

Delete 1 7 2 2 5 3 079864231 012345618 015234567 Can back up at most one level.

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

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

Variable Length Keys Insert 0123. 012345678 015234567 015231671 0123 # End of key character (#) not shown.

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 2 5 012345678 015234567 3 1 4 6 015231671 0123 # Element field also useful for insert. element field shown in blue.

Etc. Expected height of an order m trie is ~logmn. 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 1 null 011 10 11 00 S =1 S =2 000 001 01 1 null 011 10 11 00 S =1 S =2 000 001 01 Length 1 prefix is stored in root. How about length 2 and begins with 0? Expand to length 3. Fixed and variable stride tries. Find strides so as to minimize space requirement.

Multibit Tries Node whose stride is s uses s bits for branching. Node has 2s children and 2s 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.