

The competitive ratio of an online problem is the best competitive ratio achieved by an online algorithm. 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. Competitive analysis formalizes this idea by comparing the relative performance of an online and offline algorithm for the same problem instance. Not every offline algorithm has an efficient online counterpart.īecause 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 focused on the quality of decision-making that is possible in this setting. If the ratio between the performance of an online algorithm and an optimal offline algorithm is bounded, the online algorithm is called competitive. For many problems, online algorithms cannot match the performance of offline algorithms. Note that the final result of an insertion sort is optimum, i.e., a correctly sorted list. Thus insertion sort is an online algorithm. On the other hand, insertion sort considers one input element per iteration and produces a partial solution without considering future elements. In operations research, the area in which online algorithms are developed is called online optimization.Īs an example, consider the sorting algorithms selection sort and insertion sort: selection sort repeatedly selects the minimum element from the unsorted remainder and places it at the front, which requires access to the entire input it is thus an offline algorithm. 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.
BCI 2000 WIKI OFFLINE ANALYSIS SERIAL
In computer science, an online algorithm is one that can process its input piece-by-piece in a serial fashion, i.e., in the order that the input is fed to the algorithm, without having the entire input available from the start. Algorithm that begins on possibly incomplete inputs
