Shuchi Chawla, Carnegie Mellon University Static Optimality and Dynamic Search Optimality in Lists and Trees Avrim Blum Shuchi Chawla Adam Kalai 1/6/2002.

Slides:



Advertisements
Similar presentations
Introduction to Computer Science 2 Lecture 7: Extended binary trees
Advertisements

Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
The Dictionary ADT Definition A dictionary is an ordered or unordered list of key-element pairs, where keys are used to locate elements in the list. Example:
Fast Algorithms For Hierarchical Range Histogram Constructions
AVL Trees COL 106 Amit Kumar Shweta Agrawal Slide Courtesy : Douglas Wilhelm Harder, MMath, UWaterloo
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
Online Algorithms Amrinder Arora Permalink:
Online learning, minimizing regret, and combining expert advice
Games & Adversarial Search
Evaluation of Algorithms for the List Update Problem Suporn Pongnumkul R. Ravi Kedar Dhamdhere.
Self-Organizing Lists1 Self-Organizing Lists Competitive Analysis Lee Wee Sun SoC Modified by Orgad Keller Modified again by.
Convergent and Correct Message Passing Algorithms Nicholas Ruozzi and Sekhar Tatikonda Yale University TexPoint fonts used in EMF. Read the TexPoint manual.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
1 An Asymptotically Optimal Algorithm for the Max k-Armed Bandit Problem Matthew Streeter & Stephen Smith Carnegie Mellon University NESCAI, April
1 CS 430 / INFO 430 Information Retrieval Lecture 12 Probabilistic Information Retrieval.
Online Algorithms for Network Design Adam Meyerson UCLA.
Gene Regulatory Networks - the Boolean Approach Andrey Zhdanov Based on the papers by Tatsuya Akutsu et al and others.
Online Oblivious Routing Nikhil Bansal, Avrim Blum, Shuchi Chawla & Adam Meyerson Carnegie Mellon University 6/7/2003.
24-Jun-15 Pruning. 2 Exponential growth How many leaves are there in a complete binary tree of depth N? This is easy to demonstrate: Count “going left”
Dasgupta, Kalai & Monteleoni COLT 2005 Analysis of perceptron-based active learning Sanjoy Dasgupta, UCSD Adam Tauman Kalai, TTI-Chicago Claire Monteleoni,
E.G.M. Petrakissearching1 Searching  Find an element in a collection in the main memory or on the disk  collection: (K 1,I 1 ),(K 2,I 2 )…(K N,I N )
CSE 326: Data Structures Lecture #13 Extendible Hashing and Splay Trees Alon Halevy Spring Quarter 2001.
Evaluation of Algorithms for the List Update Problem Suporn Pongnumkul R. Ravi Kedar Dhamdhere.
Maximum Entropy Model LING 572 Fei Xia 02/07-02/09/06.
Games & Adversarial Search Chapter 6 Section 1 – 4.
E.G.M. PetrakisHashing1 Hashing on the Disk  Keys are stored in “disk pages” (“buckets”)  several records fit within one page  Retrieval:  find address.
. Approximate Inference Slides by Nir Friedman. When can we hope to approximate? Two situations: u Highly stochastic distributions “Far” evidence is discarded.
Binary search trees Definition Binary search trees and dynamic set operations Balanced binary search trees –Tree rotations –Red-black trees Move to front.
Maria-Florina Balcan A Theoretical Model for Learning from Labeled and Unlabeled Data Maria-Florina Balcan & Avrim Blum Carnegie Mellon University, Computer.
Experts and Boosting Algorithms. Experts: Motivation Given a set of experts –No prior information –No consistent behavior –Goal: Predict as the best expert.
E.G.M. PetrakisTrees in Main Memory1 Balanced BST  Balanced BSTs guarantee O(logN) performance at all times  the height or left and right sub-trees are.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 45 AVL Trees and Splay.
Commitment without Regrets: Online Learning in Stackelberg Security Games Nika Haghtalab Carnegie Mellon University Joint work with Maria-Florina Balcan,
Chapter 08 Binary Trees and Binary Search Trees © John Urrutia 2013, All Rights Reserved.
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue data structures.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Mike 66 Sept Succinct Data Structures: Techniques and Lower Bounds Ian Munro University of Waterloo Joint work with/ work of Arash Farzan, Alex Golynski,
Presented by Group 2: Presented by Group 2: Shan Gao ( ) Shan Gao ( ) Dayang Yu ( ) Dayang Yu ( ) Jiayu Zhou ( ) Jiayu Zhou.
Review Binary Tree Binary Tree Representation Array Representation Link List Representation Operations on Binary Trees Traversing Binary Trees Pre-Order.
Online Oblivious Routing Nikhil Bansal, Avrim Blum, Shuchi Chawla & Adam Meyerson Carnegie Mellon University 6/7/2003.
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.
A* Lasso for Learning a Sparse Bayesian Network Structure for Continuous Variances Jing Xiang & Seyoung Kim Bayesian Network Structure Learning X 1...
Interacting with Huge Hierarchies: Beyond Cone Trees Jeromy Carriere, Rick Kazman Computer Graphics Lab, Department of Computer Science University of Waterloo,
CS Data Structures Chapter 10 Search Structures.
TECH Computer Science Dynamic Sets and Searching Analysis Technique  Amortized Analysis // average cost of each operation in the worst case Dynamic Sets.
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
1 Splay trees (Sleator, Tarjan 1983). 2 Goal Support the same operations as previous search trees.
BLAST: Basic Local Alignment Search Tool Altschul et al. J. Mol Bio CS 466 Saurabh Sinha.
CE 221 Data Structures and Algorithms Chapter 4: Trees (Binary) Text: Read Weiss, §4.1 – 4.2 1Izmir University of Economics.
How the Experts Algorithm Can Help Solve LPs Online Marco Molinaro TU Delft Anupam Gupta Carnegie Mellon University.
AVL Trees 1. 2 Outline Background Define balance Maintaining balance within a tree –AVL trees –Difference of heights –Rotations to maintain balance.
1 Parameter Learning 2 Structure Learning 1: The good Graphical Models – Carlos Guestrin Carnegie Mellon University September 27 th, 2006 Readings:
Foundation of Computing Systems
Splay Trees and the Interleave Bound Brendan Lucier March 15, 2005 Summary of “Dynamic Optimality -- Almost” by Demaine et. Al., 2004.
Approximation Algorithms for Path-Planning Problems Nikhil Bansal, Avrim Blum, Shuchi Chawla and Adam Meyerson Carnegie Mellon University.
MA/CSSE 473 Days Optimal linked lists Optimal BSTs.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 18.
Shuchi Chawla, Carnegie Mellon University Guessing Secrets Efficiently Shuchi Chawla 1/23/2002.
Correlation Clustering
Self-Adjusting Search trees
Better Algorithms for Better Computers
Traveling Salesman Problems Motivated by Robot Navigation
Approximation Algorithms for Path-Planning Problems
CS b659: Intelligent Robotics
Profit Maximizing Mechanisms for the Multicasting Game
Advanced Algorithms Analysis and Design
Binary Search Tree (BST)
Static Optimality and Dynamic Search Optimality in Lists and Trees
Hidden Markov Models Part 2: Algorithms
326 Lecture 9 Henry Kautz Winter Quarter 2002
Presentation transcript:

