Competitive analysis (online algorithm): Difference between revisions

Content deleted Content added
No edit summary
Line 7:
For example, the quicksort algorithm chooses one element, called the "pivot", that is, on average, not too far from the center value of the data being sorted. Quicksort then separates the data into two piles, one of which contains all elements with value less than the value of the pivot, and the other containing the rest of the elements. If quicksort chooses the pivot in some deterministic fashion (for instance, always choosing the first element in the list), then it is easy for an adversary to arrange the data beforehand so that quicksort will perform in worst-case time. If, however, quicksort chooses some random element to be the pivot, then an adversary without knowledge of what random numbers are coming up cannot arrange the data to guarantee worst-case execution time for quicksort.
 
The classic on-line problem first analysed with competitive analysis <ref>{{harv|Sleator|Tarjan|1985}}</ref> is the [[list update problem]]: Given a list of items and a sequence of requests for the various items, minimize the cost of accessing the list where the elements closer to the front of the list cost less to access. (Typically, the cost of accessing an item is equal to its position in the list.) After an access, the list may be rearranged. Most rearrangements have a cost. The ''Move-To-Front algorithm'' simply moves the requested item to the front after the access, at no cost. The ''Transpose algorithm'' swaps the accessed item with the item immediately before it, also at no cost. Classical methods of analysis showed that Transpose is optimal in certain contexts. In practice, Move-To-Front performed much better. Competitive analysis was used to show that an adversary can make Transpose perform arbitrarily badly compared to an optimal algorithm, whereas Move-To-Front can never be made to incur more than twice the cost of an optimal algorithm.
 
In the case of online requests from a server, competitive algorithms are used to overcome uncertainties about the future. That is, the algorithm does not "know" the future, while the imaginary adversary (the "competitor") "knows". Similarly, competitive algorithms were developed for distributed systems, where the algorithm has to react to a request arriving at one ___location, without "knowing" what has just happened in a remote ___location. <ref>This setting was presented in {{harv|Awerbuch|Kutten|Peleg|1992}}.</ref>
 
==See also==
Line 18:
* [[Online algorithm]]
 
==ReferencesFurther Reading==
*{{citation|title=Amortized efficiency of list update and paging rules|first1=D.|last1=Sleator|author1-link=Daniel Sleator|first2=R.|last2=Tarjan|author2-link=Robert Tarjan|journal=Communications of the ACM|year=1985|doi=10.1145/2786.2793|volume=28|issue=2|pages=202–208}}.
*{{citation|contribution=Competitive analysis of distributed algorithms|first=James|last=Aspnes|year=1998|doi=10.1007/BFb0029567|title=Online Algorithms: The State of the Art|series=Lecture Notes in Computer Science|volume=1442|pages=118–146|editor1-first=A.|editor1-last=Fiat|editor1-link=Amos Fiat|editor2-first=G. J.|editor2-last=Woeginger|editor2-link= Gerhard J. Woeginger}}.
*{{citation|last1=Borodin|first1=A.|author1-link=Allan Borodin|last2=El-Yaniv|first2=R.|year=1998|title=Online Computation and Competitive Analysis|publisher=Cambridge University Press|isbn=0-521-56392-5}}.
*{{citation|last1=Awerbuch|first1=B.|last2=Kutten|first2=S.|last3=Peleg|first3=d.|year=1992|contribution=Competitive Distributed Job Scheduling|title=ACM STOC, Victoria, BC, Canada}}.
 
==Notes==
<references/>
 
[[Category:Analysis of algorithms]]