A parallel pebble game with applications to expression evaluation Lecture 11.

Slides:



Advertisements
Similar presentations
General algorithmic techniques: Balanced binary tree technique Doubling technique: List Ranking Problem Divide and concur Lecture 6.
Advertisements

Interval Heaps Complete binary tree. Each node (except possibly last one) has 2 elements. Last node has 1 or 2 elements. Let a and b be the elements in.
Advanced Topics in Algorithms and Data Structures
Sorting an Intransitive Total Ordered Set
Parallel algorithms for expression evaluation Part1. Simultaneous substitution method (SimSub) Part2. A parallel pebble game.
Lecture 3: Parallel Algorithm Design
22C:19 Discrete Math Trees Fall 2011 Sukumar Ghosh.
Advanced Topics in Algorithms and Data Structures Lecture pg 1 Recursion.
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 Prefix Computation Advanced Algorithms & Data Structures Lecture Theme 14 Prof. Dr. Th. Ottmann Summer Semester 2006.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
AVL-Trees (Part 1) COMP171. AVL Trees / Slide 2 * Data, a set of elements * Data structure, a structured set of elements, linear, tree, graph, … * Linear:
Parallel algorithms for expression evaluation Simultaneous substitution method (SimSub)
Tirgul 5 AVL trees.
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)
Advanced Topics in Algorithms and Data Structures 1 Lecture 4 : Accelerated Cascading and Parallel List Ranking We will first discuss a technique called.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
CSE621/JKim Lec4.1 9/20/99 CSE621 Parallel Algorithms Lecture 4 Matrix Operation September 20, 1999.
Accelerated Cascading Advanced Algorithms & Data Structures Lecture Theme 16 Prof. Dr. Th. Ottmann Summer Semester 2006.
AVL-Trees (Part 1: Single Rotations) Lecture COMP171 Fall 2006.
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
Rooted Trees. More definitions parent of d child of c sibling of d ancestor of d descendants of g leaf internal vertex subtree root.
Unit 11a 1 Unit 11: Data Structures & Complexity H We discuss in this unit Graphs and trees Binary search trees Hashing functions Recursive sorting: quicksort,
© 2004 Goodrich, Tamassia (2,4) Trees
Advanced Topics in Algorithms and Data Structures Page 1 An overview of lecture 3 A simple parallel algorithm for computing parallel prefix. A parallel.
The Euler-tour technique
Data Structures Using C++ 2E Chapter 11 Binary Trees and B-Trees.
Optimal binary search trees
Balanced Search Trees CS 3110 Fall Some Search Structures Sorted Arrays –Advantages Search in O(log n) time (binary search) –Disadvantages Need.
Advanced Topics in Algorithms and Data Structures 1 An example.
Advanced Data Structures and Algorithms COSC-600 Lecture presentation-6.
Advanced Algorithms Analysis and Design Lecture 8 (Continue Lecture 7…..) Elementry Data Structures By Engr Huma Ayub Vine.
Trees. Introduction to Trees Trees are very common in computer science They come in different forms They are used as data representation in many applications.
Tree isomorphism by Antonina Kogut FCS-2, group 3, October 2011.
PHYLOGENETIC TREES Dwyane George February 24,
Advanced Algebraic Algorithms on Integers and Polynomials Prepared by John Reif, Ph.D. Analysis of Algorithms.
Complexity 20-1 Complexity Andrei Bulatov Parallel Arithmetic.
Compiled by: Dr. Mohammad Omar Alhawarat
MA/CSSE 473 Day 21 AVL Tree Maximum height 2-3 Trees Student questions?
Balanced Search Trees Problem: Efficiency of BST is related to tree’s height.  search, insert and remove follow a path from root to desired location 
Reading and Writing Mathematical Proofs Spring 2015 Lecture 4: Beyond Basic Induction.
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.
Discrete Structures Trees (Ch. 11)
Lecture 11COMPSCI.220.FS.T Balancing an AVLTree Two mirror-symmetric pairs of cases to rebalance the tree if after the insertion of a new key to.
1 Storing Hierarchical Information Lists, Stacks, and Queues represent linear sequences Data often contain hierarchical relationships that cannot be expressed.
Lecture overview Single operation time complexity Previous results Optimality proof UF(k)-trees Operations and complexity IUF(k)-trees Properties and complexity.
Trees 2: Section 4.2 and 4.3 Binary trees. Binary Trees Definition: A binary tree is a rooted tree in which no vertex has more than two children
D. ChristozovCOS 221 Intro to CS II AVL Trees 1 AVL Trees: Balanced BST Binary Search Trees Performance Height Balanced Trees Rotation AVL: insert, delete.
Lecture - 10 on Data Structures. 6:05:57 PM Prepared by, Jesmin Akhter, Lecturer, IIT,JU.
Binary Tree 10/22/081. Tree A nonlinear data structure Contain a distinguished node R, called the root of tree and a set of subtrees. Two nodes n1 and.
Foundation of Computing Systems
1 Fat heaps (K & Tarjan 96). 2 Goal Want to achieve the performance of Fibonnaci heaps but on the worst case. Why ? Theoretical curiosity and some applications.
Fall 2008Simple Parallel Algorithms1. Fall 2008Simple Parallel Algorithms2 Scalar Product of Two Vectors Let a = (a 1, a 2, …, a n ); b = (b 1, b 2, …,
Lecture 9COMPSCI.220.FS.T Lower Bound for Sorting Complexity Each algorithm that sorts by comparing only pairs of elements must use at least 
Priority Search Trees Keys are pairs (x,y). Basic (search, insert, delete) and rectangle operations. Two varieties.  Based on a balanced binary search.
Week 7 - Wednesday.  What did we talk about last time?  Recursive running time  Master Theorem  Symbol tables.
3/12/2013Computer Engg, IIT(BHU)1 PRAM ALGORITHMS-3.
Tree - in “math speak” An ________ graph is a set of vertices/nodes and a set of edges, each edge connects two vertices. Any undirected graph in which.
1 Mathematical Induction An inductive proof has three parts: –Basis case –Inductive hypothesis –Inductive step Related to recursive programming.
Lecture 15 Nov 3, 2013 Height-balanced BST Recall:
Lecture 3: Parallel Algorithm Design
Red Black Trees
Week 6 - Wednesday CS221.
(2,4) Trees (2,4) Trees 1 (2,4) Trees (2,4) Trees
Lecture No.20 Data Structures Dr. Sohail Aslam
Section 9.3 by Andrew Watkins
Lecture 36 Section 12.2 Mon, Apr 23, 2007
Representing binary trees with lists
การวิเคราะห์และออกแบบขั้นตอนวิธี
CS210- Lecture 20 July 19, 2005 Agenda Multiway Search Trees 2-4 Trees
Presentation transcript:

A parallel pebble game with applications to expression evaluation Lecture 11

Parallel pebble game on binary tree Within the game each node v of the tree has associated with it similar node denoted by cond(v). At the outset of the game cond(v)=v, for all v During the game the pairs (v,cond(v)) can be thought of as additional edges Node v is ”active” if and only if cond(v)  v

Pebbling Pebbling a node denotes the fact that in the current state of the game the processor associated with that node has sufficient information to evaluate the subtree rooted here

Three operations active, square and pebble Activate for all non-leaf nodes v in parallel do if v is not active and precisely one of its sons is pebbled then cond(v) becomes the other son if v is not active and both sons are pebbled then cond(v) becomes one of the sons arbitrarily Square for all nodes v in parallel do cond(v)  cond(cond(v)) Pebble for all nodes v in parallel do if cond(v) is pebbled then pebble v

Key result At the outset of the game only the leaves of the tree are pebbled. One composite move of the pebbling game is the sequence of individual operations (activate, square, square, pebble) Theorem Let T be a binary tree with n leaves. If initially only the leaves are pebbled then after log 2 n moves of the pebbling game the root of T becomes pebbled.

Example activate square pebbling

The application of the pebbling game Consider the arithmetic expression ((3+(2*2))*3+5) We assign a processor to each non-leaf node of the tree. + 5 * + 3 * 22 3

+ 5 * + 3 * * + 3 * * + 3 * * + 3 * 22 3 X*2 X+3 X*3 X+5 3x+5 3x+9 2x+3 2x 3(2x+3)+5 3(2x)+9 2x+3 2x

Evaluation of arithmetic expressions Arithmetic expressions can be evaluated on a PRAM in O(log n) time using O(n) processors.