What does Ologlogn-competitive mean?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
In competitive analysis of online algorithms, we measure how well an algorithm performs compared to an optimal offline algorithm that has complete knowledge of the future. The competitive ratio quantifies this gap. When an algorithm is described as -competitive, it means the ratio between the online algorithm's cost and the optimal cost grows extremely slowly with input size. This article explains what competitive ratios are, why is significant, and where such bounds appear in practice.
Understanding Competitive Ratios
In online algorithms, decisions must be made step by step without knowing future inputs. The competitive ratio, denoted , is defined as:
where:
- is the cost of the online algorithm on input sequence
- is the cost of the optimal offline algorithm on the same input
The maximum is taken over all possible input sequences. An algorithm with competitive ratio guarantees that its cost is at most times the optimal cost, no matter what input it receives.
A competitive ratio of (constant) is ideal: it means the online algorithm is always within a fixed factor of optimal. Ratios of or mean the gap grows with input size, but very slowly.
What Does Mean?
The double logarithm grows extraordinarily slowly. To appreciate just how slowly, consider these values (using base-2 logarithms):
| 16 | 4 | 2 |
| 256 | 8 | 3 |
| 65,536 | 16 | 4 |
| (about 1 million) | 20 | 4.32 |
| (about 4 billion) | 32 | 5 |
Even for in the billions, is only around 5. This means an -competitive algorithm performs almost as well as the optimal solution for any practical input size.
Competitive Ratio Hierarchy
To put in context, here is the hierarchy from best to worst:
| Competitive Ratio | Growth Rate | Interpretation |
| Constant | Within a fixed factor of optimal | |
| Double logarithmic | Nearly optimal for all practical sizes | |
| Logarithmic | Slowly growing gap | |
| Sub-linear | Moderate gap | |
| Linear | Gap proportional to input size |
Where Do Bounds Appear?
Online Set Cover
In the online set cover problem, elements arrive one at a time and the algorithm must cover each new element by selecting a set from a collection. Certain randomized algorithms achieve -competitive ratios when the set system has bounded frequency.
Metrical Task Systems
For metrical task systems on specific metric spaces, algorithms exist that achieve competitive ratios involving iterated logarithms, closely related to .
Competitive Caching with Resource Augmentation
Standard online caching (paging) has a competitive ratio of where is the cache size. With slight resource augmentation (giving the online algorithm a slightly larger cache than the optimal solution), the competitive ratio can drop to or even .
Practical Significance
An -competitive algorithm is essentially saying: "For any input you could realistically encounter, I will be within a small constant factor of the best possible solution." Since for , the practical performance gap is negligible in most real-world systems. This makes such algorithms very attractive, despite being theoretically non-constant.
Comparison with Related Bounds
It is worth distinguishing competitive ratio from time complexity. An algorithm could have:
- time complexity (how long it takes to run)
- competitive ratio (how close its solution is to optimal)
These are independent properties. A fast algorithm can have a poor competitive ratio, and a slow algorithm can have an excellent competitive ratio.
Summary
An -competitive algorithm guarantees that its cost is at most times the optimal offline solution's cost. Because grows so slowly, this bound is nearly as good as a constant competitive ratio for all practical purposes. Such bounds appear in online set cover, metrical task systems, and resource-augmented caching. Understanding competitive ratios is essential for evaluating online algorithms where decisions must be made without knowledge of future inputs.

