Online Algorithm - Wikipedia
Online Algorithm - Wikipedia
Contribute In contrast, an offline algorithm is given the whole problem data from the beginning and is required to output an answer which solves the problem at hand. In operations
Help research, the area in which online algorithms are developed is called online optimization.
Learn to edit As an example, consider the sorting algorithms selection sort and insertion sort: selection sort repeatedly selects the minimum element from the unsorted remainder and places
Community portal
it at the front, which requires access to the entire input; it is thus an offline algorithm. On the other hand, insertion sort considers one input element per iteration and produces a
Recent changes
partial solution without considering future elements. Thus insertion sort is an online algorithm.
Upload file
Note that the final result of an insertion sort is optimum, i.e., a correctly sorted list. For many problems, online algorithms cannot match the performance of offline algorithms. If
Tools
the ratio between the performance of an online algorithm and an optimal offline algorithm is bounded, the online algorithm is called competitive.[1]
What links here
Related changes Not every offline algorithm has an efficient online counterpart.
Special pages
Permanent link
Contents [hide]
Page information 1 Definition
Cite this page 1.1 Other interpretations
Wikidata item
1.2 Examples
Print/export
2 Online problems
3 See also
Download as PDF
Printable version 4 References
5 External links
Languages
اﻟﻌﺮﺑﻴﺔ
Deutsch Definition [ edit ]
ﻓﺎر
Because it does not know the whole input, an online algorithm is forced to make decisions that may later turn out not to be optimal, and the study of online algorithms has
Français
focused on the quality of decision-making that is possible in this setting. Competitive analysis formalizes this idea by comparing the relative performance of an online and
한국어
Italiano offline algorithm for the same problem instance. Specifically, the competitive ratio of an algorithm, is defined as the worst-case ratio of its cost divided by the optimal cost, over
⽇本語 all possible inputs. The competitive ratio of an online problem is the best competitive ratio achieved by an online algorithm. Intuitively, the competitive ratio of an algorithm gives
Tiếng Việt a measure on the quality of solutions produced by this algorithm, while the competitive ratio of a problem shows the importance of knowing the future for this problem.
中文
Other interpretations [ edit ]
6 more
For other points of view on online inputs to algorithms, see
Edit links
streaming algorithm: focusing on the amount of memory needed to accurately represent past inputs;
dynamic algorithm: focusing on the time complexity of maintaining solutions to problems with online inputs.
Examples [ edit ]
Insertion sort
Perceptron
Reservoir sampling
Greedy algorithm
Adversary model
Metrical task systems
Odds algorithm
Page replacement algorithm
Algorithms for calculating variance
Ukkonen's algorithm
A problem exemplifying the concepts of online algorithms is the Canadian Traveller Problem. The goal of this problem is to minimize the cost of reaching a target in a weighted
graph where some of the edges are unreliable and may have been removed from the graph. However, that an edge has been removed (failed) is only revealed to the traveller
when she/he reaches one of the edge's endpoints. The worst case for this problem is simply that all of the unreliable edges fail and the problem reduces to the usual Shortest
Path Problem. An alternative analysis of the problem can be made with the help of competitive analysis. For this method of analysis, the offline algorithm knows in advance
which edges will fail and the goal is to minimize the ratio between the online and offline algorithms' performance. This problem is PSPACE-complete.
There are many formal problems that offer more than one online algorithm as solution:
k-server problem
Job shop scheduling problem
List update problem
Bandit problem
Secretary problem
Search games
Ski rental problem
Linear search problem
Portfolio selection problem[2]
Dynamic algorithm
Streaming algorithm
Simple API for XML
Real-time computing
Sequential algorithm
Online machine learning/Offline learning
References [ edit ]
1. ^ a b Karp, Richard M. (1992). "On-line algorithms versus off-line algorithms: How much is it worth to know the future?" (PDF). IFIP Congress (1). 12: 416–429. Retrieved 17 August
2015.
2. ^ Dochow, Robert (2016). Online Algorithms for the Portfolio Selection Problem . Springer Gabler.
Borodin, A.; El-Yaniv, R. (1998). Online Computation and Competitive Analysis . Cambridge University Press. ISBN 0-521-56392-5.
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered
trademark of the Wikimedia Foundation, Inc., a non-profit organization.
Privacy policy About Wikipedia Disclaimers Contact Wikipedia Mobile view Developers Statistics Cookie statement