I/O-Algorithms Lars Arge Spring 2012 April 17, 2012.

Slides:



Advertisements
Similar presentations
Chapter 28 Weighted Graphs and Applications
Advertisements

Chapter 25 Lists, Stacks, Queues, and Priority Queues
2. Getting Started Heejin Park College of Information and Communications Hanyang University.
1 Vorlesung Informatik 2 Algorithmen und Datenstrukturen (Parallel Algorithms) Robin Pomplun.
Graph Algorithms - 3 Algorithm Design and Analysis Victor AdamchikCS Spring 2014 Lecture 13Feb 12, 2014Carnegie Mellon University.
David Luebke 1 6/1/2014 CS 332: Algorithms Medians and Order Statistics Structures for Dynamic Sets.
Long cycles, short cycles, min-degree subgraphs, and feedback arc sets in Eulerian digraphs Raphael Yuster joint work with Asaf Shapira Eilat 2012.
General algorithmic techniques: Balanced binary tree technique Doubling technique: List Ranking Problem Divide and concur Lecture 6.
David Luebke 1 6/7/2014 CS 332: Algorithms Skip Lists Introduction to Hashing.
Parallel List Ranking Advanced Algorithms & Data Structures Lecture Theme 17 Prof. Dr. Th. Ottmann Summer Semester 2006.
List Ranking and Parallel Prefix
David Luebke 1 6/7/2014 ITCS 6114 Skip Lists Hashing.
1 Parallel Algorithms (chap. 30, 1 st edition) Parallel: perform more than one operation at a time. PRAM model: Parallel Random Access Model. p0p0 p1p1.
SKIP LISTS Amihood Amir Incorporationg the slides of Goodrich and Tamassia (2004)
Chapter 24 Lists, Stacks, and Queues
Data Structures Using C++
List Ranking on GPUs Sathish Vadhiyar. List Ranking on GPUs Linked list prefix computations – computations of prefix sum on the elements contained in.
Algorithms (and Datastructures) Lecture 3 MAS 714 part 2 Hartmut Klauck.
CS 400/600 – Data Structures External Sorting.
I/O and Space-Efficient Path Traversal in Planar Graphs Craig Dillabaugh, Carleton University Meng He, University of Waterloo Anil Maheshwari, Carleton.
Problems and Their Classes
Bart Jansen 1.  Problem definition  Instance: Connected graph G, positive integer k  Question: Is there a spanning tree for G with at least k leaves?
Epp, section 10.? CS 202 Aaron Bloomfield
Advanced Topics in Algorithms and Data Structures
1 Efficient algorithms on sets of permutations, dominance, and real-weighted APSP Raphael Yuster University of Haifa.
I/O-Algorithms Lars Arge Fall 2014 September 25, 2014.
Lars Arge 1/43 Big Terrain Data Analysis Algorithms in the Field Workshop SoCG June 19, 2012 Lars Arge.
I/O-Algorithms Lars Arge January 31, Lars Arge I/O-algorithms 2 Random Access Machine Model Standard theoretical model of computation: –Infinite.
I/O-Algorithms Lars Arge University of Aarhus February 21, 2005.
I/O-Algorithms Lars Arge Aarhus University February 27, 2007.
I/O-Algorithms Lars Arge Spring 2011 March 8, 2011.
I/O-Algorithms Lars Arge Spring 2009 February 2, 2009.
I/O-Algorithms Lars Arge Spring 2009 January 27, 2009.
I/O-Algorithms Lars Arge Spring 2007 January 30, 2007.
I/O-Algorithms Lars Arge Aarhus University February 16, 2006.
I/O-Algorithms Lars Arge Aarhus University February 7, 2005.
I/O-Algorithms Lars Arge University of Aarhus February 13, 2005.
I/O-Algorithms Lars Arge University of Aarhus March 1, 2005.
I/O-Algorithms Lars Arge Spring 2009 March 3, 2009.
I/O-Algorithms Lars Arge Aarhus University February 6, 2007.
I/O-Algorithms Lars Arge Spring 2006 February 2, 2006.
I/O-Algorithms Lars Arge Aarhus University March 5, 2008.
I/O-Algorithms Lars Arge Aarhus University April 16, 2008.
I/O-Algorithms Lars Arge Aarhus University February 14, 2008.
I/O-Algorithms Lars Arge University of Aarhus March 7, 2005.
External Memory Algorithms Kamesh Munagala. External Memory Model Aggrawal and Vitter, 1988.
Skip Lists1 Skip Lists William Pugh: ” Skip Lists: A Probabilistic Alternative to Balanced Trees ”, 1990  S0S0 S1S1 S2S2 S3S3 
External-Memory MST (Arge, Brodal, Toma). Minimum-Spanning Tree Given a weighted, undirected graph G=(V,E), the minimum-spanning tree (MST) problem is.
I/O-Algorithms Lars Arge Spring 2008 January 31, 2008.
Advanced Topics in Algorithms and Data Structures 1 Two parallel list ranking algorithms An O (log n ) time and O ( n log n ) work list ranking algorithm.
I/O-Algorithms Lars Arge Fall 2014 August 28, 2014.
Heavily based on slides by Lars Arge I/O-Algorithms Thomas Mølhave Spring 2012 February 9, 2012.
Foundation of Computing Systems Lecture 6 Trees: Part III.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
I/O-Efficient Graph Algorithms Norbert Zeh Duke University EEF Summer School on Massive Data Sets Århus, Denmark June 26 – July 1, 2002.
Bin Yao Spring 2014 (Slides were made available by Feifei Li) Advanced Topics in Data Management.
B-trees and kd-trees Piotr Indyk (slides partially by Lars Arge from Duke U)
An Optimal Cache-Oblivious Priority Queue and Its Applications in Graph Algorithms By Arge, Bender, Demaine, Holland-Minkley, Munro Presented by Adam Sheffer.
MotivationFundamental ProblemsProblems on Graphs Parallel processors are becoming common place. Each core of a multi-core processor consists of a CPU and.
Breadth First Search Maedeh Mehravaran Big data 1394.
Depth First Search Maedeh Mehravaran Big data 1394.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
© 2006 Pearson Addison-Wesley. All rights reserved 14 A-1 Chapter 14 Graphs.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
Prims Algorithm for finding a minimum spanning tree
© 2006 Pearson Addison-Wesley. All rights reserved14 B-1 Chapter 14 (continued) Graphs.
Spanning Trees Longin Jan Latecki Temple University based on slides by
Advanced Topics in Data Management
Spanning Trees Longin Jan Latecki Temple University based on slides by
Presentation transcript:

