1 Online algorithms Typically when we solve problems and design algorithms we assume that we know all the data a priori. However in many practical situations.

Slides:



Advertisements
Similar presentations
A Primal-Dual Approach to Online Optimization Problems.
Advertisements

6.896: Topics in Algorithmic Game Theory Lecture 21 Yang Cai.
Approximation algorithms for geometric intersection graphs.
Introduction to Algorithms NP-Complete
Great Theoretical Ideas in Computer Science
NP-Hard Nattee Niparnan.
Online Learning for Online Pricing Problems Maria Florina Balcan.
Covers, Dominations, Independent Sets and Matchings AmirHossein Bayegan Amirkabir University of Technology.
Linear Programming (LP) (Chap.29)
Naveen Garg, CSE, IIT Delhi
Great Theoretical Ideas in Computer Science for Some.
1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
Ad Auctions: An Algorithmic Perspective Amin Saberi Stanford University Joint work with A. Mehta, U.Vazirani, and V. Vazirani.
Mining of Massive Datasets Jure Leskovec, Anand Rajaraman, Jeff Ullman Stanford University Note to other teachers and users of these.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Point-and-Line Problems. Introduction Sometimes we can find an exisiting algorithm that fits our problem, however, it is more likely that we will have.
From the marriage problem to sailor assignment and Google AdWords problems G. Hernandez UofM / UNAL Colombia MATCHING PROBLEMS OLD AND NEW: Based on: “The.
Train DEPOT PROBLEM USING PERMUTATION GRAPHS
Great Theoretical Ideas in Computer Science.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
CS 345 Data Mining Online algorithms Search advertising.
1 Ecole Polytechnque, Nov 7, 2007 Scheduling Unit Jobs to Maximize Throughput Jobs:  all have processing time (length) = 1  release time r j  deadline.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
Online Algorithms Motivation and Definitions Paging Problem Competitive Analysis Online Load Balancing.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
CS 345 Data Mining Online algorithms Search advertising.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Evaluation of Algorithms for the List Update Problem Suporn Pongnumkul R. Ravi Kedar Dhamdhere.
1 Introduction to Approximation Algorithms Lecture 15: Mar 5.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
Lecture 2 Geometric Algorithms. A B C D E F G H I J K L M N O P Sedgewick Sample Points.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Approximation Algorithms for NP-hard Combinatorial Problems Magnús M. Halldórsson Reykjavik University
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Randomized Online Algorithm for Minimum Metric Bipartite Matching Adam Meyerson UCLA.
Chapter 15 Approximation Algorithm Introduction Basic Definition Difference Bounds Relative Performance Bounds Polynomial approximation Schemes Fully Polynomial.
Online Algorithms By: Sean Keith. An online algorithm is an algorithm that receives its input over time, where knowledge of the entire input is not available.
Algorithmic Game Theory and Internet Computing Vijay V. Vazirani Polynomial Time Algorithms For Market Equilibria.
1 Online algorithms Typically when we solve problems and design algorithms we assume that we know all the data a priori. However in many practical situations.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
1/24 Introduction to Graphs. 2/24 Graph Definition Graph : consists of vertices and edges. Each edge must start and end at a vertex. Graph G = (V, E)
Bipartite Matching. Unweighted Bipartite Matching.
Implicit Hitting Set Problems Richard M. Karp Erick Moreno Centeno DIMACS 20 th Anniversary.
Matching Lecture 19: Nov 23.
CS425: Algorithms for Web Scale Data Most of the slides are from the Mining of Massive Datasets book. These slides have been modified for CS425. The original.
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
Graph Algorithms Maximum Flow - Best algorithms [Adapted from R.Solis-Oba]
CSCI 256 Data Structures and Algorithm Analysis Lecture 2 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
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.
Non-LP-Based Approximation Algorithms Fabrizio Grandoni IDSIA
Approximation Algorithms based on linear programming.
Ariel Fuxman, Panayiotis Tsaparas, Kannan Achan, Rakesh Agrawal (2008) - Akanksha Saxena 1.
Analysis of Massive Data Sets Prof. dr. sc. Siniša Srbljić Doc. dr. sc. Dejan Škvorc Doc. dr. sc. Ante Đerek Faculty of Electrical Engineering and Computing.
On the Ability of Graph Coloring Heuristics to Find Substructures in Social Networks David Chalupa By, Tejaswini Nallagatla.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
More NP-Complete and NP-hard Problems
Computational Advertising
Chapter 10 Iterative Improvement
AdWords and Generalized On-line Matching
Maximum Matching in the Online Batch-Arrival Model
Maximum Flow - Best algorithms
Great Theoretical Ideas in Computer Science
Cloud Computing Group 7.
The Taxi Scheduling Problem
ICS 353: Design and Analysis of Algorithms
Online algorithms Search advertising
Computational Advertising and
Presentation transcript:

1 Online algorithms Typically when we solve problems and design algorithms we assume that we know all the data a priori. However in many practical situations this may not be true and rather than have the input in advance it may be presented to us as we proceed. Input is revealed to the algorithm incrementally Output is produced incrementally Some output must be produced before the entire input is known to the algorithm Decision making under partial information Unknown information: the future

2 Applications Resource Allocation Scheduling Memory Management Robot Motion Planning Exploring an unknown terrain Finding a destination Computational Finance

3 Methods of Analysis Definition An online algorithm A is R-competitive if for all input sequences I, A(I) ≤ROPT(I), where A(I) is the cost of the online strategy A for I and OPT(I) is the cost of the optimal offline algorithm for I. In many cases the definition of competitiveness is slightly relaxed by imposing that A(I) ≤ROPT(I)+c for some constant c independent of I.

