Better Algorithms for Better Computers

Slides:



Advertisements
Similar presentations
Probabilistic Skyline Operator over Sliding Windows Wenjie Zhang University of New South Wales & NICTA, Australia Joint work: Xuemin Lin, Ying Zhang, Wei.
Advertisements

LEARNING INFLUENCE PROBABILITIES IN SOCIAL NETWORKS Amit Goyal Francesco Bonchi Laks V. S. Lakshmanan University of British Columbia Yahoo! Research University.
Order Statistics Sorted
Lecturer: Moni Naor Algorithmic Game Theory Uri Feige Robi Krauthgamer Moni Naor Lecture 8: Regret Minimization.
Online Algorithms Amrinder Arora Permalink:
Online learning, minimizing regret, and combining expert advice
Follow the regularized leader
Bounds on Code Length Theorem: Let l ∗ 1, l ∗ 2,..., l ∗ m be optimal codeword lengths for a source distribution p and a D-ary alphabet, and let L ∗ be.
Evaluation of Algorithms for the List Update Problem Suporn Pongnumkul R. Ravi Kedar Dhamdhere.
Greedy vs Dynamic Programming Approach
Self-Organizing Lists1 Self-Organizing Lists Competitive Analysis Lee Wee Sun SoC Modified by Orgad Keller Modified again by.
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
Shuchi Chawla, Carnegie Mellon University Static Optimality and Dynamic Search Optimality in Lists and Trees Avrim Blum Shuchi Chawla Adam Kalai 1/6/2002.
Online Oblivious Routing Nikhil Bansal, Avrim Blum, Shuchi Chawla & Adam Meyerson Carnegie Mellon University 6/7/2003.
Preference Analysis Joachim Giesen and Eva Schuberth May 24, 2006.
Path Planning in Expansive C-Spaces D. HsuJ.-C. LatombeR. Motwani CS Dept., Stanford University, 1997.
Evaluation of Algorithms for the List Update Problem Suporn Pongnumkul R. Ravi Kedar Dhamdhere.
Competitive Analysis of Incentive Compatible On-Line Auctions Ron Lavi and Noam Nisan SISL/IST, Cal-Tech Hebrew University.
Binary search trees Definition Binary search trees and dynamic set operations Balanced binary search trees –Tree rotations –Red-black trees Move to front.
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
Experts Learning and The Minimax Theorem for Zero-Sum Games Maria Florina Balcan December 8th 2011.
Online Learning Algorithms
1/24 Algorithms for Generalized Caching Nikhil Bansal IBM Research Niv Buchbinder Open Univ. Israel Seffi Naor Technion.
COMP s1 Computing 2 Complexity
A Theoretical Study of Optimization Techniques Used in Registration Area Based Location Management: Models and Online Algorithms Sandeep K. S. Gupta Goran.
Online Oblivious Routing Nikhil Bansal, Avrim Blum, Shuchi Chawla & Adam Meyerson Carnegie Mellon University 6/7/2003.
Yossi Azar Tel Aviv University Joint work with Ilan Cohen Serving in the Dark 1.
Trust-Aware Optimal Crowdsourcing With Budget Constraint Xiangyang Liu 1, He He 2, and John S. Baras 1 1 Institute for Systems Research and Department.
Analysis of Algorithms CSCI Previous Evaluations of Programs Correctness – does the algorithm do what it is supposed to do? Generality – does it.
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
BLAST: Basic Local Alignment Search Tool Altschul et al. J. Mol Bio CS 466 Saurabh Sinha.
Jennifer Campbell November 30,  Problem Statement and Motivation  Analysis of previous work  Simple - competitive strategy  Near optimal deterministic.
Sorting and searching in the presence of memory faults (without redundancy) Irene Finocchi Giuseppe F. Italiano DISP, University of Rome “Tor Vergata”
1 5. Abstract Data Structures & Algorithms 5.6 Algorithm Evaluation.
A Optimal On-line Algorithm for k Servers on Trees Author : Marek Chrobak Lawrence L. Larmore 報告人:羅正偉.
Frequency Capping in Online Advertising Moran Feldman Technion Joint work with: Niv Buchbinder,The Open University of Israel Arpita Ghosh,Yahoo! Research.
Research Academic Computer Technology Institute (RACTI) Patras Greece1 An Algorithmic Framework for Adaptive Web Content Christos Makris, Yannis Panagis,
Algorithm Analysis (Big O)
Skip Lists – Why? BSTs –Worse case insertion, search O(n) –Best case insertion, search O(log n) –Where your run fits in O(n) – O(log n) depends on the.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 18.
Errol Lloyd Design and Analysis of Algorithms Approximation Algorithms for NP-complete Problems Bin Packing Networks.
Online Learning Model. Motivation Many situations involve online repeated decision making in an uncertain environment. Deciding how to invest your money.
Unified Adaptivity Optimization of Clock and Logic Signals Shiyan Hu and Jiang Hu Dept of Electrical and Computer Engineering Texas A&M University.
1 5. Abstract Data Structures & Algorithms 5.6 Algorithm Evaluation.
Intro to Data Structures Concepts ● We've been working with classes and structures to form linked lists – a linked list is an example of something known.
Algorithm Analysis 1.
Carnegie Mellon University
Binary search trees Definition
Data Structures Lab Algorithm Animation.
Analysis of Algorithms
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
The Greedy Method and Text Compression
On Multi-Arm Manipulation Planning
Static Optimality and Dynamic Search Optimality in Lists and Trees
COSC160: Data Structures Linked Lists
Algorithm Analysis CSE 2011 Winter September 2018.
Association Rule Mining
Hidden Markov Models Part 2: Algorithms
Randomized Algorithms CS648
Objective of This Course
Merge Sort 11/28/2018 2:21 AM The Greedy Method The Greedy Method.
CIS 488/588 Bruce R. Maxim UM-Dearborn
Searching CLRS, Sections 9.1 – 9.3.
Analysis of Algorithms
Analysis of Algorithms
The Weighted Majority Algorithm
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Analysis of Algorithms
An Optimal Lower Bound for Buffer Management in Multi-Queue Switches
Presentation transcript:

