Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Competitive Analysis.

Slides:



Advertisements
Similar presentations
Online Algorithm Huaping Wang Apr.21
Advertisements

Yannis Smaragdakis / 11-Jun-14 General Adaptive Replacement Policies Yannis Smaragdakis Georgia Tech.
Tight Bounds for Online Class- constrained Packing Hadas Shachnai Bell Labs and The Technion IIT Tami Tamir The Technion IIT.
CSE 4101/5101 Prof. Andy Mirzaian. Lists Move-to-Front Search Trees Binary Search Trees Multi-Way Search Trees B-trees Splay Trees Trees Red-Black.
Online Algorithms Advanced Seminar A Supervisor: Matya Katz Ran Taig, Achiya Elyasaf December, 2009.
1 SOFSEM 2007 Weighted Nearest Neighbor Algorithms for the Graph Exploration Problem on Cycles Eiji Miyano Kyushu Institute of Technology, Japan Joint.
Online Algorithms Amrinder Arora Permalink:
On the Competitiveness of Self Organizing Linear Search J. Ian Munro (University of Waterloo) Competitiveness: How well does an on line algorithm do in.
Online Scheduling with Known Arrival Times Nicholas G Hall (Ohio State University) Marc E Posner (Ohio State University) Chris N Potts (University of Southampton)
Online Algor ithm Paging and Caching. Caching (paging) Structure of data storage Cache memory : Static RAM Level 1 Cache Level 2 Cache Main memory Hard.
Spring 2015 Lecture 5: QuickSort & Selection
1 Competitive analysis of the LRFU paging algorithm Edith Cohen -- AT&T Haim Kaplan -- Tel Aviv Univ. Uri Zwick -- Tel Aviv Univ.
Analysis of Algorithms
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Amortized Analysis Some of these lecture slides are adapted from CLRS.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management – 4 Page Replacement Algorithms CS 342 – Operating Systems.
Online Algorithms Lecture notes for lectures given by Dr. Ely Porat, Bar-Ilan University Notes taken by: Navot Akiva Yair Kaufman Raz Lin Ohad Lipsky July.
UMass Lowell Computer Science Graduate Analysis of Algorithms Prof. Karen Daniels Spring, 2009 Lecture 3 Tuesday, 2/10/09 Amortized Analysis.
CS 202, Spring 2003 Fundamental Structures of Computer Science II Bilkent University1 Splay trees CS 202 – Fundamental Structures of Computer Science II.
Towards a Theory of Cache-Efficient Algorithms Summary for the seminar: Analysis of algorithms in hierarchical memory – Spring 2004 by Gala Golan.
Online Algorithms Motivation and Definitions Paging Problem Competitive Analysis Online Load Balancing.
Tirgul 8 Universal Hashing Remarks on Programming Exercise 1 Solution to question 2 in theoretical homework 2.
10/10/2002CSE Memory Hierarchy CSE Algorithms Quicksort vs Heapsort: the “inside” story or A Two-Level Model of Memory.
Ecole Polytechnique, Nov 7, Online Job Scheduling Marek Chrobak University of California, Riverside.
Evaluation of Algorithms for the List Update Problem Suporn Pongnumkul R. Ravi Kedar Dhamdhere.
Competitive Paging Algorithms Amos Fiat, Richard Karp, Michael Luby, Lyle McGeoch, Daniel Sleator, Neal Young presented by Seth Phillips.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
1 Last Time: Paging Motivation Page Tables Hardware Support Benefits.
Online Algorithms Lecture notes for lectures given by Dr. Ely Porat, Bar-Ilan University Notes taken by: Navot Akiva Yair Kaufman Raz Lin Ohad Lipsky July.
Paging for Multi-Core Shared Caches Alejandro López-Ortiz, Alejandro Salinger ITCS, January 8 th, 2012.
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue data structures.
Minimizing Cache Usage in Paging Alejandro Salinger University of Waterloo Joint work with Alex López-Ortiz.
CSE332: Data Abstractions Lecture 26: Amortized Analysis Tyler Robison Summer
1/24 Algorithms for Generalized Caching Nikhil Bansal IBM Research Niv Buchbinder Open Univ. Israel Seffi Naor Technion.
Maninder Kaur VIRTUAL MEMORY 24-Nov
International Graduate School of Dynamic Intelligent Systems, University of Paderborn Improved Algorithms for Dynamic Page Migration Marcin Bieńkowski.
Advanced Algorithms Piyush Kumar (Lecture 12: Online Algorithms) Welcome to COT5405.
Why is bin packing interesting?
Online Paging Algorithm By: Puneet C. Jain Bhaskar C. Chawda Yashu Gupta Supervisor: Dr. Naveen Garg, Dr. Kavitha Telikepalli.
9/8/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 6 Greedy Algorithms.
Online Algorithms. Introduction An offline algorithm has a full information in advance so it can compute the optimal strategy to maximize its profit (minimize.
Minimizing Cache Usage in Paging Alejandro López-Ortiz, Alejandro Salinger University of Waterloo.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
By Andrew Yee. Virtual Memory Memory Management What is Page Replacement?
CSE 5314 On-line Computation Homework 1 Wook Choi Feb/26/2004.
Jennifer Campbell November 30,  Problem Statement and Motivation  Analysis of previous work  Simple - competitive strategy  Near optimal deterministic.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Average Case Analysis.
David Luebke 1 12/12/2015 CS 332: Algorithms Amortized Analysis.
A polylog competitive algorithm for the k-server problem Nikhil Bansal (IBM) Niv Buchbinder (Open Univ.) Aleksander Madry (MIT) Seffi Naor (Technion)
A Optimal On-line Algorithm for k Servers on Trees Author : Marek Chrobak Lawrence L. Larmore 報告人:羅正偉.
1 Chapter 5-1 Greedy Algorithms Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
More On Intractability & Beyond CS161: Online Algorithms Monday, August 11 th 1.
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
CS 149: Operating Systems March 5 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Saket Mengle Paging refers to the process of managing program access to virtual memory pages that do not currently reside in RAM.
Problem 3.2 Paging Algorithms-Time & Space Requirements Problem:What are the space and time requirements of LIFO, LFU, and LED? LRU:(least-recently-used):
11 -1 Chapter 12 On-Line Algorithms On-Line Algorithms On-line algorithms are used to solve on-line problems. The disk scheduling problem The requests.
Sorting by placement and Shift Sergi Elizalde Peter Winkler By 資工四 B 周于荃.
Page Replacement FIFO, LIFO, LRU, NUR, Second chance
1 Section 5.1 Analyzing Algorithms Let P be a problem and A an algorithm to solve P. The running time of A can be analyzed by counting the number of certain.
Exercise 3.10 Prove Theorem 3.8 R(ALG) >= k(s+1)/(k+s) Solution:
Exercise Exercise Proof that
Greedy Algorithms / Caching Problem Yin Tat Lee
Greedy Algorithms / Caching Problem Yin Tat Lee
CS 140 Lecture Notes: Demand Paging
CS 140 Lecture Notes: Demand Paging
Page Replacement FIFO, LIFO, LRU, NUR, Second chance
Exercise (11).
Exercise (10).
MinMax Principle in Game Theory – continued….
Presentation transcript:

Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Competitive Analysis

2 Beyond Worst Case Analysis Worst-case analysis. n Analyze running time as function of worst input of a given size. Average case analysis. n Analyze average running time over some distribution of inputs. n Ex: quicksort. Amortized analysis. n Worst-case bound on sequence of operations. n Ex: splay trees, union-find. Competitive analysis. n Make quantitative statements about online algorithms. n Ex: paging, load balancing.

3 Online Algorithm and Competitive Analysis Paging problem: Given two-level store consisting of fast memory (cache) that can hold k pages, and slow memory that can store infinitely many pages. n Sequence of page requests p: – if page p already in cache, no cost incurred – otherwise, eject some other page q from cache and replace with p, and pay unit cost for page fault. n If p not in cache, which page q should you evict? n Most fundamental and practically important online problem in CS.

4 Online Algorithm and Competitive Analysis Competitive analysis. (Sleator-Tarjan) n Algorithm A is  -competitive if there exists some constant b such that for every sequence of inputs  : where OPT is optimal offline algorithm. n OPT = MIN: evict page whose next access is furthest away. n A = LRU: evict page whose most recent access was earliest  Traditional analysis completely uninformative.  We show LRU is k-competitive. n A = LIFO: evict page brought in most recently.  LIFO can have arbitrarily bad competitive ratio. n Fact: no online paging algorithm is better than k-competitive.

5 Online Algorithm and Competitive Analysis Theorem. LRU is k-competitive. Proof: Let  be a subsequence of  on which LRU faults exactly k times, and  does not contain fist access in . Let p denote page requested just before . n Case 1: LRU faults in sequence  on p. –  requests at least k+1 different pages  MIN faults at least once n Case 2: LRU faults on some page, say q, at least twice in . –  requests at least k+1 different pages  MIN faults at least once

6 Online Algorithm and Competitive Analysis Theorem. LRU is k-competitive. Proof: Let  be a subsequence of  on which LRU faults exactly k times, and  does not contain fist access in . Let p denote page requested just before . n Case 3: LRU does not fault on p, nor on any page more than once. – k different pages are accessed and faulted on, none of which is p – p is in MIN's cache at start of   MIN faults at least once 00 11 22... 11 pp :: LRU faults k times MIN faults  1 times LRU faults  k times