Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 Online Algorithms By: Sean Keith

2 An online algorithm is an algorithm that receives its input over time, where knowledge of the entire input is not available from the start. This is different from offline algorithms, where the entire input is known when the algorithm commences. This lack of foresight forces us to solve a particular problem in a drastically different way. One good example of the difference between an online algorithm solution to an offline algorithm solution is that of simple sorting algorithms.

3 Example for Sorting Algorithms Offline: Selection SortOnline: Insertion Sort

4 Since online algorithms are not aware of their entire input, they may be forced to make decisions that later turn out not to be optimal, similar to how greedy algorithms function. Because of this, when it comes to analyzing online algorithms we need to look at minimizing the repeated steps or costs that differ from the optimal solution.

5 So how exactly do we analyze the performance of online algorithms? In general, there are three types of computational analysis that we can choose from: Competitive AnalysisAsymptotic AnalysisAmortized Analysis Competitive Ratio Time ComplexityWorst Case Scenario

6 Competitive Analysis For studying online algorithms, the competitive analysis strategy was designed for comparing the performance of an online algorithm to the performance of its optimal offline counterpart. This analysis is measured by the competitive ratio of the two algorithms. Competitive Ratio: how well an online algorithm performs for both "easy" and "hard" inputs compared to its optimal offline counterpart.

7 Competitive Analysis In other words, what is the difference in performance when our algorithm doesn't "know" the future, compared to its competitor who does "know" the future. This competitor is also known as an adversary, who influences the input to sway the competitive ratio in their favor. The competitive analysis is also very helpful for analyzing algorithms that were designed to execute in distributed systems, where input at one location can influence the decision making process at a different location where that input is not known.

8 1989 – Christos Papadimitriou and Mihalis Yannakakis

9 Summary We are given a graph where vertices represent cities and edges represent roads. However, some roads may become unsuitable for travel due to heavy snowfall.

10 We can only know a road is shut down when we reach one of the road's adjacent nodes or endpoints. At any given instance of the graph, there a number of realizations that show how the hidden graph is formed. A description of the best walk for travelling any given instance is known as a policy.

11 Our task is to minimize the competitive ratio of the total cost of traversing these policies or shortest paths. Note: we don't actually compute the short path, only the total cost of travelling it. The CTP is a generalization of a two-person game from the Game Theory branch of mathematics, where the two players are a searcher and a competitive adversary, who controls the weather to better maximize the competitive ratio.

12 Related Algorithms Travelling Salesman Problem - similar problem, however the CTP is much more closely related to the Shortest Path Problem. This is mainly because the Travelling Salesman Problem is NP-Hard whereas the CTP and SSP are polynomial time algorithms. Shortest Path Problem - however in the CTP the graph is only partially observable. The CTP also significantly differs from the SPP because the walk may not be a path; the better choice may be to perform a cycle instead.

13 Algorithm

14

15 To summarize, we compute the cost of a policy based on the sets of edges E (edges we know are in the graph) and F(edges that might be in the graph). When we travel to a new city, the new edges we discover are added to E and are removed from F. If we never reach our goal, we return an infinite cost, otherwise we return the cost of the walk, which is the sum of the all edge costs we travelled on.

16 Complexity PSPACE-complete -> all edge lengths are polynomially bounded #P - Hard complexity -> depending on distance already travelled by the searcher, the adversary can choose inputs that create a distance length L that the searcher is forced to use that is longer than the shortest path. #P vs NP -> "how many" rather than "are there any"

17 Conclusions Applications: operations research, machine learning, and even artificial intelligence Open Problems: Is there a constant-factor approximation or is it APX-hard? Is there a polynomial-size description of an optimal policy?

18 References Shortest paths without a map - Papadimitriou, Yannakakis 1989 - http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.31 8.7223&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.31 8.7223&rep=rep1&type=pdf Randomized Algorithms - Motwani, Raghavan - 1995 - Ch. 13 http://en.wikipedia.org/wiki/Canadian_traveller_problem http://en.wikipedia.org/wiki/Competitive_analysis_%28onli ne_algorithm%29 http://en.wikipedia.org/wiki/Online_algorithm


Download ppt "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."

Similar presentations


Ads by Google