Better Algorithms for Better Computers Shuchi Chawla 3/18/02 references

An Optimal Algorithm for List Update Shuchi Chawla 3/18/02 List factoring slide Uses of update…

The List Update Problem Query for cereal bananas chocolate bread cereal milk eggs apples = No = No = No = Yes Maintain an unordered linked list of items Query for ith item takes i time 1

The List Update Problem Query for cereal bananas chocolate bread cereal milk eggs apples = No = No = No = Yes Maintain an unordered linked list of items Query for ith item takes (i-1) time Goal: Minimize time spent 2

The List Update Problem Query for cereal bananas chocolate bread cereal milk eggs apples = Yes What can the algorithm do? Change positions of items in between accesses – at some cost! 3

Moving items between accesses Query for cereal bananas cereal chocolate bread milk eggs apples What can the algorithm do? Change positions of items in between accesses – at some cost! 4

Moving items between accesses Query for cereal bananas cereal chocolate bread milk eggs apples Move “up” accessed items for FREE! Other movements allowed at cost 1 per operation New Goal: minimize total cost What can the algorithm do? 5

Why are we studying this? Lists are a widely used data structure Algorithms for lists can be generalized to other problems such as Binary Search Trees, Paging Eg. List Update: Order elements by frequency or occurrence, most frequent in front Search Trees: Make a “Huffman code” tree based on frequency counts 6

Why are we studying this? Lists are a widely used data structure Algorithms for lists can be generalized to other problems such as Binary Search Trees, Paging Goals: Develop algorithm for List Update Extend algorithm to a general strategy that provably works for any online data structure Give detailed example of trees 7

Outline of the talk.. Rules of the game The algorithm Extensions and Conclusions 8

Outline of the talk.. Rules of the game The algorithm Online algorithms – the scenario Examples of known list update algorithms Formal definition of Competitive Ratio Previously known results The algorithm Extensions and Conclusions 9

Online Algorithms.. The input is specified in steps Compared against the best “offline” algorithm The input is specified in steps At every step, algorithm makes a move Move should be good even with respect to future input! knows future input Constrain the algorithm: cannot change state of the system Static Alg 10

Back to the Grocery List Query for cereal bananas cereal chocolate bread milk eggs apples Which items should we move to incur a minimum total cost? Suggestions? Frequency Counts Move To Front 11

Move To Front MTF is always at most twice worse than OPT b c d d c b a d (3) b (1) c (2) a (0) d (3) d a b c a d c b b (3) c (3) a (3) MTF’s Total cost = 12 OPT’s Total cost = 6 MTF is always at most twice worse than OPT FC achieves the same 12

Framework for measuring Alg’s performance We compare ratio of Alg’s cost to Opt’s cost: If: On input sequence S, Opt incurs cost O And: On S, Alg incurs cost at most O Alg’s “Competitive Ratio” is  Formal Definition: Competitive Ratio = maxinputs (our cost)/(cost of OPT) Next slide: what does opt look like For distributions, opt is a static alg Comparing to static algs makes our task easier Worst case analysis 13

Worst –Case Analysis Adversary is all powerful Can figure out which input is worst for Alg Our ratio holds for all input sequences Adversary cannot force us to perform worse 14

Can we do better than twice Opt? Adversary knows the state of the algorithm She always picks the last element Even best SOPT has cost less than n/2 more than half the time No Algorithm can do better than twice the optimal Deterministic 15

Performance of randomized algorithms Deterministic Competitive Ratio = maxinputs (our cost)/(cost of OPT) Randomized Competitive Ratio = maxinputs Erandom bits(our cost)/(cost of OPT) “Worst Case Expected Ratio” 16

Expected Worst Case Ratio For every input good performance with high probability Adversary cannot force Alg to perform badly with probability 1 17

What’s known so far No deterministic algorithm can perform better than a competitive ratio of 2. For randomized algorithms, the best known algorithm achieves a 1.6 competitive ratio. 18