I/O-Algorithms Lars Arge Spring 2012 April 17, 2012

Lars Arge I/O-algorithms 2 I/O-Model Parameters N = # elements in problem instance B = # elements that fits in disk block M = # elements that fits in main memory T = # output size in searching problem We often assume that M>B 2 I/O: Movement of block between memory and disk D P M Block I/O

Lars Arge I/O-Algorithms 3 Fundamental Bounds Internal External Scanning: N Sorting: N log N Permuting Searching: Note: –Linear I/O: O(N/B) –Permuting not linear –Permuting and sorting bounds are equal in all practical cases –B factor VERY important: –Cannot sort optimally with search tree

Scalability Problems: Block Access Matters Example: Traversing linked list (List ranking) –Array size N = 10 elements –Disk block size B = 2 elements –Main memory size M = 4 elements (2 blocks) Large difference between N and N/B large since block size is large –Example: N = 256 x 10 6, B = 8000, 1ms disk access time N I/Os take 256 x 10 3 sec = 4266 min = 71 hr N/B I/Os take 256/8 sec = 32 sec Algorithm 2: N/B=5 I/OsAlgorithm 1: N=10 I/Os Lars Arge I/O-Algorithms

Lars Arge I/O-algorithms 5 List Ranking Problem: –Given N-vertex linked list stored in array –Compute rank (number in list) of each vertex One of the simplest graph problem one can think of Straightforward O(N) internal algorithm –Also uses O(N) I/Os in external memory Much harder to get external algorithm

Lars Arge I/O-algorithms 6 List Ranking We will solve more general problem: –Given N-vertex linked list with edge-weights stored in array –Compute sum of weights (rank) from start for each vertex List ranking: All edge weights one Note: Weight stored in array entry together with edge (next vertex)

Lars Arge I/O-algorithms 7 List Ranking Algorithm: 1.Find and mark independent set of vertices 2.Bridge-out independent set: Add new edges 3.Recursively rank resulting list 4.Bridge-in independent set: Compute rank of independent set Step 1, 2 and 4 in I/Os Independent set of size αN for 0 < α 1 I/Os

Lars Arge I/O-algorithms 8 List Ranking: Bridge-out/in Obtain information (edge or rang) of successor –Make copy of original list –Sort original list by successor id –Scan original and copy together to obtain successor information –Sort modified original list by id I/Os

Lars Arge I/O-algorithms 9 List Ranking: Independent Set Easy to design randomized algorithm: –Scan list and flip a coin for each vertex –Independent set is vertices with head and successor with tails Independent set of expected size N/4 Deterministic algorithm: –3-color vertices (no vertex same color as predecessor/successor) –Independent set is vertices with most popular color Independent set of size at least N/3 3-coloring I/O algorithm

Lars Arge I/O-algorithms 10 List Ranking: 3-coloring Algorithm: –Consider forward and backward lists (heads/tails in two lists) –Color forward lists (except tail) alternately red and blue –Color backward lists (except tail) alternately green and blue 3-coloring

Lars Arge I/O-algorithms 11 List Ranking: Forward List Coloring Identify heads and tails For each head, insert red element in priority-queue (priority=position) Repeatedly: –Extract minimal element from queue –Access and color corresponding element in list –Insert opposite color element corresponding to successor in queue Scan of list O(N) priority-queue operations I/Os `

Lars Arge I/O-algorithms 12 Summary: List Ranking Simplest graph problem: Traverse linked list Very easy O(N) algorithm in internal memory Much more difficult external memory –Finding independent set via 3-coloring –Bridging vertices in/out Permuting bound best possible –Also true for other graph problems

Lars Arge I/O-algorithms 13 Summary: List Ranking External list ranking algorithm similar to PRAM algorithm –Sometimes external algorithms by PRAM algorithm simulation Forward list coloring algorithm example of time forward processing –Use external priority-queue to send information forward in time to vertices to be processed later

Lars Arge I/O-algorithms 14 Algorithms on Trees TBD

Lars Arge I/O-algorithms 15 References External-Memory Graph Algorithms Y-J. Chiang, M. T. Goodrich, E.F. Grove, R. Tamassia. D. E. Vengroff, and J. S. Vitter. Proc. SODA'95 –Section 3-6 I/O-Efficient Graph Algorithms Norbert Zeh. Lecture notes –Section 2-4 Cache-Oblivious Priority Queue and Graph Algorithm Applications L. Arge, M. Bender, E. Demaine, B. Holland-Minkley and I. Munro. SICOMP, 36(6), 2007 –Section