4 Ski Rental Problem you are a skier and each day need to either rent skis for $1 or buy a pair of skis for $T which will last for the rest of the season. Unfortunately you do not know when the ski season will end. If you knew a priori the length of the season (this is the online case) say L then it is obvious that you should rent if L<T and buy if L≥T. On the other hand, an online strategy for this problem would first fix an integer k and then rent for k days and buy on day k+1 if it has the opportunity.

5 One strategy is to buy on the first day. This strategy is T-competitive and the worst input sequence is obtained when L=1. Another online strategy is to rent for the first T-1 days and then buy. If L<T the cost of the online and optimal offline strategy is the same. If L≥T the cost of the online strategy is 2T-1 and the cost of the optimal offline strategy is T. Hence this algorithm is (2-1/T)- competitive and it is fairly easy to show that it is the optimal online algorithm.

6 The Online Transportation Problem 5 miles 2 miles 3 miles 4 miles 2 miles

7 The Online Transportation Problem Given: a set of hospitals, each with a different sized ambulance fleet emergency sites that arise in unpredictable locations over time, each in immediate need of an ambulance Return: an assignment of ambulances to emergencies that minimizes the total distance traveled by all the ambulances

8 Why Greedy can be Bad Consider A, a large hospital with a dozen available ambulances, and B, a small hospital with only 2 ambulances. Imagine an emergency breaks out between A and B, but a bit closer to B. A B 10 miles 9 miles

9 Why Greedy can be Bad Since B is closer, we dispatch an ambulance from B. But what if two emergencies then break out on the other side of B from A? This solution costs 31 miles! A B 9 miles A 20 miles 2 miles

10 Why Greedy can be Bad If instead we chose hospital A for the first emergency, then used the ambulances at hospital B for the second and third......the distance traveled is much less! A B 2 miles A 10 miles 2 miles

11 Online Matching Problem Definition 9.14 Given an undirected graph G = (V, E), a matching is a subset of edges M E such that for all vertices v ∈ V, at most one edge of M is incident on v. We say that a vertex v ∈ V is matched by matching M if some edge in M is incident on v; otherwise, v is unmatched. A maximum matching is a matching of maximum cardinality. Definition 9.15 Perfect matching is one in which every vertex in V is matched Maximum weight matching:Matching in a weighted graph in which the sum of the weights of its edges is maximum.

12 Bipartite Graph Graph G = ( L  R, E) with L  R = , namely A graph is bipartite if its vertex set can be partitioned into two subsets L and R so that each edge has one endpoint in L and the other endpoint in R.

Intuition Let the left set of vertices be men Let the right set of vertices be women Suppose each edge represents a pair of man and woman who like each other Maximum matching tries to maximize the number of couples!

Online Bipartite matching problem A matchmaker and n boys are gathered in a room. n girls appear, one at a time. Each girl has a list of boys who are acceptable to her, which she reveals to the matchmaker as she appears. The matchmaker immediately matches the new girl to one of the boys on her list, if any of them are available. The goal is to maximize the number of matches. 14

Online bipartite matching V (boys) U (girls)

Online bipartite matching V (boys) U (girls)

Online bipartite matching V (boys) U (girls)

Online bipartite matching V (boys) U (girls)

Online bipartite matching V (boys) U (girls)

Online bipartite matching V (boys) U (girls)

Online bipartite matching V (boys) U (girls)

Adwords Problem Created by search engine companies Google Yahoo! MSN Multi-billion dollar market Totally revolutionized advertising, especially by small companies.

Monika Henzinger, 2004: Find an on-line algorithm that maximizes Google’s revenue.

The Adwords Problem: N advertisers; Daily Budgets B 1, B 2, …, B N Each advertiser provides bids for keywords he is interested in. Search Engine

The Adwords Problem: N advertisers; Daily Budgets B 1, B 2, …, B N Each advertiser provides bids for keywords he is interested in. Search Engine queries (online)

The Adwords Problem: N advertisers; Daily Budgets B 1, B 2, …, B N Each advertiser provides bids for keywords he is interested in. Search Engine Select one Ad Advertiser pays his bid queries (online)

The Adwords Problem: N advertisers; Daily Budgets B 1, B 2, …, B N Each advertiser provides bids for keywords he is interested in. Search Engine Select one Ad Advertiser pays his bid queries (online) Maximize total revenue Online competitive analysis - compare with best offline allocation

The Adwords Problem: N advertisers; Daily Budgets B 1, B 2, …, B N Each advertiser provides bids for keywords he is interested in. Search Engine Select one Ad Advertiser pays his bid queries (online) Maximize total revenue Example – Assign to highest bidder: only ½ the offline revenue

Example: $1$0.99 $1 $0 Book CD Bidder1Bidder 2 B1 = B2 = $100 Queries: 100 Books then 100 CDs Bidder 1 Bidder 2 Algorithm Greedy LOST Revenue 100$

Example: $1$0.99 $1 $0 Book CD Bidder1Bidder 2 B1 = B2 = $100 Queries: 100 Books then 100 CDs Bidder 1 Bidder 2 Optimal Allocation Revenue 199$

Generalizes online bipartite matching Each daily budget is $1, and each bid is $0/1.

32 Challenges Faced Intuition: A good algorithm must find a balance between distance of an emergency from the hospitals and the resources remaining at each hospital. Negative Results: Such balancing is not possible. The competitive ratio of every deterministic online algorithm is bad (linear in the number of hospitals). Random online algorithm.