Sunteți pe pagina 1din 18

Online Algorithms

Morteza Alamgir Advance Algorithms

Motivation

till now, our algorithms start with input, work with it


suppose input arrives a little at a time, need instant response

eg stock market, paging

question: what is a good algorithm? problem isnt to decide fast, rather what to decide.

Applications

Resource Allocation

Scheduling Memory Management Routing Exploring an unknown terrain Finding a destination

Robot Motion Planning


Computational Finance

Methods of Analysis

Competitive Analysis (Worst Case)

For any input, the cost of our online algorithm is never worse than c times the cost of the optimal offline algorithm.

Pros: can make very robust statements about the performance of a strategy.
Cons: results tend to be pessimistic.

Methods of Analysis

Probabilistic Analysis

Assume a distribution generating the input. Find an algorithm which minimizes the expected cost of the algorithm.

Pros: can incorporate information predicting the future. Cons: can be difficult to determine probability distributions accurately.

Competitive Analysis

if knew whole input in advance, easy to optimize( ) C MIN


compare to full knowledge optimum k-competitive if for all sequences : sometimes, to ignore edge effects

Paging problem

Maintain a two level memory system, consisting of a small fast memory and a large slow memory
The goal is to serve a sequence of requests to memory pages so as to minimize number of page faults. LRU, FIFO, LIFO, Least freq use LIFO, LFU not competititive LRU, FIFO k-competitive. Theorem: no deterministic online algorithm can be better than k-competitive

Online Scheduling problem

We are given a set of m machines. A sequence of jobs arrives online. Each job has a processing time that may or may not be known in advance. Each job must be scheduled immediately on one of m machines without knowledge of any future jobs.

The goal is to optimize a given objective function

The must basic scheduling problem was introduced in 1966


m identical machine The processing time of a new job is known

The goal is to minimize the completion time of the last job

Graham showed that the List Scheduling Algorithm is (2-1/m) competitive

Online Scheduling problem


In 1992 bartal gave an 1.986-competitive


Karger in 1996 generalized the algorithm and proved an upper bound of 1.945 The best algorithm known so far achieved a 1.923 competitive ration Many variants of basic problem is studied:

Jobs may be preempted

Jobs may be rejected at a penalty


Online algorithms may use randomization In addition they are results for different machine types

Online load balancing

We have again a set of m machines and a sequence of jobs Each job has a weight and a duration that may be or may not be known in advance The load of a machine is some of weights of jobs present on the machine at that time The goal is to minimize the maximum load that occur during the processing of the job sequence For settings on m identical machine Azar and Epstein showed that greedy algorithm is (2-1/m) competitive Load balancing become more complicated with restricted assignments when each jab can only be assigned to a subset of admissible machines

Network routing problems

These problems were studied starting from the virtual circuit routing problem A communication network with every link has a given max capacity The input instance is formed by a seq. of communication request. For each request we must establish a virtual circuit on a path connecting two nodes of the network at a given bandwidth for a given duration Aspnes gave an O(log n)-competitive algorithm for the problem of minimizing the maximum load on a link of a network of n nodes when connection requests have unlimited duration The v.c.r problem has also been studied in its throughput version, the so called call control problem

Randomized Online Algorithms

An online algorithm is a two player zero sum game between algorithm and adversary. Well known that optimal strategies require randomization
A randomized online algorithm is a probability distribution over deterministic online algorithms Algorithm is k-competitive if for any

Restricting an adversary

Competitive analysis is a strong worst-case performance measure For some problems, such as paging, the competitive ratios of online algorithms are much higher than practice.

A line of research is concerned with evaluating online algorithms on restricted classes of request sequences.
In other words, the power of an adversary is limited Statistical adversary: The input generated by the adversary must satisfy certain statistical assumptions Diffuse adversary model : an adversary must generate an input according to a probability distribution D that belongs to a class of possible distributions known to the online algorithm.

Online Algorithms in machine learning

The areas of Online Algorithms and Machine Learning are both concerned with problems of making decisions about the present based only on knowledge of the past.

Predicting from Expert Advice

Goal: predicting whether or not it will rain that day


Input: the advice of n experts Each day, each expert predicts yes or no the learning algorithm must use this information in order to make its own prediction Suppose we make no assumptions about the quality or independence of the experts

Online Learning from examples

There is an example space

0 typically,1n

Learning proceeds as a sequence of trials.


x In each trial, an example X is presented to the learning algorithm. The algorithm then predicts either 1 or 0 l 0,1

finally the algorithm is told the true label The algorithm is penalized for each mistake made Our goal is to make as few mistakes as possible.

Streaming Algorithms

In solving the problem, we only have a limited amount of storage


Streaming Algorithms for Line Simplification:

Line Simplification Problem: we are getting a possibly infinite sequence of points p0, p1, p2, . . . defining a polygonal path, and as we receive the points we wish to maintain a simplification of the path seen so far.

Any Question?

S-ar putea să vă placă și