Shuchi Chawla, Carnegie Mellon University Static Optimality and Dynamic Search Optimality in Lists and Trees Avrim Blum Shuchi Chawla Adam Kalai 1/6/2002

Shuchi Chawla, Carnegie Mellon University List Update Problem  Unordered list  Access for x i takes i time Query for element 9 = No = = = Yes

Shuchi Chawla, Carnegie Mellon University List Update Problem  Unordered list  Access for x i takes i time Query for element 9  Replacement cost = 0  Reorder cost = 1 per operation  What should the reordering policy be?

Shuchi Chawla, Carnegie Mellon University Binary Search Tree  “In-order” tree  Search cost = depth of element  Cost of rotations = 1 per operation  Replacement policy = ?

Shuchi Chawla, Carnegie Mellon University Binary Search Tree  “In-order” tree  Search cost = depth of element  Cost of rotations = 1 per operation  Replacement policy = ? Query for element 9

Shuchi Chawla, Carnegie Mellon University How good is a reordering algorithm?  Compare against the best “offline” algorithm  Dynamic competitive ratio  Best offline algorithm that cannot change state of the list/tree -- “static”  Static competitive ratio

Shuchi Chawla, Carnegie Mellon University Optimality  Cost of ALG is at most a constant factor times the cost of OPT  Dynamic optimality  Static optimality  Strong static optimality – the ratio is (1+  )  Search optimality – ignore our rotation cost

Shuchi Chawla, Carnegie Mellon University Known results..  List update Dynamic ratio [Albers et al’95, Teia’93] : u.b.- 1.6; l.b  Trees Splay trees [Sleator Tarjan 85] : static ratio ~ 3

Shuchi Chawla, Carnegie Mellon University Known results..  List update Dynamic ratio [Albers et al’95, Teia’93] : u.b.- 1.6; l.b  Trees Splay trees [Sleator Tarjan 85] : static ratio ~ 3  Open questions that we address  Strong static opt + dynamic opt for lists  Dynamic search opt for trees - ignoring computation time & rotation costs

Shuchi Chawla, Carnegie Mellon University Back to list update  How can we hope to achieve strong static optimality?  Soln: Use a classic machine learning result!! Experts Algorithm

