Competitive Online Algorithms
- Competitive online algorithms are strategies that process inputs sequentially and irreversibly, with performance defined by the competitive ratio comparing to an optimal offline solution.
- They are applied in diverse domains such as online matching, packing, scheduling, and resource allocation, highlighting their practical significance in real-time decision making.
- Methodologies like primal-dual analysis and adaptive techniques are used to optimize these algorithms, achieving improved performance even under adversarial and dynamic conditions.
A competitive online algorithm is an algorithm that makes irrevocable decisions on a sequence of inputs arriving over time, without knowledge of future inputs, and whose performance is measured against an offline optimum with full foresight. The standard metric is the competitive ratio, defined as the supremum over all input sequences of the ratio (for minimization problems) or inverse ratio (for maximization problems) between the algorithm’s cost and the cost of the optimal offline solution. Competitive analysis has emerged as the foundational framework for online decision-making across a wide variety of domains, including online matching, packing, scheduling, finance, metrical task systems, resource allocation, submodular optimization, and optimization under switching costs, as well as models incorporating stochasticity, noisy prediction, and recourse.
1. Definition and General Principles
Let denote the (expected) cost or reward of an online algorithm ALG on input sequence , and the optimal offline cost or reward. For a minimization problem, ALG is called -competitive if there exists a constant such that
yielding a competitive ratio . For maximization problems, the direction of the inequality is reversed. This ratio captures the worst-case performance loss due to lack of future information. The adversary may be oblivious (adversarially selecting the input in advance) or adaptive (choosing future inputs based on the algorithm’s past actions).
Competitive analysis is universally applicable to causal, non-anticipatory rules in domains such as online bipartite matching (Huang et al., 2018, Fahrbach et al., 2020, Thang, 2021), inventory allocation (Ma et al., 2019), secretary problems (0807.1139), online knapsack (Cao et al., 2020), online set cover (Zeynali et al., 2020), metrical task systems (Zhai et al., 2019), dynamic queues (0802.1685), submodular maximization (Sadeghi et al., 2019), energy harvesting communications (Vaze, 2011), and online switching and memory-dependent control (Shi et al., 2020).
2. Competitive Ratios in Canonical Online Models
Matching and Assignment:
The celebrated online bipartite matching problem, where vertices arrive one at a time and must be irrevocably matched to available offline vertices, admits a tight randomized competitive ratio of $1-1/e$ via the Ranking algorithm in the unweighted case (Huang et al., 2018, Thang, 2021, Brubach et al., 2016). Generalizations yield lower bounds in more demanding models: in the fully online fractional model, and approximately $0.567$ for integral matching in the all-vertices-online setting (Huang et al., 2018). For online edge-weighted bipartite matching, the best known guarantee is a $0.5086$-competitive algorithm using negatively correlated online choices (OCS subroutine) (Fahrbach et al., 2020). In adversarial secretary variants under random arrival order, sample-and-price schemes are 8-competitive for edge-weighted matchings (0807.1139).
Packing and Trading:
In one-way trading (fractional packing under unknown prices), the optimal competitive ratio is , where is the ratio of maximal to minimal price, achieved by a threshold rule that posts a time-dependent price reservation (Cao et al., 2020, Kumar et al., 2012). Under an infinitesimal assumption, the same ratio is tight for online knapsack (Cao et al., 2020).
Resource-Allocation and Submodular Maximization:
Online resource allocation with monotone continuous DR-submodular objectives under linear packing constraints yields tight competitive ratios of (single constraint), extending classical LP bounds (Sadeghi et al., 2019). For online positive semidefinite (PSD) cone maximization (e.g., experiment design), primal-dual greedy algorithms can be systematically tuned using Loewner's theorem to match optimal competitive ratios for objectives such as D-optimality or A-optimality (Eghbali et al., 2018).
Switching and Energy:
Scheduling in metrical task systems with state-dependent switching costs (e.g., online energy plan selection, microgrid unit-commitment, or general convex hitting with memory) yields exact optimal competitive ratios: deterministic algorithms cannot beat 3, randomized algorithms cannot beat 2 in two-state systems (Zhai et al., 2019). Energy harvesting communication systems allow a trivial 2-competitive “lazy” policy, with lower bounds currently at $1.38$ (Vaze, 2011).
Stochastic Models:
In stochastic online matching (known IID or with random edge presence), non-adaptive algorithms attain a tight $1-1/e$ as the best possible (Brubach et al., 2016); in certain settings (unweighted, uniform success), strengthened LP-guides yield improved ratios above $1-1/e$.
Dynamic/Adaptive and Bounded Adversary Models:
When algorithms are permitted bounded recourse (rewinding previous assignments at a limited cost), as in online matching or orientation, the competitive ratio can be improved from to using to recourse (Ozdayi, 2020, Megow et al., 2020). In online-bounded analysis, an adversary restricted to keep up with the online algorithm on all prefixes yields strictly better bounds for locally greedy rules across scheduling and packing problems (Boyar et al., 2016).
3. Primal-Dual and Multilinear Methods
Competitive-ratio optimality is often established by primal-dual analysis, in which dual potentials or Lagrange multipliers are constructed in parallel