Our result Algorithm with (1+) competitive ratio Give a general strategy that achieves (1+) ratio for any data structure 19

Outline of the talk.. Rules of the game The algorithm Extensions and Conclusions 20

Outline of the talk.. Rules of the game The algorithm Machine learning alg: Expert’s advice Apply Expert’s advice to list update Neat idea: List Factoring Algorithm for a two-element list Extend it to n-element list Extensions and Conclusions 21

Predicting from Experts’ advice Predicting the stock market mistake Expert#1 Expert#2 Expert#3 Neighbor’s dog True value 1 1 1 1/2 1/2 1 1/4 1/8 1/16 1 2 5 Who should we believe? Goal: Perform as well as the best expert 22

Predicting from Experts’ advice Initialize all weights to 1 Decrease weights on a mistake Take a weighted vote for prediction Can also choose an expert probabilistically using weights as probability distribution #mistakes < (1+) mexpert + O(log N) any  > 0 # of experts mistakes of best expert 23

Expert’s advice algorithm achieves a (1+) ratio wrt best expert That’s what we want for lists! – thinking of static lists as our experts 24

Applying Experts to lists? Goal: (1+) wrt best static list Experts analysis already does that! Use all static lists as experts! Assign weights according to costs incurred by experts After every access, pick next static list using the right probability Perform transpositions moving from one list to another Split into two slides 25

Applying Experts to lists? Use all static lists as experts! Can anyone see a problem with that? Too many lists! – exponential in number - n! Requires exponential running time per query – to update the weight of every static list Split into two slides 26

Experts for List Update Weight for every static list – too much computation The BIG idea Assign weights to every item in list and still make an experts style analysis work! 27

Candidate algorithm Initialize wi for item i If ith element accessed, update wi Order elements using some rule based on wi Need to analyze probability of getting a particular static list 28

Reality check… still awake? 29

Outline of the talk.. Rules of the game The algorithm Machine learning alg: Expert’s advice Apply Expert’s advice to list update Neat idea: List Factoring Algorithm for a two-element list Extend it to n-element list Extensions and Conclusions 30

Idea #2: List Factoring [Borodin ElYaniv] Under certain conditions: Ratio for two-element list holds for general list Only need to analyze two-element list Condition: The relative order of x and y in the list does not depend upon accesses to others Needs to be worked on 31

List Factoring – Move To Front 4 7 2 9 9 4 7 2 7 4 9 2 4 9 7 32

List Factoring – Move To Front 4 7 2 9 9 4 7 9 9 4 7 2 2 4 9 7 9 and 4 retain the same order – LFL applies Can analyze performance over second list 33

Algorithm for two element list List – (x,y) Experts – (x,y) and (y,x) weights – wx, wy – correspond to the respective experts! Algorithm: Initialize wx, wy to rx & ry R [1..1/] If x accessed, wx <- wx+1 else wy <- wy+1 Always keep the element with higher weight in front 34

Have – algorithm with (1+) ratio for 2- element list Need – Algorithm for n-element list - satisfying LFL 35

Efficient Experts algorithm for List Update Select ri R [1..1/] for element i Initialize wi <- ri If ith element accessed, wi <- wi+1 Order elements in decreasing order of weight Points to note: Random initialization  probabilistic picking of expert Enables us to satisfy LFL by using a deterministic rule for ordering 36

Efficient Experts algorithm for List Update b c d  = 0.1 2 4 9 7 37

Efficient Experts algorithm for List Update b  = 0.1 7 4 2 9 d(0) b c a d 7 4 2 10 Cost of experts per cycle = 6 Cost of Opt per cycle = 6 c(2) b c a d 7 5 2 10 b(3) b c a d 7 5 3 10 a(1) b c a d 8 5 3 10 38

Efficient Experts algorithm for List Update (1+) static competitive for any  > 0 “nearly optimal” [Kalai Vempala’02] give a similar result for trees 39

Outline of the talk.. Rules of the game The algorithm Extensions and Conclusions 40

Outline of the talk.. Rules of the game The algorithm Extensions and Conclusions Comparing our alg with “dynamic” algorithms Combining good static and dynamic algorithms Lessons to be learnt 41

Extensions Allowing Opt to move items between accesses Dynamic (as opposed to static) Comparing against “Dynamic” algorithms Our alg could be far worse than Dynamic Opt Previously known algorithms perform as well as a ratio of 1.6 42

Combining Static & Dynamic optimality A has constant static ratio, B has constant dynamic ratio Combine the two to get the best of both Apply Experts again Technical difficulties Cannot estimate weights – running both simultaneously defeats our purpose Experts maintain state - Huge cost of switching 43

Conclusions First ever application of Experts advice to online data structures Achieve a static ratio of (1+) Settles the list update problem – no better can be done Application to other online problems – Naïve application is quite computationally intensive – problem structure should be exploited Constant dynamic ratio for trees – still open! State more clearly – first app of experts, settles the question on lists, still open-trees 44

Questions? 45