Shuchi Chawla, Carnegie Mellon University Experts Algorithm [Littlestone’94]  N “expert” algorithms  We want to be (1+  ) wrt the best algorithm  Weighted Majority algorithm  Assign weights to each expert by how well it performs  Pick probabilistically according to weights  Applying this to list update  Each list configuration is an expert  Too many experts – n!  Can we reduce computation?

Shuchi Chawla, Carnegie Mellon University Experts for two element list  List – (x,y)  Experts – (x,y) and (y,x)  weights – w x, w y  Algorithm: 1.Initialize w x, w y to r x & r y  R [1..1/  ] 2.If x accessed, w x <- w x +1 else w y <- w y +1 3.Always keep the element with higher weight in front

Shuchi Chawla, Carnegie Mellon University List Factoring Lemma  Under a certain condition If A performs well on a list of two elements it performs well on any arbitrary list  Condition: For an arbitrary list, given the same accesses, A should order x and y just as in a list with only x & y

Shuchi Chawla, Carnegie Mellon University List Factoring Lemma  e.g. Move-to-front and 4 retain the same order – LFL applies

Shuchi Chawla, Carnegie Mellon University Extending experts to a general list  Select r i  R [1..1/  ] for element i  Initialize w i <- r i  If i th element accessed, w i <- w i +1  Order elements in decreasing order of weight  (1+  ) static competitive

Shuchi Chawla, Carnegie Mellon University Combining Static & Dynamic optimality  A has strong static optimality, B has dynamic optimality  Combine the two to get the best of both  Apply Experts again  Technical difficulties  Cannot estimate weights – running both simultaneously defeats our purpose  Huge cost of switching between experts Don’t switch very often

Shuchi Chawla, Carnegie Mellon University How to estimate weights?  The Bandits approach  Run the (so far) better expert  Assume good behavior from the other - Pessimistic approach  After a few runs, we have sampled each one sufficiently

Shuchi Chawla, Carnegie Mellon University Binary Search Trees Unfortunately similar “short-cuts” do not work

Shuchi Chawla, Carnegie Mellon University Why is BST harder?  Decide which nodes should be near the root  Decide how to move up those nodes Not straightforward 132 different ways of bringing a node at depth 7 to the root!!  We ignore the second issue try for Dynamic “search” optimality

Shuchi Chawla, Carnegie Mellon University Outline of our approach  Design a probability distribution p over accesses: Low offline cost => greater probability  Assume p reflects reality and predict the next access from it.  Construct tree based on conditional probability of next access  Low offline cost => node closer to root => low online cost

Shuchi Chawla, Carnegie Mellon University An observation about offline BSTs  An access sequence with offline cost k can be expressed in 12k bits  At most 2 12k sequences of offline cost k.

Shuchi Chawla, Carnegie Mellon University An observation about offline BSTs  An access sequence with offline cost k can be expressed in 12k bits  Start with a fixed tree  Express rotations from one tree to another using 6 bits per rotation  Assume algorithm first brings accessed element to root: extra factor of 2  At most 2 12k sequences of offline cost k.

Shuchi Chawla, Carnegie Mellon University An observation about offline BSTs  An access sequence with offline cost k can be expressed in 12k bits  At most 2 12k sequences of offline cost k.

Shuchi Chawla, Carnegie Mellon University  Identify rotated subtree (left,up,right,up)(Right,left,up,up)  Specify its initial & final position  Uniquely specifies rotations

Shuchi Chawla, Carnegie Mellon University An observation about offline BSTs  An access sequence with offline cost k can be expressed in 12k bits  Start with a fixed tree  Express rotations from one tree to another using 6 bits per rotation  Assume algorithm first brings accessed element to root: extra factor of 2  At most 2 12k sequences of offline cost k.

Shuchi Chawla, Carnegie Mellon University Probability distribution on accesses   Distribution on accesses a : p(a) = 2 -13k where k = offline cost of a  Use this to calculate probability of next access  Run through all offline algs, obtain cost, take a weighted average  Much like experts in flavor

Shuchi Chawla, Carnegie Mellon University Probability distribution on accesses   Distribution on accesses a : p(a) = 2 -13k where k = offline cost of a  Use this to calculate probability of next access  Caveat: computationally infeasible  But – dynamic search optimal !

Shuchi Chawla, Carnegie Mellon University What next?  Can we make this algorithm computationally feasible?  True dynamic optimality, strong static optimality for BST  Lessons to take home Experts analysis is a useful tool for data structures Generic algorithm too slow

Shuchi Chawla, Carnegie Mellon University Outline of our approach  Design a probability distribution p over accesses: Low offline cost => greater probability  Assume p reflects reality and predict the next access from it.  Construct tree based on conditional probability of next access  Low offline cost => node closer to root => low online cost