Tree Contraction Label leaf nodes 1...n –Rake odd indexed leaf nodes –Left Compress –Right Compress –Left Compress –Right Compress Key: avoid memory conflicts.

Slides:



Advertisements
Similar presentations
Advanced Topics in Algorithms and Data Structures
Advertisements

Parallel algorithms for expression evaluation Part1. Simultaneous substitution method (SimSub) Part2. A parallel pebble game.
Chapter 10: Trees. Definition A tree is a connected undirected acyclic (with no cycle) simple graph A collection of trees is called forest.
1 AVL Trees (10.2) CSE 2011 Winter April 2015.
Chapter 4: Trees Part II - AVL Tree
Approximation, Chance and Networks Lecture Notes BISS 2005, Bertinoro March Alessandro Panconesi University La Sapienza of Rome.
Binary Trees, Binary Search Trees CMPS 2133 Spring 2008.
Binary Trees, Binary Search Trees COMP171 Fall 2006.
Advanced Topics in Algorithms and Data Structures 1 Rooting a tree For doing any tree computation, we need to know the parent p ( v ) for each node v.
Parallel algorithms for expression evaluation Simultaneous substitution method (SimSub)
Lowest Common Ancestors Two vertices (u, v) Lowest common ancestors, lca (u, v) Example lca (5, 6) = 4 lca (3, 7) = 2 lca (7, 8) = 1 l(v):
6/14/2015 6:48 AM(2,4) Trees /14/2015 6:48 AM(2,4) Trees2 Outline and Reading Multi-way search tree (§3.3.1) Definition Search (2,4)
A Binary Tree root leaf. A Binary Tree root leaf descendent of root parent of leaf.
Trees Nature Lover’s View Of A Tree root branches leaves.
Arithmetic Expression Consider the expression arithmetic expression: (a – b) + ((c + d) + (e * f)) that can be represented as the following tree.
Lec 15 April 9 Topics: l binary Trees l expression trees Binary Search Trees (Chapter 5 of text)
© 2004 Goodrich, Tamassia (2,4) Trees
The Euler-tour technique
1 Section 9.2 Tree Applications. 2 Binary Search Trees Goal is implementation of an efficient searching algorithm Binary Search Tree: –binary tree in.
Chapter 8 Physical Database Design. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Overview of Physical Database.
Advanced Topics in Algorithms and Data Structures 1 An example.
Final Exam Review Instructor : Yuan Long CSC2010 Introduction to Computer Science Apr. 23, 2013.
IntroductionIntroduction  Definition of B-trees  Properties  Specialization  Examples  2-3 trees  Insertion of B-tree  Remove items from B-tree.
Trees Nature Lover’s View Of A Tree root branches leaves.
Graph Theory Topics to be covered:
Lecture 10 Trees –Definiton of trees –Uses of trees –Operations on a tree.
Binary Trees, Binary Search Trees RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
COMP20010: Algorithms and Imperative Programming Lecture 1 Trees.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
Compiled by: Dr. Mohammad Omar Alhawarat
Computer Science: A Structured Programming Approach Using C Trees Trees are used extensively in computer science to represent algebraic formulas;
Trees  Linear access time of linked lists is prohibitive Does there exist any simple data structure for which the running time of most operations (search,
CSE221/ICT221 Analysis and Design of Algorithms CSE221/ICT221 Analysis and Design of Algorithms Analysis of Algorithm using Tree Data Structure Asst.Prof.
MA/CSSE 473 Day 28 Dynamic Programming Binomial Coefficients Warshall's algorithm Student questions?
5.5.3 Rooted tree and binary tree  Definition 25: A directed graph is a directed tree if the graph is a tree in the underlying undirected graph.  Definition.
Chapter 12 B+ Trees CS 157B Spring 2003 By: Miriam Sy.
Fall 2006 CSC311: Data Structures 1 Chapter 10: Search Trees Objectives: Binary Search Trees: Search, update, and implementation AVL Trees: Properties.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
1 5. Abstract Data Structures & Algorithms 5.1 Data Structure Fundamentals.
Review 1 Queue Operations on Queues A Dequeue Operation An Enqueue Operation Array Implementation Link list Implementation Examples.
Discrete Mathematics Chapter 5 Trees.
Chapter 8 Physical Database Design. Outline Overview of Physical Database Design Inputs of Physical Database Design File Structures Query Optimization.
© University of Auckland Trees – (cont.) CS 220 Data Structures & Algorithms Dr. Ian Watson.
Trees Dr. Yasir Ali. A graph is called a tree if, and only if, it is circuit-free and connected. A graph is called a forest if, and only if, it is circuit-free.
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.
Lecture 10COMPSCI.220.FS.T Binary Search Tree BST converts a static binary search into a dynamic binary search allowing to efficiently insert and.
1 Trees What is a Tree? Tree terminology Why trees? What is a general tree? Implementing trees Binary trees Binary tree implementation Application of Binary.
BINARY TREES Objectives Define trees as data structures Define the terms associated with trees Discuss tree traversal algorithms Discuss a binary.
Compressing Bi-Level Images by Block Matching on a Tree Architecture Sergio De Agostino Computer Science Department Sapienza University of Rome ITALY.
Question 4 Tutorial 8. Part A Insert 20, 10, 15, 5,7, 30, 25, 18, 37, 12 and 40 in sequence into an empty binary tree
Discrete Mathematics Chapter 10 Trees.
More Trees. Outline Tree B-Tree 2-3 Tree Tree Red-Black Tree.
B+-Tree Deletion Underflow conditions B+ tree Deletion Algorithm
3-3A Linear Functions Algebra 1 Glencoe McGraw-HillLinda Stamper.
EMIS 8373: Integer Programming Combinatorial Optimization Problems updated 27 January 2005.
"Teachers open the door, but you must enter by yourself. "
CSCE 210 Data Structures and Algorithms
Chapter 5 : Trees.
Binary search tree. Removing a node
Lecture 18. Basics and types of Trees
Trees Trees are a very useful data structure. Many different kinds of trees are used in Computer Science. We shall study just a few of these.
Binary Trees, Binary Search Trees
TREES General trees Binary trees Binary search trees AVL trees
Trees and Binary Trees.
"Teachers open the door, but you must enter by yourself. "
Md. Abul Kashem, Chowdhury Sharif Hasan, and Anupam Bhattacharjee
Binary Trees, Binary Search Trees
Disjoint Sets DS.S.1 Chapter 8 Overview Dynamic Equivalence Classes
Trees Trees are a very useful data structure. Many different kinds of trees are used in Computer Science. We shall study just a few of these.
Binary Trees, Binary Search Trees
Presentation transcript:

Tree Contraction Label leaf nodes 1...n –Rake odd indexed leaf nodes –Left Compress –Right Compress –Left Compress –Right Compress Key: avoid memory conflicts

Tree Contraction for arithmetic expression each node has an expression: two variables x,y, and four coefficients a,b,c,d,e,f,g Rake: replace the variable with the corresponding value Compress: –note that node v has two children x and y, and x is compressed to v, then the expression associated with x has only one variable. –v has expression is f(x,y), and x has expression g( x ), –the expression of v => f(g(x),y) – general formula: Thus, compressing corresponds to computing the new coefficients.

Work Complexity of Compression Efficient? each compress involves 20 operations Note that the leaf node contains only variable or constant The coefficients are mostly zero if the operations do not involve division Worth while to compare this technique with other know optimization techniques (Cook etc.,)

Tree Compression Applications In general, let S be a set. F  {f | f : S  S  S} If S is finite, any tree contraction can be done efficiently Use finite table Number of children –rake x to v : add value of x to y –compress x to v : add value of x to y Height? f s1 s2

Vertex Cover of a tree and Tree Contraction Vertex cover of a tree F: not selected R: selected Mark all nodes with F Let x be the label of parent, y be the label of child f(x,y) : new label after raking or compressing the child f s s Sequential algorithm: computing f

VC of a tree How to do in parallel? –Apply tree contraction by applying f whenever rake or compress is done. How to handle node degree more than 2? –Convert it into a binary tree –For VC, many dummy nodes. –Labeling function should be adjusted? => Not necessary a b cd a ba0a0 c d a2a2 a1a1 

Other applications of Tree Contraction –Minimum Independent set for a tree –Dominating set for a tree For Eulerian tour technique –Biconnected components –Least Common Ancestor

Least Common Ancestor To be prepared

Evaluating Straight Line Program in parallel (Dynamically) Straight Line Program: