betaFeedback

WorksComputer Science

Constrained Online Selection with Predictions: Matroid Secretary, Knapsack, and Matching

Abstract

We study learning-augmented algorithms for constrained online selection problems, including the secretary problem under matroid and knapsack constraints, and the edge-weighted online bipartite matching problem with random vertex arrivals. In each, items arrive in a uniformly random order, and their values are revealed only on arrival. The goal is to select a set of items with nearly maximum total value, subject to the constraints (matroid, knapsack, or matching). In the learning-augmented setting, item value predictions are given in advance. We seek algorithms that are both consistent, in that accurate predictions lead to near-optimal selection, and robust, in that they obtain strong worst-case bounds even when predictions are inaccurate. Building on work of Fujii and Yoshida (2024) on the learning-augmented secretary problem, we study a method that follows the predicted optimum until an item with a large enough prediction error is observed. At that point, it reverts to running a worst-case competitive algorithm. We make a simple but critical modification: the first item with a large prediction error is selected with a carefully chosen probability. With this modification, we prove a general result, showing that if the underlying worst-case algorithm is αα-competitive for α∈(0,1]α\in(0,1], this approach achieves competitive ratio max⁡{α2(1+α),1−ε1+ε}\max\{\fracα{2(1+α)},\frac{1-ε}{1+ε}\}, where εε is the maximum relative error of any prediction. That is, the algorithm is perfectly consistent, achieving competitive ratio 11 as ε→0ε\to 0, and robust up to a constant factor relative to the worst-case baseline. For all three problems we study, α=1/eα= 1/e, and our result is the first to achieve consistency and constant-factor robustness. We hope that our general analysis framework can be applied to other learning-augmented online decision-making problems.

Introduction

Online algorithm design attempts to understand how a decision-maker can process a stream of inputs in an incremental fashion, while still making decisions that are nearly as good as if they knew all inputs ahead of time [12, 2]. Online decision-making arises, e.g., in hiring, where an organization must interview candidates one-by-one and decide to make job offers before seeing all possible candidates [19, 24, 23]. It similarly arises in scheduling, where decisions must be made about how to serve requests as they come in, without the ability to see future requests [27]. Other application areas include buying and selling assets with changing prices [20], allocating internet advertising space [41], assigning patients to treatment/control groups in clinical trials (Villar et al., 2015), and beyond [2].

Classic worst-case analysis typically assumes that the decision-maker has no knowledge of inputs that have not been seen yet, and aims to develop algorithms with strong guarantees despite this difficulty. However, in many applications, this assumption is too pessimistic: the decision-maker often does have some information about future inputs. E.g., in applications to hiring, they may have estimates of candidate abilities from resumes, portfolios, or references, before conducting interviews. In applications to scheduling, load balancing, or pricing, they may be able to predict statistics about future input sequences using past observations.

Significant work attempts to understand how this noisy information about future inputs can be leveraged to improve outcomes. For example, work on prophet inequalities considers the setting where future inputs are drawn independently from known distributions [36, 44]; see [28, 38, 14] for surveys. Work on learning-augmented algorithms takes a more worst-case view. The goal is to design algorithms that are both (1) consistent, in that they achieve near-optimal outcomes when predictions about future inputs are accurate and (2) robust, in that they achieve non-trivial guarantees even when the information about future inputs is arbitrarily inaccurate. In recent years, significant work has studied learning-augmented algorithms for online decision-making problems, including caching [39], scheduling [43], metrical task systems [3], purchasing problems like one-way trading [48], and selection problems, like the secretary problem [4, 18, 25].

Problem Setup and Existing Results

In this work, we study several closely related learning-augmented online selection problems, including the secretary problem under general matroid and knapsack constraints and the edge-weighted online bipartite matching problem with random vertex arrivals. For simplicity of exposition, in the introduction, we primarily focus on the secretary problem under general matroid constraints.

Problem 1.1 (Learning-Augmented Matroid Secretary). The learning-augmented matroid secretary problem is defined as follows:

  • There are nn items indexed by the integers [n]={1,…,n}[n] = \{1,\ldots,n\}, with unknown positive values v1,…,vnv_1,\ldots,v_n. Each item corresponds to an element of a known matroid MM.

  • The goal is to select a set S⊆[n]S \subseteq[n] that maximizes the total value ∑i∈Svi\sum_{i \in S} v_i subject to SS being an independent set of MM.

  • The items are assigned uniform and independent random arrival times t1,…,tn∼Unif⁡[0,1]t_1,\ldots,t_n \sim\operatorname{Unif}[0,1], and are processed in increasing order of arrival time.1

  • When an item ii arrives, the decision-maker observes its value viv_i, and must irrevocably decide to add ii to the output set (assuming doing so is feasible) or reject it.

  • The decision-maker is given positive predicted values v^1,…,v^n\hat{v}_1,\ldots,\hat{v}_n for each item ahead of time. There are no guarantees on the accuracies or distributions of these predictions.

The matroid secretary problem has been heavily studied in the online algorithms literature [6, 8, 42, 47, 31, 17, 37, 22, 10]; see [17] for a survey. If the independent sets of MM are exactly the sets of size at most one, we have the classic secretary problem [23]. If they are exactly the sets of size at most kk, we have the kk-secretary problem [34]. Other matroids arise in many natural applications of online selection. E.g., hiring candidates subject to quotas for a set of job categories corresponds to a partition matroid constraint; allocating goods to bidders with different preference sets leads to transversal matroid constraints; assigning passengers to airline routes subject to capacity constraints leads to gammoid constraints, and beyond [6, 7].

In the worst-case setting, the matroid secretary conjecture of Babaioff et al. [6], that a constant-competitive algorithm exists for general matroids, was recently resolved by Singla [46], and subsequently the optimal competitive ratio of 1/e1/e has been obtained [30, 1].

A related natural variant of the secretary problem is knapsack secretary [5], where each item has a known weight wiw_i and the selected set SS must satisfy ∑i∈Swi≤1\sum_{i\in S} w_i \le1. See Problem 2.1. This models settings where a decision-maker with a fixed budget must choose among options with different costs, such as hiring workers, procuring crowdsourcing services, or bidding for sponsored search ad slots [5, 9, 49]. We will consider its fractional version [26, 35], where the decision-maker chooses a fractional allocation xi∈[0,1]x_i \in[0,1] for each item, attempting to maximize ∑i∈[n]xivi\sum_{i\in[n]} x_i v_i subject to ∑i∈[n]xiwi≤1\sum_{i\in[n]} x_i w_i \le1.

Finally, we consider an online matching variant in which each element is an edge of a bipartite graph. Vertices on one side of the partition are known in advance, while vertices on the other arrive in a uniform random order. When a vertex arrives, the decision-maker learns the values of all its incident edges, and must irrevocably decide whether to add one of them to the selected set SS, subject to SS being a matching [33]. See Problem 2.2. Online matching is widely applied, e.g., in online advertising, where the offline vertices are advertisers, the arriving vertices are search queries or ad impressions, and edge values capture the value of showing a given ad in response to a query [41, 21, 40]. The problem can also model, e.g., assigning arriving workers to tasks in crowdsourcing markets [29] and arriving ride requests to drivers in ride-sharing platforms [15].

Existing Results. For all the above problems, in the prediction-free setting, worst-case algorithms (some very recently developed) are known that achieve competitive ratio 1/e1/e—i.e., the expected total value output by the algorithm is at least a 1/e1/e fraction of the offline optimal solution [1, 35, 33]. Further, for all problems, this bound is known to be tight. However, our understanding in the learning-augmented setting is much more limited.

Fujii and Yoshida [25] consider the special cases of Problem 1.1 corresponding to the classic secretary and kk-secretary variants. For the classic secretary problem, they give an algorithm with competitive ratio max⁡(0.215,1−ε1+ε)\max\left(0.215,\frac{1-\varepsilon}{1+\varepsilon}\right), where

ε=max⁡i∈[n]∣1−v^ivi∣(1)\varepsilon= \max_{i\in[n]} \left|1-\frac{\widehat{v}_i}{v_i}\right| \tag*{(1)}

is the maximum relative error of any value prediction. That is, as the predictions become more accurate (i.e., ε→0\varepsilon\to0), the algorithm achieves competitive ratio approaching 11. Thus, the algorithm is consistent. However, even when the error ε\varepsilon is unbounded, the algorithm achieves a worst-case competitive ratio of 0.2150.215. Thus, the algorithm is robust. Fujii and Yoshida’s bound was later slightly improved to max⁡(0.221,1−ε1+ε)\max\left(0.221,\frac{1-\varepsilon}{1+\varepsilon}\right) by Karisani et al. [32]. No algorithm can achieve better than max⁡(1e,1−ε1+ε)\max\left(\frac{1}{e},\frac{1-\varepsilon}{1+\varepsilon}\right), as 1/e1/e is the optimal competitive ratio even when the predictions are completely uninformative. In fact, Choo and Ling [13] show a stronger upper bound of max⁡(13,1−ε1+ε)\max\left(\frac{1}{3},\frac{1-\varepsilon}{1+\varepsilon}\right)—i.e., achieving consistency necessitates a loss in the worst-case competitive ratio. Closing the gap between this upper bound and the existing lower bounds is an interesting open question.

Fujii and Yoshida’s algorithm follows the predictions until an item with a large prediction error arrives, and then switches to Dynkin’s classical rule [19], which also processes the item that triggered the switch. Since this item’s position is not uniformly random among the remaining items, the analysis proceeds by a case analysis over the status of the best and best-predicted items. Karisani et al. [32] keep this structure, randomize the decision on the best-predicted item after the switch, and refine the case analysis. Such item-by-item analyses do not directly extend to problems where many items are selected.

Our Results

We significantly generalize the prior work of Fujii and Yoshida [25] and Karisani et al. [32], giving the first consistent and robust algorithms for the learning-augmented secretary problem under general matroid and knapsack constraints, and the edge-weighted online bipartite matching problem. In particular, we show:

Theorem 1.2 (Main Result). For learning-augmented matroid secretary, fractional knapsack secretary, and edge-weighted bipartite matching with random vertex arrivals (Problems 1.1, 2.1 and 2.2), there are algorithms that achieve competitive ratio

max⁡(12(e+1),1−ε1+ε),\max\left(\frac{1}{2(e+1)},\frac{1-\varepsilon}{1+\varepsilon}\right),

where ε\varepsilon is the maximum relative error among all item or edge predictions.

As discussed, for all three problems, it is known that competitive ratio 1/e1/e is optimal when no value predictions are given. Thus, our robustness bound of 1/[2(e+1)]1/[2(e+1)] is a constant factor off the optimum. Whether it can be improved for any or all of the studied problems is an interesting open question. Surprisingly, while Theorem 1.2 applies to the fractional knapsack secretary problem, we show in § 5 that the integral version does not admit a nontrivial robust and consistent algorithm. In particular, any algorithm achieving competitive ratio at least 1−δ1-\delta when the predictions exactly equal the true values has worst-case competitive ratio at most δ\delta. An algorithm matching this bound up to a constant factor can be obtained simply by running a worst-case algorithm with probability δ\delta and following the predicted optimum otherwise.

Technical Overview

We prove Theorem 1.2 using a simple and generic framework, detailed in § 3. Our algorithm (Algorithm 1) follows the approach of Fujii and Yoshida [25] for the learning-augmented classic secretary problem. The decision-maker initially ‘trusts’ the predictions: letting x^\hat{x} be the optimal solution under the predicted values, it selects items according to x^\hat{x}. However, if a sufficiently large prediction error (a ‘violation’) is observed for any arriving item, the decision-maker stops following the predictions, and switches to running a standard worst-case competitive algorithm, denoted AbaseA_{\mathrm{base}}, on the remainder of the problem instance.

If there are no violating items, it is easy to bound the competitive ratio of the algorithm—all predictions are accurate up to the violation threshold, and thus the predicted optimal solution x^\hat{x} is near-optimal under the true item values (see Lemma 2.3 for a formalization). The main analysis thus focuses on the case when there is at least one bad prediction—i.e., at least one violating item. A key difficulty is the first violating item, which triggers the switch to the worst-case algorithm. This item may have high value (e.g., in the classic secretary problem, it may be the best item), so the decision on it may be critical. However, if it is handed to AbaseA_{\mathrm{base}}, as in Fujii and Yoshida [25], then AbaseA_{\mathrm{base}} no longer sees the remaining items in uniformly random order. E.g., if an item is the only violating item, it is always the first arrival handled by AbaseA_{\mathrm{base}}.

A Black-Box Reduction to the Worst-Case Algorithm. We make a small modification that significantly simplifies Fujii and Yoshida’s analysis: we select the first violating item with some fixed probability, and then handle only the later arriving items with AbaseA_{\mathrm{base}}. Conditioned on all arrivals up to the first violation, these items arrive in a uniform random order, so we can apply the worst-case guarantees of AbaseA_{\mathrm{base}} black-box.

Let f∈[n]f \in[n] be the index of the first violating item. Let OPT⁡(R)\operatorname{OPT}(R) be the optimal ‘residual’ value obtainable from all items starting with the first violation (i.e., the maximum value we can obtain by selecting items from the first violation onwards while respecting the feasibility constraints). Let OPT⁡(R∖f)\operatorname{OPT}(R \setminus f) be the optimal residual value for all items after the first violation ff, assuming that we reject ff. Let α∈(0,1]\alpha\in(0,1] be the worst-case competitive ratio of Abase\mathcal{A}_{\mathrm{base}}. Our algorithm will accept ff with probability αα+1\frac{\alpha}{\alpha+1} (assuming that doing so is feasible), and otherwise reject it. Let Δf=vf\Delta_f = v_f if accepting ff is feasible, and Δf=0\Delta_f = 0 otherwise. The accepting branch contributes at least Δf⋅α1+α\Delta_f \cdot\frac{\alpha}{1+\alpha} to the expected output value. The rejecting branch contributes at least (1−αα+1)⋅α⋅OPT⁡(R∖f)=αα+1⋅OPT⁡(R∖f)\left(1-\frac{\alpha}{\alpha+1}\right)\cdot\alpha\cdot\operatorname{OPT}(R \setminus f)=\frac{\alpha}{\alpha+1}\cdot\operatorname{OPT}(R \setminus f). In total, the expected value of the output is thus at least

α1+α⋅(Δf+OPT⁡(R∖f))≥αα+1⋅OPT⁡(R),(2)\frac{\alpha}{1+\alpha}\cdot\left(\Delta_f+\operatorname{OPT}(R\setminus f)\right)\ge\frac{\alpha}{\alpha+1}\cdot\operatorname{OPT}(R), \tag*{(2)}

where the inequality follows since OPT⁡(R)\operatorname{OPT}(R) obtains at most Δf\Delta_f value from ff, and its remaining choices are feasible for R∖fR \setminus f. For all three problems we consider (matroid secretary, knapsack secretary, and online matching), α=1/e\alpha=1/e. Thus, if we can show that E[OPT⁡(R)]≥c⋅OPT⁡\mathbb{E}[\operatorname{OPT}(R)]\ge c\cdot\operatorname{OPT} for some constant c∈[0,1]c\in[0,1], we will have a worst-case competitive ratio ce+1\frac{c}{e+1} when there is at least one violating item. Combining this with the case of no violating items (Lemma 2.3) gives a bound of max⁡(ce+1,1−ε1+ε)\max\left(\frac{c}{e+1},\frac{1-\varepsilon}{1+\varepsilon}\right), as in Theorem 1.2.

Residual Value Analysis. With the above argument in place, the key goal becomes to lower bound the expected residual value E[OPT⁡(R)]\mathbb{E}[\operatorname{OPT}(R)]. The proof of this lower bound depends on the specific problem being studied. Here we provide short intuitive arguments that give looser bounds than the final guarantees stated in Theorem 1.2. We later briefly sketch how to obtain the stronger bounds.

Online Matching. Online matching admits a particularly simple argument. Consider any edge ee in the true optimal matching whose offline endpoint is matched by some edge e^\hat{e} in the predicted optimal matching. Note that ee is available and feasible to include in OPT⁡(R)\operatorname{OPT}(R) exactly when the online endpoints of both ee and e^\hat{e} arrive at or after the first violation ff. Further, this event happens with probability at least 1/31/3: the worst case is when e^\hat{e} and ee are both non-violating, and there is a single violating item ff. The event happens exactly when ff arrives first out of the three items—i.e., with probability 1/31/3. If the online endpoint of ee or e^\hat{e} is violating, it must arrive at or after ff (since ff is the first violation) and so the probability only increases. Thus, in expectation, edges carrying at least a 1/31/3 fraction of the optimal value are feasible to include in OPT⁡(R)\operatorname{OPT}(R), and so we have E[OPT⁡(R)]≥1/3⋅OPT⁡\mathbb{E}[\operatorname{OPT}(R)]\ge1/3\cdot\operatorname{OPT}. Combined with (2) this yields a max⁡(13(e+1),1−ε1+ε)\max\left(\frac{1}{3(e+1)},\frac{1-\varepsilon}{1+\varepsilon}\right) competitive ratio bound for online matching.

Matroid Secretary. The analysis for matroid secretary is a bit more subtle—unlike in matching, we cannot consider elements individually, as groups of elements in the optimum solution may be jointly blocked by predicted-optimum elements, even if they are not individually blocked.

Let HH be the set of ‘violating’ items with large prediction error, let O^\hat{O} be the predicted optimal basis, and let OO be the true optimal basis. Let TT denote the arrival time of the first violation, and condition on T=tT=t. By then, the algorithm has accepted a set A⊆O^A\subseteq\hat{O} and discarded a set DD of items outside O^\hat{O}. Fix any ii, and let OiO_i be the ii highest-value items of OO. Let U=Oi∖DU=O_i\setminus D be the subset of these items that are not discarded before the first violation. Note that E[∣U∣∣T=t]≥(1−t)∣Oi∣\mathbb{E}[|U|\mid T=t]\ge(1-t)|O_i|, since each item arrives before time tt with probability at most tt (probability exactly tt for non-violating items, and probability 00 for violating items, since tt is the time of the first violation). While items in UU have not been discarded before the first violation, they may be blocked by the accepted items AA. We next bound the probability of this occurring. By the basis exchange property (see § 2), there is a basis BB with U⊆B⊆U∪O^U\subseteq B\subseteq U\cup\hat{O}. Let C=O^∖BC=\hat{O}\setminus B be the set of ‘conflicting’ items in O^\hat{O} that would potentially block items in UU. Accepted items in O^\hat{O} but outside CC lie in BB, so together with UU they form an independent set and block nothing in UU. On the other hand, each accepted item in CC blocks at most one item of UU. In addition, an item of U∩O^U\cap\hat{O} that arrives before the first violation is itself accepted, so it is no longer available in the residual. We can observe that ∣C∣=∣U∖O^∣|C|=|U\setminus\hat{O}|: to form the basis BB with U⊆BU\subseteq B we remove exactly the items CC from O^\hat{O}, replacing them with the items U∖O^U \setminus\widehat{O}. Thus, we have ∣C∣+∣U∩O^∣=∣U∣|C| + |U \cap\widehat{O}| = |U|. Each item of CC and each item of U∩O^U \cap\widehat{O} arrives before the first violation, and is thus accepted, with probability at most tt. So the expected number of items of UU that are blocked or already accepted is at most t∣U∣t|U|. Overall, the expected number of items from OiO_i available for use in OPT⁡(R)\operatorname{OPT}(R), conditioning on a first violation at time T=tT=t, is at least (1−t)E[∣U∣∣T=t]≥(1−t)2∣Oi∣(1-t)\mathbb{E}[|U| \mid T=t] \ge(1-t)^2|O_i|. Applying this bound to OiO_i for every ii, and using that E[(1−T)2]≥1/3\mathbb{E}[(1-T)^2] \ge1/3, gives E[OPT⁡(R)]≥OPT⁡/3\mathbb{E}[\operatorname{OPT}(R)] \ge\operatorname{OPT}/3.

Knapsack Secretary. Finally, for fractional knapsack secretary, we let WW be the capacity consumed by following the predicted optimal solution before the first violation. We let LL be the total value that the optimal allocation obtains from items that arrive before the first violation. If we restrict the optimal allocation just to items arriving after the first violation, it has value OPT⁡−L\operatorname{OPT}-L and uses capacity at most 11. Scaling this allocation by the remaining capacity 1−W1-W therefore gives a feasible residual allocation, so OPT⁡(R)≥(1−W)(OPT⁡−L)\operatorname{OPT}(R) \ge(1-W)(\operatorname{OPT}-L).

Conditioning on the first violation arriving at time T=tT=t, each non-violating item arrives before tt with probability tt, while no violating item does. Thus, E[W∣T=t]≤t\mathbb{E}[W \mid T=t] \le t and E[L∣T=t]≤tOPT⁡\mathbb{E}[L \mid T=t] \le t\operatorname{OPT}. Moreover, conditional on T=tT=t, WW and LL are positively correlated: both are nonnegative weighted sums of the same independent indicators for whether an item arrives before tt. It follows that

E[OPT⁡(R)∣T=t]≥(1−E[W∣T=t])(OPT⁡−E[L∣T=t])≥(1−t)2OPT⁡.\mathbb{E}[\operatorname{OPT}(R) \mid T=t] \ge(1-\mathbb{E}[W \mid T=t])(\operatorname{OPT}-\mathbb{E}[L \mid T=t]) \ge(1-t)^2\operatorname{OPT}.

Again using that E[(1−T)2]≥1/3\mathbb{E}[(1-T)^2] \ge1/3 gives E[OPT⁡(R)]≥OPT⁡/3\mathbb{E}[\operatorname{OPT}(R)] \ge\operatorname{OPT}/3.

Tightness of Residual Bound. Unfortunately, it is not hard to see that the bound of E[OPT⁡(R)]≥OPT⁡/3\mathbb{E}[\operatorname{OPT}(R)] \ge\operatorname{OPT}/3 cannot be significantly improved. All three problems studied capture the standard secretary problem as special cases: matroid secretary when only sets of size at most one are feasible, knapsack secretary when all items have weight one and so exactly one can be accepted into the knapsack, and bipartite matching when there is just a single fixed vertex that all arriving edges share as an endpoint. For the classic secretary problem, analogously to the worst case in the online matching argument above, if we have just a single low-value violating item ff, along with optimal and predicted optimal items oo and o^\hat{o}, oo is only available to include in OPT⁡(R)\operatorname{OPT}(R) if ff arrives first—which happens with probability 1/31/3. If ff arrives second, either oo is rejected before the first violation, or o^\hat{o} is accepted, meaning that oo cannot be later accepted. If ff arrives last, then there are no remaining items in the residual. Given this, we have E[OPT⁡(R)]≈OPT⁡/3\mathbb{E}[\operatorname{OPT}(R)] \approx\operatorname{OPT}/3. A slightly better bound can indeed be proven since if neither oo nor o^\hat{o} is a violating item, they must have relatively comparable values. However, it is not strong enough to give the max⁡(12(e+1),1−ε1+ε)\max\left(\frac{1}{2(e+1)},\frac{1-\varepsilon}{1+\varepsilon}\right) competitive ratio of Theorem 1.2.

Tighter Bounds via Prefix + Residual Analysis. Given this, the analysis of Theorem 1.2 must look beyond just OPT⁡(R)\operatorname{OPT}(R). In particular, we need to use that when OPT⁡(R)\operatorname{OPT}(R) is small, it is because the algorithm has already collected value before the first violation, and this value must be accounted for. We let PP denote the ‘prefix’ value obtained from all items in the predicted optimum accepted before the first violation. As discussed, our algorithm obtains expected value at least 11+εOPT⁡(R)\frac{1}{1+\varepsilon}\operatorname{OPT}(R) on all items arriving at or after the first violation. Thus, its expected total value is at least E[P+11+εOPT⁡(R)]\mathbb{E}\left[P+\frac{1}{1+\varepsilon}\operatorname{OPT}(R)\right]. See Lemma 3.2 for a formalization. In § 4 we show that for all three problems, this total expected prefix+residual value can be lower bounded by 12(e+1)⋅OPT⁡\frac{1}{2(e+1)}\cdot\operatorname{OPT}, yielding the bound of Theorem 1.2. Very roughly, in all three cases, we argue that OPT⁡(R)\operatorname{OPT}(R) being small makes PP large, obtaining a stronger bound than when bounding E[OPT⁡(R)]\mathbb{E}[\operatorname{OPT}(R)] alone.

Preliminaries

We start with preliminaries relevant to our results on all three problems covered by Theorem 1.2.

Problem Definitions

As discussed, we study the learning-augmented matroid secretary problem (Problem 1.1), as well as the closely related fractional knapsack secretary problem and edge-weighted online bipartite matching problem with random vertex arrivals. We define the latter two problems below.

Problem 2.1 (Learning-Augmented Fractional Knapsack Secretary). The learning-augmented fractional knapsack secretary problem is identical to the learning-augmented matroid secretary problem (Problem 1.1) with the following differences:

  • Each item has a weight wi∈(0,1]w_i \in(0,1] known ahead of time to the decision-maker.

  • The goal is to select fractions xi∈[0,1]x_i \in[0,1] that maximize the total value ∑i∈[n]xivi\sum_{i\in[n]} x_i v_i subject to the knapsack constraint ∑i∈[n]xiwi≤1\sum_{i\in[n]} x_i w_i \le1.

  • When an item arrives, the decision-maker observes its value viv_i and must irrevocably choose its fraction xix_i, subject to the capacity left by earlier decisions.

The integral version, which we discuss in § 5, further requires xi∈{0,1}x_i \in\{0,1\} for every item.

Problem 2.2 (Learning-Augmented Online Bipartite Matching with Random Arrivals). The learning-augmented online bipartite matching problem with random arrivals is defined as follows:

  • There is a known bipartite graph G=([n]∪U,E)G = ([n] \cup U, E), with unknown positive edge values vev_e for e∈Ee \in E.

  • The goal is to select a set S⊆ES \subseteq E that maximizes the total value ∑e∈Sve\sum_{e\in S} v_e subject to SS being a matching, i.e., no two selected edges share an endpoint.

  • The vertices in [n][n] are assigned uniform and independent random arrival times t1,…,tn∼Unif⁡[0,1]t_1,\ldots,t_n \sim\operatorname{Unif}[0,1], and processed in increasing order of arrival time. When a vertex arrives, the decision-maker observes the values of all its incident edges, and must irrevocably decide to add at most one of these edges to SS, subject to the matching constraint, or reject the vertex.

  • The decision-maker is given predicted values v^e\hat{v}_e for every edge e∈Ee \in E ahead of time. There are no guarantees on the accuracies or distributions of these predictions.

Notation and Prediction Error

For matroid and knapsack, items are indexed by [n][n]; for matching, arriving vertices are indexed by [n][n] but edges are indexed by EE. Let CC denote the corresponding coordinate set: C=[n]C = [n] for matroid and knapsack and C=EC = E for matching. For all three problems, arrivals are indexed by [n][n]. We let ViV_i denote the set of coordinates whose values are revealed at arrival ii. In matroid and knapsack secretary, ViV_i is simply the singleton containing element ii. For online matching, ViV_i is the set of edges incident to the arriving vertex ii.

We write v\mathbf{v} and v^\hat{\mathbf{v}} for the true and predicted values on the coordinates in CC. Each problem requires selecting a decision vector x\mathbf{x}, with xc∈{0,1}x_c \in\{0,1\} for matroid elements and matching edges and xc∈[0,1]x_c \in[0,1] for fractional-knapsack items. Let X\mathcal{X} be the set of decision vectors satisfying the corresponding feasibility constraints. In all cases, X\mathcal{X} is known to the decision-maker in advance.

A decision vector x∈X\mathbf{x} \in\mathcal{X} has value v⋅x\mathbf{v} \cdot\mathbf{x}. We denote the predicted and true optimum decisions by

x^∈arg⁡max⁡x∈Xv^⋅x,x∗∈arg⁡max⁡x∈Xv⋅x,OPT=v⋅x∗.(3)\hat{\mathbf{x}} \in\arg\max_{\mathbf{x}\in\mathcal{X}} \hat{\mathbf{v}}\cdot\mathbf{x}, \qquad\mathbf{x}^* \in\arg\max_{\mathbf{x}\in\mathcal{X}} \mathbf{v}\cdot\mathbf{x}, \qquad\mathrm{OPT} = \mathbf{v}\cdot\mathbf{x}^*. \tag*{(3)}

We assume that a deterministic tie-breaking rule guarantees a unique optimum for any value vector.

The maximum relative prediction error ε\varepsilon is defined in (1), with the maximum taken over all coordinates in CC. We work with the equivalent definition: ε\varepsilon is the minimum value such that

(1−ε)vc≤v^c≤(1+ε)vcfor every c∈C.(4)(1-\varepsilon)v_c \le\hat{v}_c \le(1+\varepsilon)v_c \qquad\text{for every } c \in C. \tag*{(4)}

If the prediction error ε\varepsilon is small, then following the predicted optimum gives a near-optimal solution. In particular, we can observe:

Lemma 2.3 (Value of the Predicted Optimum). For maximum prediction error ε<1\varepsilon< 1, the predicted optimal solution x^\widehat{x} has value at least v⋅x^≥1−ε1+ε⋅OPT\mathbf{v} \cdot\widehat{x} \ge\frac{1-\varepsilon}{1+\varepsilon} \cdot\mathrm{OPT}.

Proof. Using (4) we can bound:

v⋅x^≥11+εv^⋅x^≥11+εv^⋅x∗≥1−ε1+εv⋅x∗=1−ε1+εOPT.\mathbf{v} \cdot\widehat{x} \ge\frac{1}{1+\varepsilon}\widehat{\mathbf{v}} \cdot\widehat{x} \ge\frac{1}{1+\varepsilon}\widehat{\mathbf{v}} \cdot x^{*} \ge\frac{1-\varepsilon}{1+\varepsilon}\mathbf{v} \cdot x^{*} = \frac{1-\varepsilon}{1+\varepsilon}\mathrm{OPT}.

As discussed, our general algorithm will follow the predicted optimum x^\widehat{x} until it sees an item with a sufficiently large prediction error. We call such an item a ‘violation’.

Definition 2.4 (Violation). Fix a threshold θ∈[0,1)\theta\in[0,1). In matroid and knapsack secretary, item i∈[n]i \in[n] is a violation if v^i∉[(1−θ)vi,(1+θ)vi]\widehat{v}_i \notin[(1-\theta)v_i,(1+\theta)v_i]. In online matching, an arriving vertex is a violation if at least one of its incident edges fails the same inequality. Let HH denote the set of violating items or arriving vertices.

In Algorithm 1, we will fix the violation threshold to θ=2e+12e+3\theta= \frac{2e+1}{2e+3}, which is optimized for the competitive ratio of 1/e1/e achieved by the worst-case algorithm for all three of the problems we study. In particular, for this setting of θ\theta, 1−θ1+θ=12(e+1)\frac{1-\theta}{1+\theta} = \frac{1}{2(e+1)}, which is the final worst-case competitive ratio of our algorithm.

Additional Notation and Terminology. For the matroid secretary and matching problems we sometimes work directly with a set of matroid elements or edges SS, as opposed to its corresponding decision vector. We denote v(S)=∑i∈Sviv(S) = \sum_{i\in S} v_i and v^(S)=∑i∈Sv^i\widehat{v}(S) = \sum_{i\in S} \widehat{v}_i. We say that an algorithm has competitive ratio ρ\rho if E[ALG]≥ρ OPT\mathbb{E}[\mathrm{ALG}] \ge\rho\ \mathrm{OPT} on every instance, where E[ALG]\mathbb{E}[\mathrm{ALG}] is the expected value of the algorithm output, taken over the random arrival sequence and any randomness of the algorithm.

Matroid Preliminaries. Write M=([n],I)M = ([n],\mathcal{I}) for the known matroid in Problem 1.1, where I\mathcal{I} is its family of independent sets. A basis is a maximal independent set. All bases have the same size, and every independent set can be extended to a basis. Since values are positive, both the predicted and true optima are bases.

If an independent set AA has already been accepted, its contraction M/AM/A has independent sets JJ such that J∩A=∅J \cap A = \varnothing and A∪J∈IA \cup J \in\mathcal{I}. We let M∖DM \setminus D denote the operation of removing a set DD of elements from consideration. All elements in DD are removed from the ground set, and any independent set containing an element of DD is removed from I\mathcal{I}. With this notation, (M/A)∖D(M/A) \setminus D is precisely the remaining matroid after accepting the elements in AA and discarding the elements in DD.

Our analysis uses two standard basis exchange properties for matroids ([45 Chapter 39]). Given a basis BB and an independent set JJ, there is a basis B′B' with J⊆B′⊆J∪BJ \subseteq B' \subseteq J \cup B. I.e., B′B' completes JJ to a basis using only elements from BB. Also, for any two bases BB and B′B', there is a bijection ϕ:B′∖B→B∖B′\phi: B' \setminus B \to B \setminus B' such that (B∖{ϕ(i)})∪{i}(B \setminus\{\phi(i)\}) \cup\{i\} is a basis for every i∈B′∖Bi \in B' \setminus B.

General Algorithm and Analysis

Pseudocode for the switching algorithm is given in Algorithm 1.

As discussed, Algorithm 1 starts in PRED mode, following the predicted optimum x^\widehat{x}, until the first violating arrival, i.e., the first arrival with relative prediction error larger than θ=2e+12e+3\theta= \frac{2e+1}{2e+3}. The algorithm handles this first violating arrival with a random choice: with probability pp (eventually set to 11+e\frac{1}{1+e} for the three problems studied), it takes the feasible action on the arrival that maximizes total value. Otherwise, it Algorithm 1 General Switching Algorithm

Image not extracted

Figure 1.

Require: Feasible set X\mathcal{X}, predictions v^\hat{\mathbf{v}}, and a baseline algorithm Abase\mathcal{A}_{\mathrm{base}}.

  1. Compute x^∈arg⁡max⁡y∈Xv^⋅y\hat{\mathbf{x}} \in\arg\max_{\mathbf{y}\in\mathcal{X}} \hat{\mathbf{v}} \cdot\mathbf{y}. Set x←0\mathbf{x} \leftarrow0 and mode←PREDmode \leftarrow\mathrm{PRED}.

  2. while mode=PREDmode = \mathrm{PRED} do

  3. Observe the next arrival jj. Let VjV_j be the set of coordinates whose values are revealed at jj.

  4. if jj is not a violation with threshold θ=2e+12e+3\theta= \frac{2e+1}{2e+3} (Definition 2.4) then

  5. Set the coordinates of x\mathbf{x} in VjV_j according to x^\hat{\mathbf{x}}.

  6. else

  7. With probability pp, take the feasible action on VjV_j maximizing the value added; otherwise reject jj.

  8. Initialize Abase\mathcal{A}_{\mathrm{base}} on later arrivals under the remaining constraints. Set mode←BASEmode \leftarrow\mathrm{BASE}.

  9. end if

  10. end while

  11. while mode=BASEmode = \mathrm{BASE} do

  12. Process the next arrival using Abase\mathcal{A}_{\mathrm{base}}.

  13. end while

  14. return x\mathbf{x}.

rejects the arrival. For matroid secretary, this means it accepts the violating item jj with probability pp, and rejects it otherwise. For fractional knapsack, with probability pp it sets xjx_j to the largest allocation that does not violate feasibility, i.e., xj=min⁡{1,C/wj}x_j = \min\{1, C/w_j\}, where CC is the remaining capacity. Otherwise, it rejects the item, setting xj=0x_j = 0. For online matching, with probability pp, it selects the maximum-value edge from vertex jj to an unmatched offline vertex (assuming one exists) and otherwise rejects the vertex.

After handling the first violation, the algorithm enters BASE mode, where it simply runs a worst-case algorithm Abase\mathcal{A}_{\mathrm{base}} on later arrivals, subject to the modified constraints given the decisions before the first violation. In all cases, the modified problem is just an instance of the original. For matroid secretary, it is a matroid secretary problem on a contracted matroid. For knapsack secretary, it is a knapsack secretary problem with a smaller capacity.2 For online matching, it is an online matching problem on a subset of the vertices (those that have not been previously matched). Further, conditioned on the arrivals up to the first violation jj, the order of the later arrivals is still uniform, and their arrival times are uniformly distributed in [tj,1][t_j,1]. Thus, in all instances, Abase\mathcal{A}_{\mathrm{base}} with competitive ratio 1/e1/e is available ([1, 35, 33]).

Analysis

Observe that if no violation occurs (i.e., all predictions are accurate with threshold θ\theta), then the maximum prediction error satisfies ε≤θ=2e+12e+3\varepsilon\leq\theta= \frac{2e+1}{2e+3} (as set in Definition 2.4). So,

1−ε1+ε≥1−2e+12e+31+2e+12e+3=12(e+1).\frac{1-\varepsilon}{1+\varepsilon} \geq\frac{1-\frac{2e+1}{2e+3}}{1+\frac{2e+1}{2e+3}} = \frac{1}{2(e+1)}.

In this case, by Lemma 2.3, Algorithm 1 thus obtains competitive ratio 1−ε1+ε=max⁡(12(e+1),1−ε1+ε)\frac{1-\varepsilon}{1+\varepsilon} = \max\left(\frac{1}{2(e+1)},\frac{1-\varepsilon}{1+\varepsilon}\right), as required by Theorem 1.2.

Thus, the challenging case to analyze is when there is at least one violation and Algorithm 1 enters BASE mode. In this case, we will analyze the total expected value of the prefix decided before the first violation and the residual decided after the first violation, formally defined below.

Definition 3.1 (Prefix and Residual). Consider an input instance to Algorithm 1 containing at least one violating prediction (i.e., for which BASE mode is guaranteed to be triggered). Let ff be the index of the first violating arrival and let xfx_f be the value of x\mathbf{x} immediately before this arrival is processed. Let X′⊆X\mathcal{X}' \subseteq\mathcal{X} be the set of feasible decision vectors that match xfx_f on all items revealed before arrival ff. We define:

P=xf⋅vandOPT⁡(R)=max⁡x∈X′(x−xf)⋅v.P = x_f \cdot\mathbf{v} \qquad\text{and}\qquad \operatorname{OPT}(R) = \max_{\mathbf{x}\in\mathcal{X}'}(\mathbf{x}-x_f)\cdot\mathbf{v}.

That is, PP is the value obtained by all decisions before arrival ff. OPT⁡(R)\operatorname{OPT}(R) is the maximum additional obtainable value using all items revealed at arrival ff or later. Note that both PP and OPT⁡(R)\operatorname{OPT}(R) are random variables, depending on the random arrival sequence.

To show that Algorithm 1 satisfies the competitive ratio of Theorem 1.2, we will argue that PP and OPT⁡(R)\operatorname{OPT}(R) are sufficiently large in expectation. At first glance, one might hope that the algorithm obtains expected total value E[P+1/e⋅OPT⁡(R)]\mathbb{E}[P+1/e\cdot\operatorname{OPT}(R)], since the worst-case algorithm Abase\mathcal{A}_{\mathrm{base}} has competitive ratio 1/e1/e for all problems studied. However, this is not quite the case: OPT⁡(R)\operatorname{OPT}(R) potentially includes items revealed by the first violating arrival ff. While the arrival order of all items arriving after ff is uniform, since ff is guaranteed to be the first arriving item in the residual instance, we cannot simply apply Abase\mathcal{A}_{\mathrm{base}} to it.

Consider a simple example of the classic secretary problem: assume that the only violating item is the true maximum-value element i∗=arg max⁡i∈[n]vii^*=\operatorname*{arg\,max}_{i\in[n]}v_i. All other predictions are accurate. Thus, we always have f=i∗f=i^*. If Abase\mathcal{A}_{\mathrm{base}} is the classic 1/e1/e-competitive algorithm for the secretary problem, it would always reject i∗i^*, since it always rejects the first 1/e1/e fraction of elements seen.

Algorithm 1 avoids this issue by making a separate random decision for the first violating arrival ff, before applying Abase\mathcal{A}_{\mathrm{base}} to all later arrivals. The random decision ensures the following bound on the algorithm’s competitive ratio in terms of the prefix and residual values:

Lemma 3.2 (Prefix and Residual Bound). Suppose Algorithm 1 is implemented with Abase\mathcal{A}_{\mathrm{base}} that obtains worst-case competitive ratio 1/e1/e and p=1/(1+e)p=1/(1+e). Then on any input instance containing at least one violating prediction,

E[ALG]≥E[P+p⋅OPT⁡(R)].\mathbb{E}[\mathrm{ALG}] \ge\mathbb{E}[P+p\cdot\operatorname{OPT}(R)].

Proof. Condition on the history through the arrival of ff, before its random decision. Let Δf\Delta_f be the maximum additional value obtainable from the indices VfV_f while keeping the prefix decisions fixed. For matroid secretary, Δf=vf\Delta_f=v_f if adding ff preserves independence, and Δf=0\Delta_f=0 otherwise. For fractional knapsack, Δf=vfmin⁡{1,C/wf}\Delta_f=v_f\min\{1,C/w_f\}, where CC is the remaining capacity. For online matching, Δf\Delta_f is the maximum value of an edge from ff to an unmatched offline vertex, or 00 if no such edge exists.

Let R∖fR\setminus f be the residual instance after rejecting ff, with only the prefix decisions fixed. The later arrivals have uniformly random relative order, so Abase\mathcal{A}_{\mathrm{base}} obtains expected value at least OPT⁡(R∖f)/e\operatorname{OPT}(R\setminus f)/e on this instance. The accepting branch contributes at least Δf\Delta_f, since its subsequent value is nonnegative. Averaging over the two branches gives

E[ALG]≥E[P+p⋅Δf+1−pe⋅OPT⁡(R∖f)].(5)\mathbb{E}[\mathrm{ALG}] \ge\mathbb{E}\left[P+p\cdot\Delta_f+\frac{1-p}{e}\cdot\operatorname{OPT}(R\setminus f)\right]. \tag*{(5)}

Any solution in RR obtains at most Δf\Delta_f from VfV_f, and its remaining choices are feasible in R∖fR\setminus f. Thus OPT⁡(R)≤Δf+OPT⁡(R∖f)\operatorname{OPT}(R)\le\Delta_f+\operatorname{OPT}(R\setminus f). Using that p=1/(1+e)p=1/(1+e) and so (1−p)/e=p(1-p)/e=p, we conclude

E[ALG]≥E[P+p(Δf+OPT⁡(R∖f))]≥E[P+p⋅OPT⁡(R)],\mathbb{E}[\mathrm{ALG}] \ge\mathbb{E}\left[P+p\left(\Delta_f+\operatorname{OPT}(R\setminus f)\right)\right]\ge\mathbb{E}[P+p\cdot\operatorname{OPT}(R)],

as desired. □\square

With Lemma 3.2 in place, to prove Theorem 1.2 it suffices to argue that E[P+p⋅OPT⁡(R)]\mathbb{E}[P+p\cdot\operatorname{OPT}(R)], which lower bounds E[ALG⁡]\mathbb{E}[\operatorname{ALG}], is sufficiently large. In particular, we have:

Lemma 3.3 (Reduction to the Prefix and Residual). Suppose Algorithm 1 is implemented with AbaseA_{\mathrm{base}} that obtains worst-case competitive ratio 1/e1/e and p=1/(1+e)p=1/(1+e). Assume that on any given problem instance with at least one violating prediction

E[P+p⋅OPT⁡(R)]≥p2⋅OPT⁡.(6)\mathbb{E}[P+p\cdot\operatorname{OPT}(R)]\ge\frac{p}{2}\cdot\operatorname{OPT}. \tag*{(6)}

Then Algorithm 1 achieves competitive ratio

max⁡(12(e+1),1−ε1+ε).\max\left(\frac{1}{2(e+1)},\frac{1-\varepsilon}{1+\varepsilon}\right).

Proof. Fix the input instance. If there is no violating prediction, the claimed competitive ratio was established at the beginning of this subsection, using Lemma 2.3.

Otherwise there is at least one violating prediction, i.e., ε>θ=2e+12e+3\varepsilon>\theta=\frac{2e+1}{2e+3}. Then by Lemma 3.2 and the assumption of (6) we have:

E[ALG⁡]≥E[P+pOPT⁡(R)]≥p2⋅OPT⁡=12(e+1)⋅OPT⁡=max⁡(12(e+1),1−ε1+ε)⋅OPT⁡,\mathbb{E}[\operatorname{ALG}]\ge\mathbb{E}[P+p\operatorname{OPT}(R)]\ge\frac{p}{2}\cdot\operatorname{OPT}=\frac{1}{2(e+1)}\cdot\operatorname{OPT}=\max\left(\frac{1}{2(e+1)},\frac{1-\varepsilon}{1+\varepsilon}\right)\cdot\operatorname{OPT},

as desired. This completes the proof.

With Lemma 3.3 in place, to prove our main result, Theorem 1.2, it suffices to show that (6) holds for our three problems of interest. We do this in § 4.

Remark 3.4 (Tightness of (6)). We note that the bound of (6) cannot be improved for any of the three problems. As in the discussion of the residual bound in § 1.3, it suffices to consider the standard secretary problem, which is a special case of all three. Suppose there is an item oo of value 11 whose prediction is correct, along with a single violating item ff that has negligible true value but whose predicted value exceeds 11. Then the predicted optimum consists of ff alone, so the algorithm accepts nothing before the first violation, and P=0P=0. Moreover, oo is available in the residual instance only if ff arrives first, which happens with probability 1/21/2; otherwise oo has already been rejected. Thus E[P+p⋅OPT⁡(R)]≈p2⋅OPT⁡\mathbb{E}[P+p\cdot\operatorname{OPT}(R)]\approx\frac{p}{2}\cdot\operatorname{OPT}. Improving the robustness guarantee of Theorem 1.2 would therefore require going beyond our prefix + residual analysis.

Applications to the Three Problems

We now verify (6) for each of the three problems. Together with Lemma 3.3, this proves Theorem 1.2.

Matroid Secretary

We start with the matroid secretary problem (Problem 1.1).

Problem-Specific Notation. Let M=([n],I)M=([n],\mathcal{I}) be the known matroid. For a set of items SS, write v(S)=∑i∈Sviv(S)=\sum_{i\in S}v_i and v^(S)=∑i∈Sv^i\hat{v}(S)=\sum_{i\in S}\hat{v}_i for its true and predicted values. Let O^\hat{O} and OO be independent sets of maximum predicted and true value. Since all values are positive, both are bases.

To prove (6), we consider an instance with nonempty violating item set HH (Definition 2.4). We write h=∣H∣h=|H|. Let ff be the first violating item to arrive and let TT be its arrival time; both are random. Every item arriving before TT is non-violating, so before TT the algorithm accepts exactly the items of O^\hat{O} that arrive. The accepted set is thus A={o^∈O^:to^<T}A=\{\hat{o}\in\hat{O}:t_{\hat{o}}<T\} and the discarded set is D={i∈[n]∖O^:ti<T}D=\{i\in[n]\setminus\hat{O}:t_i<T\}. The residual matroid is R=(M/A)∖DR = (M/A) \setminus D, and it contains ff. If {f}\{f\} is not independent in RR, Algorithm 1 rejects ff; otherwise it accepts ff with probability pp. In this notation, the prefix and residual values of Definition 3.1 are

P=v(A)andOPT⁡(R)=max⁡J independent in Rv(J).(7)P = v(A) \qquad\text{and} \qquad\operatorname{OPT}(R) = \max_{J\text{ independent in }R} v(J). \tag*{(7)}

Let N:=[n]∖(O^∪H)N := [n] \setminus(\widehat{O} \cup H) be the non-violating items outside O^\widehat{O}. Since violating items arrive at or after TT, we always have A⊆O^∖HA \subseteq\widehat{O} \setminus H and D⊆ND \subseteq N. Moreover, conditioned on T=tT = t, each item of O^∖H\widehat{O} \setminus H belongs to AA with probability tt, and each item of NN belongs to DD with probability tt. This holds because TT is determined by the arrival times of the items in HH, which are independent of the arrival times of all other items. Since AA and DD are determined by the arrival times of disjoint sets of items, they are also independent given T=tT = t. The main result of this subsection is that (6) holds for the matroid secretary problem.

Theorem 4.1. For any input instance to Problem 1.1 with at least one violating item (i.e., with H≠∅H \ne\varnothing), letting PP and OPT⁡(R)\operatorname{OPT}(R) be as in (7),

E[P+pOPT⁡(R)]≥p2OPT⁡.(8)\mathbb{E}[P + p\operatorname{OPT}(R)] \ge\frac{p}{2}\operatorname{OPT}. \tag*{(8)}

To prove Theorem 4.1, we want to show that every element of the true optimum OO receives expected weight at least p/2p/2 in E[P+pOPT⁡(R)]\mathbb{E}[P + p\operatorname{OPT}(R)]. We do this in two steps. First, we drop the factor pp and lower bound E[P+OPT⁡(R)]\mathbb{E}[P + \operatorname{OPT}(R)]. Lemmas 4.2 and 4.3 give a separate guarantee for each element o∈Oo \in O: in expectation, oo is either accepted before the first violation or still available to the residual solution, with a probability that depends only on whether oo is in O^\widehat{O} and whether it is violating.

Second, we bring back the factor pp by writing P+pOPT⁡(R)=p(P+OPT⁡(R))+(1−p)PP + p\operatorname{OPT}(R) = p(P + \operatorname{OPT}(R)) + (1-p)P. The first term is handled by step one, and the second adds extra weight on items accepted before the first violation. Combined, we show that this gives every element of OO weight at least p/2p/2, except in one case: when there is exactly one violating item, an element of O∖O^O \setminus\widehat{O} that is not violating only gets weight p/3p/3. To cover this shortfall, we pair each such element of OO with its blocking element in O^\widehat{O}. Since both items are non-violating, we can argue that they have comparable values, and so we can use the probability of accepting the blocking item in the prefix to make up for the shortfall in the probability of accepting the true optimal item.

Lemma 4.2. Consider the setting of Theorem 4.1. Let BB be a basis of MM with O^∖H⊆B\widehat{O} \setminus H \subseteq B, and for o∈Oo \in O let aB(o)=1{o∉B}+1{o∈N}a_B(o) = \mathbf{1}_{\{o\notin B\}} + \mathbf{1}_{\{o\in N\}}. Then for every t∈[0,1]t \in[0,1],

E[v(A∩O)+OPT⁡(R)∣T=t]≥∑o∈O(1−t)aB(o)vo.\mathbb{E}\left[v(A \cap O) + \operatorname{OPT}(R) \mid T = t\right] \ge\sum_{o\in O}(1-t)^{a_B(o)}v_o.

In our main application of Lemma 4.2, we will take B=O^B = \widehat{O}. In this case, aO^(o)∈{0,1,2}a_{\widehat{O}}(o) \in\{0,1,2\} is exactly the number of ways in which oo may become unavailable: by being blocked by an element of O^\widehat{O} accepted before the first violation, or by being discarded before the first violation.

Proof. Order O={o1,…,or}O = \{o_1,\ldots,o_r\} so that vo1≥⋯≥vorv_{o_1} \ge\cdots\ge v_{o_r}, write Oi={o1,…,oi}O_i = \{o_1,\ldots,o_i\}, and set vor+1=0v_{o_{r+1}} = 0 and Δi=voi−voi+1≥0\Delta_i = v_{o_i} - v_{o_{i+1}} \ge0. Let rk⁡R(Q)\operatorname{rk}_R(Q) denote the maximum size of an independent subset of QQ in RR, and define

qi:=∣Oi∩A∣+rk⁡R(Oi∖(A∪D)).q_i := |O_i \cap A| + \operatorname{rk}_R(O_i \setminus(A \cup D)).

That is, qiq_i is the number of elements of OiO_i accepted before the first violation, plus the number of further elements of OiO_i that can still be added in RR. We first show that for every ii,

E[qi∣T=t]≥∑o∈Oi(1−t)aB(o).(9)\mathbb{E}[q_i \mid T = t] \ge\sum_{o\in O_i}(1-t)^{a_B(o)}. \tag*{(9)}

Fix ii and condition on T=tT=t and on DD. Let U=Oi∖DU=O_i\setminus D. Since U⊆OU\subseteq O is independent, there is a basis B′B' with U⊆B′⊆U∪BU\subseteq B'\subseteq U\cup B. Let C=B∖B′C=B\setminus B' be the set of ‘conflicting’ items: those of BB that must be removed to complete UU to a basis, and that may therefore block items of UU. Both B′B' and CC are determined by DD and ii, so they are fixed once we condition on DD. Because A⊆BA\subseteq B, we have A∖C=A∩B′A\setminus C=A\cap B', so U∪(A∖C)⊆B′U\cup(A\setminus C)\subseteq B' is independent. Because A∩D=∅A\cap D=\varnothing, we have Oi∩A=U∩AO_i\cap A=U\cap A and Oi∖(A∪D)=U∖AO_i\setminus(A\cup D)=U\setminus A. Deleting DD does not change the rank of a set disjoint from DD, and AA is independent, so

qi=∣U∩A∣+rk⁡M/A(U∖A)=∣U∩A∣+rk⁡M(U∪A)−∣A∣≥∣U∩A∣+∣U∪(A∖C)∣−∣A∣.q_i=|U\cap A|+\operatorname{rk}_{M/A}(U\setminus A)=|U\cap A|+\operatorname{rk}_M(U\cup A)-|A|\ge|U\cap A|+|U\cup(A\setminus C)|-|A|.

Since U⊆B′U\subseteq B' is disjoint from CC, we have ∣U∪(A∖C)∣=∣U∣+∣A∣−∣A∩C∣−∣U∩A∣|U\cup(A\setminus C)|=|U|+|A|-|A\cap C|-|U\cap A|, and therefore

qi≥∣U∣−∣A∩C∣.q_i\ge|U|-|A\cap C|.

Now average over AA. Only items of O^∖H\widehat{O}\setminus H can belong to AA, and each does so with probability tt, so E[∣A∩C∣∣D,T=t]≤t∣C∣\mathbb{E}[|A\cap C|\mid D,T=t]\le t|C|. Since BB and B′B' are bases of equal size and B′⊆U∪BB'\subseteq U\cup B, we have ∣C∣=∣B′∖B∣=∣U∖B∣|C|=|B'\setminus B|=|U\setminus B|. Hence

E[qi∣D,T=t]≥∣U∣−t∣U∖B∣=∣U∩B∣+(1−t)∣U∖B∣=∑o∈U(1−t)1{o∉B}.\mathbb{E}[q_i\mid D,T=t]\ge|U|-t|U\setminus B|=|U\cap B|+(1-t)|U\setminus B|=\sum_{o\in U}(1-t)^{\mathbf{1}\{o\notin B\}}.

Finally, average over DD. An element o∈Oio\in O_i belongs to UU with probability 1−t1-t if o∈No\in N, and with probability one otherwise. This gives (9).

Next we convert these bounds into a bound on value. Let JJ be the output of the greedy algorithm that scans o1,…,oro_1,\ldots,o_r in this order, skipping elements of A∪DA\cup D, and adds an element whenever JJ stays independent in RR. After the elements of OiO_i have been scanned, J∩OiJ\cap O_i is a maximal independent subset of Oi∖(A∪D)O_i\setminus(A\cup D) in RR, and it is not changed by later steps. In a matroid, all maximal independent subsets of a set have the same size, so ∣J∩Oi∣=rk⁡R(Oi∖(A∪D))|J\cap O_i|=\operatorname{rk}_R(O_i\setminus(A\cup D)). For any Q⊆OQ\subseteq O we have v(Q)=∑i=1rΔi∣Q∩Oi∣v(Q)=\sum_{i=1}^{r}\Delta_i|Q\cap O_i|, because ∑i≥jΔi=voj\sum_{i\ge j}\Delta_i=v_{o_j}. Applying this to A∩OA\cap O and J⊆OJ\subseteq O, and using that JJ is independent in RR, we get

v(A∩O)+OPT⁡(R)≥v(A∩O)+v(J)=∑i=1rΔi(∣A∩Oi∣+∣J∩Oi∣)=∑i=1rΔiqi.v(A\cap O)+\operatorname{OPT}(R)\ge v(A\cap O)+v(J)=\sum_{i=1}^{r}\Delta_i(|A\cap O_i|+|J\cap O_i|)=\sum_{i=1}^{r}\Delta_iq_i.

Taking the conditional expectation, applying (9), and using Δi≥0\Delta_i\ge0, the right side is at least ∑i=1rΔi∑o∈Oi(1−t)aB(o)=∑o∈O(1−t)aB(o)vo\sum_{i=1}^{r}\Delta_i\sum_{o\in O_i}(1-t)^{a^B(o)}=\sum_{o\in O}(1-t)^{a^B(o)}v_o, where the last step again uses ∑i≥jΔi=voj\sum_{i\ge j}\Delta_i=v_{o_j}.

Taking B=O^B=\widehat{O} and averaging over TT gives the following bound on the expected prefix plus the full residual value.

Lemma 4.3. Consider the setting of Theorem 4.1, and let h=∣H∣h=|H| be the number of violating items. Then

E[P+OPT⁡(R)]≥v(O∩O^)+hh+1v((O∖O^)∩H)\mathbb{E}[P+\operatorname{OPT}(R)]\ge v(O\cap\widehat{O})+\frac{h}{h+1}v((O\setminus\widehat{O})\cap H)
+hh+2v((O∖O^)∖H)+1h+1v((O^∖O)∖H).(10)\qquad+\frac{h}{h+2}v((O\setminus\widehat{O})\setminus H)+\frac{1}{h+1}v((\widehat{O}\setminus O)\setminus H). \tag*{(10)}

Proof. Apply Lemma 4.2 with B=O^B=\widehat{O}. Then aO^(o)a^{\widehat{O}}(o) equals 00 for o∈O^o\in\widehat{O}, equals 11 for o∈H∖O^o\in H\setminus\widehat{O}, and equals 22 for o∈No\in N. Since TT is the minimum of hh independent uniform arrival times, P(T>t)=(1−t)h\mathbb{P}(T>t)=(1-t)^h, so TT has density h(1−t)h−1h(1-t)^{h-1} and E[(1−T)k]=h/(h+k)\mathbb{E}[(1-T)^k]=h/(h+k) for k=1,2k=1,2. In particular, E[T]=1−E[1−T]=1/(h+1)\mathbb{E}[T]=1-\mathbb{E}[1-T]=1/(h+1). Averaging the bound of Lemma 4.2 over TT gives

E[v(A∩O)+OPT⁡(R)]≥v(O∩O^)+hh+1v((O∖O^)∩H)+hh+2v((O∖O^)∖H).\mathbb{E}[v(A\cap O)+\operatorname{OPT}(R)]\ge v(O\cap\widehat{O})+\frac{h}{h+1}v((O\setminus\widehat{O})\cap H)+\frac{h}{h+2}v((O\setminus\widehat{O})\setminus H).

Next, an item o^∈(O^∖O)∖H\hat{o}\in(\widehat{O}\setminus O)\setminus H belongs to AA exactly when to^<Tt_{\hat{o}}<T, which has probability E[T]=1/(h+1)\mathbb{E}[T]=1/(h+1), and no other item of O^∖O\widehat{O}\setminus O belongs to AA. Thus E[v(A∖O)]=v((O^∖O)∖H)/(h+1)\mathbb{E}[v(A\setminus O)]=v((\widehat{O}\setminus O)\setminus H)/(h+1). Adding this to the display above and using P=v(A∩O)+v(A∖O)P=v(A\cap O)+v(A\setminus O) proves (10).

Proof of Theorem 4.1. We write P+pOPT⁡(R)=p(P+OPT⁡(R))+(1−p)PP+p\operatorname{OPT}(R)=p(P+\operatorname{OPT}(R))+(1-p)P. As shown in the proof of Lemma 4.3, E[P]=v(O^∖H)/(h+1)\mathbb{E}[P]=v(\widehat{O}\setminus H)/(h+1). Combining this with Lemma 4.3, and splitting O^∖H\widehat{O}\setminus H into its parts inside and outside OO, we obtain

E[P+pOPT⁡(R)]≥pv(O∩O^∩H)+(p+1−ph+1)v((O∩O^)∖H)+phh+1v((O∖O^)∩H)+phh+2v((O∖O^)∖H)+1h+1v((O^∖O)∖H).(11)\begin{aligned} \mathbb{E}[P+p\operatorname{OPT}(R)] \ge{}& pv(O\cap\widehat{O}\cap H)+\left(p+\frac{1-p}{h+1}\right)v((O\cap\widehat{O})\setminus H)\\ &+\frac{ph}{h+1}v((O\setminus\widehat{O})\cap H)+\frac{ph}{h+2}v((O\setminus\widehat{O})\setminus H)\\ &+\frac{1}{h+1}v((\widehat{O}\setminus O)\setminus H). \tag*{(11)} \end{aligned}

The coefficient of v((O^∖O)∖H)v((\widehat{O}\setminus O)\setminus H) is p/(h+1)+(1−p)/(h+1)=1/(h+1)p/(h+1)+(1-p)/(h+1)=1/(h+1), and the coefficient of v((O∩O^)∖H)v((O\cap\widehat{O})\setminus H) receives the additional term (1−p)/(h+1)(1-p)/(h+1) from the expected prefix value.

If h≥2h\ge2, each of the first four coefficients is at least p/2p/2, since the smallest is ph/(h+2)≥p/2ph/(h+2)\ge p/2. The last term is nonnegative, so the theorem follows from v(O)=OPT⁡v(O)=\operatorname{OPT}.

Now suppose H={f}H=\{f\}. The first three coefficients in (11) are at least p/2p/2, so the only coefficients that fall short are those of the non-violating elements of O∖O^O\setminus\widehat{O}, which equal p/3p/3. By the exchange property in the preliminaries applied to O^\widehat{O} and OO, there is a bijection ϕ:O∖O^→O^∖O\phi:O\setminus\widehat{O}\to\widehat{O}\setminus O such that (O^∖{ϕ(o)})∪{o}(\widehat{O}\setminus\{\phi(o)\})\cup\{o\} is a basis for every o∈O∖O^o\in O\setminus\widehat{O}. Since O^\widehat{O} maximizes the predicted value, v^o≤v^ϕ(o)\widehat{v}_o\le\widehat{v}_{\phi(o)} for every such oo.

Let o∈O∖O^o\in O\setminus\widehat{O} be non-violating, and suppose that ϕ(o)≠f\phi(o)\ne f, so that ϕ(o)\phi(o) is also non-violating. Then

(1−θ)vo≤v^o≤v^ϕ(o)≤(1+θ)vϕ(o).(1-\theta)v_o\le\widehat{v}_o\le\widehat{v}_{\phi(o)}\le(1+\theta)v_{\phi(o)}.

With p=1/(1+e)p=1/(1+e) and θ=(2e+1)/(2e+3)\theta=(2e+1)/(2e+3) we have (1−θ)/(1+θ)=p/2(1-\theta)/(1+\theta)=p/2, so vϕ(o)≥p2vov_{\phi(o)}\ge\frac{p}{2}v_o. The partner ϕ(o)\phi(o) lies in (O^∖O)∖H(\widehat{O}\setminus O)\setminus H and has coefficient 1/21/2 in (11). The two elements together contribute at least

p3vo+12vϕ(o)≥(p3+p4)vo≥p2vo.\frac{p}{3}v_o+\frac{1}{2}v_{\phi(o)}\ge\left(\frac{p}{3}+\frac{p}{4}\right)v_o\ge\frac{p}{2}v_o.

Since ϕ\phi is a bijection, no partner is used for two different elements, and the contributions of partners are disjoint from those of elements of OO. This covers every non-violating o∈O∖O^o\in O\setminus\widehat{O} unless f∈O^∖Of\in\widehat{O}\setminus O and o=o∗:=ϕ−1(f)o=o^*:=\phi^{-1}(f).

It remains to treat f∈O^∖Of\in\widehat{O}\setminus O and the element o∗o^*. Here we improve the coefficient of vo∗v_{o^*} by changing the reference basis in Lemma 4.2. By the exchange property, B~=(O^∖{f})∪{o∗}\widetilde{B}=(\widehat{O}\setminus\{f\})\cup\{o^*\} is a basis, and it contains O^∖H=O^∖{f}\widehat{O}\setminus H=\widehat{O}\setminus\{f\}. The sets AA, DD and RR, and hence the algorithm, are unchanged; only the analysis uses B~\widetilde{B}. Since f∉Of\notin O, no element of OO is violating. We have aB~(o)=0a_{\widetilde{B}}(o)=0 for o∈O∩O^o\in O\cap\widehat{O}; aB~(o∗)=1a_{\widetilde{B}}(o^*)=1, because o∗∈B~∩No^*\in\widetilde{B}\cap N; and aB~(o)=2a_{\widetilde{B}}(o)=2 for every other o∈O∖O^o\in O\setminus\widehat{O}. For h=1h=1, TT is uniform on [0,1][0,1], so E[1−T]=1/2\mathbb{E}[1-T]=1/2 and E[(1−T)2]=1/3\mathbb{E}[(1-T)^2]=1/3. Averaging Lemma 4.2 over TT as in the proof of Lemma 4.3 therefore shows that (10) holds with the coefficient of vo∗v_{o^*} equal to 1/21/2 instead of 1/31/3, and with all other coefficients unchanged. In (11), the coefficient of vo∗v_{o^*} thus becomes p/2p/2. Every other element of O∖O^O\setminus\widehat{O} has a non-violating partner and is covered by the previous paragraph. Hence the total weight on every element of OO is at least p/2p/2, which completes the proof. □\square

Fractional Knapsack Secretary

We next show that (6) holds for the fractional knapsack secretary problem (Problem 2.1).

Problem-Specific Notation. Let x^\widehat{x} be the predicted optimal allocation and let x∗x^* be a true optimal allocation, so OPT⁡=v⋅x∗\operatorname{OPT}=v\cdot x^*. Let HH be the set of violating items (Definition 2.4), let G=[n]∖HG=[n]\setminus H, and let h=∣H∣h=|H|. We consider instances with h≥1h\ge1. Let ff be the first violating item to arrive and let T=tfT=t_f. Before time TT, the algorithm sees only items of GG, and it accepts the fraction x^i\hat{x}_i of each. The value of the prefix and the capacity it consumes are therefore

P=∑i∈G:ti<Tvix^iandW=∑i∈G:ti<Twix^i.P = \sum_{i\in G:t_i<T} v_i\hat{x}_i \qquad\text{and} \qquad W = \sum_{i\in G:t_i<T} w_i\hat{x}_i.

The residual instance RR consists of ff and all later items, and the remaining capacity is C=1−WC = 1-W. We write OPT⁡(R,C)\operatorname{OPT}(R,C) for the maximum value of a fractional allocation of the items in RR that uses capacity at most CC. At ff, the algorithm accepts the fraction min⁡{1,C/wf}\min\{1,C/w_f\} of ff with probability pp, and rejects ff otherwise.

Theorem 4.4. For any input instance to Problem 2.1 with at least one violating item,

E[P+pOPT⁡(R,C)]≥p2OPT⁡.\mathbb{E}[P+p\operatorname{OPT}(R,C)] \ge\frac{p}{2}\operatorname{OPT}.

Proof. Let ω=∑i∈Gwix^i\omega=\sum_{i\in G}w_i\hat{x}_i be the capacity used by x^\hat{x} on GG, let ℓ=∑i∈Gvixi∗\ell=\sum_{i\in G}v_ix_i^* be the value that x∗x^* obtains from GG, and let u=∑i∈Gvix^iu=\sum_{i\in G}v_i\hat{x}_i be the true value that x^\hat{x} obtains from GG. Let a=ℓ/OPT⁡a=\ell/\operatorname{OPT}. Since x^\hat{x} and x∗x^* are feasible, ω∈[0,1]\omega\in[0,1] and a∈[0,1]a\in[0,1].

We first lower bound uu. The restriction of x^\hat{x} to GG maximizes the predicted value among allocations of the items in GG with total weight at most ω\omega, since otherwise we could improve x^\hat{x} by replacing this restriction and keeping its values on HH. The allocation ω⋅xG∗\omega\cdot x_G^* is feasible for this smaller capacity, because xG∗x_G^* has total weight at most 11. Combining this with the prediction bounds on GG, we get

u≥11+θ∑i∈Gv^ix^i≥ω1+θ∑i∈Gv^ixi∗≥1−θ1+θωℓ=pωℓ2.(12)u\ge\frac{1}{1+\theta}\sum_{i\in G}\hat{v}_i\hat{x}_i\ge\frac{\omega}{1+\theta}\sum_{i\in G}\hat{v}_ix_i^*\ge\frac{1-\theta}{1+\theta}\omega\ell=\frac{p\omega\ell}{2}. \tag*{(12)}

Now condition on T=tT=t. Since TT depends only on the arrival times of items in HH, each item of GG arrives before time tt independently with probability tt. Hence E[P∣T=t]=tu≥tpωℓ/2\mathbb{E}[P\mid T=t]=tu\ge tp\omega\ell/2 by (12). For the residual value, let L=∑i∈G:ti<tvixi∗L=\sum_{i\in G:t_i<t}v_ix_i^* be the value that x∗x^* obtains from items that arrive before tt. The restriction of x∗x^* to the items of RR has value OPT⁡−L\operatorname{OPT}-L and total weight at most 11, so scaling it by C=1−WC=1-W gives an allocation that is feasible in RR with capacity CC. Therefore OPT⁡(R,C)≥(1−W)(OPT⁡−L)\operatorname{OPT}(R,C)\ge(1-W)(\operatorname{OPT}-L). The variables WW and LL are weighted sums of the same independent indicators 1{ti<t}\mathbf{1}_{\{t_i<t\}} for i∈Gi\in G, each with mean tt. This gives E[W∣T=t]=tω\mathbb{E}[W\mid T=t]=t\omega and E[L∣T=t]=tℓ\mathbb{E}[L\mid T=t]=t\ell. Moreover, E[WL∣T=t]≥t2ωℓ\mathbb{E}[WL\mid T=t]\ge t^2\omega\ell, since the product of two distinct indicators has mean t2t^2 and the product of an indicator with itself has mean t≥t2t\ge t^2. It follows that

E[OPT⁡(R,C)∣T=t]≥(1−tω)(OPT⁡−tℓ).\mathbb{E}[\operatorname{OPT}(R,C)\mid T=t]\ge(1-t\omega)(\operatorname{OPT}-t\ell).

Combining the bounds on prefix and residual values,

E[P+pOPT⁡(R,C)∣T=t]≥tpωℓ2+p(1−tω)(OPT⁡−tℓ)=pOPT⁡+t(pωℓ2−pωOPT⁡−pℓ)+t2pωℓ.(13)\begin{aligned} \mathbb{E}[P+p\operatorname{OPT}(R,C)\mid T=t] &\ge t\frac{p\omega\ell}{2}+p(1-t\omega)(\operatorname{OPT}-t\ell)\\ &=p\operatorname{OPT}+t\left(\frac{p\omega\ell}{2}-p\omega\operatorname{OPT}-p\ell\right)+t^2p\omega\ell. \tag*{(13)} \end{aligned}

It remains to average over TT. Since TT is the minimum of hh independent uniform arrival times, it has density h(1−t)h−1h(1-t)^{h-1}, so E[T]=1/(h+1)\mathbb{E}[T]=1/(h+1) and E[T2]=2/((h+1)(h+2))\mathbb{E}[T^2]=2/((h+1)(h+2)). Substituting these into (13) and dividing by OPT⁡\operatorname{OPT} gives

E[P+pOPT⁡(R,C)]OPT⁡≥p−p(ω+a)h+1+pωa2(h+1)+2pωa(h+1)(h+2).\frac{\mathbb{E}[P+p\operatorname{OPT}(R,C)]}{\operatorname{OPT}} \ge p-\frac{p(\omega+a)}{h+1}+\frac{p\omega a}{2(h+1)}+\frac{2p\omega a}{(h+1)(h+2)}.

The right side is bilinear in (ω,a)(\omega,a), so over [0,1]2[0,1]^2 its minimum is attained at a corner. The values at the corners (0,0)(0,0), (0,1)(0,1), (1,0)(1,0) and (1,1)(1,1) are

p,phh+1,phh+1,phh+2+p2(h+1).p,\qquad\frac{ph}{h+1},\qquad\frac{ph}{h+1},\qquad\frac{ph}{h+2}+\frac{p}{2(h+1)}.

Each is at least p/2p/2. This is clear for the first three since h≥1h \ge1. For the last, h/(h+2)≥1/2h/(h+2) \ge1/2 if h≥2h \ge2, and for h=1h=1 the value is 7p/127p/12. Hence E[P+pOPT⁡(R,C)]≥p2OPT⁡\mathbb{E}[P+p\operatorname{OPT}(R,C)] \ge\frac{p}{2}\operatorname{OPT}.

Bipartite Matching

Finally, we show that (6) holds for online bipartite matching with random arrivals (Problem 2.2).

Problem-Specific Notation. We write each edge as e=(i,u)e=(i,u), with online endpoint i∈[n]i \in[n] and offline endpoint u∈Uu \in U. Let M^\widehat{M} and M∗M^* be the matchings of maximum predicted and true value, and for a set of edges AA write v(A)=∑e∈Avev(A)=\sum_{e\in A}v_e and v^(A)=∑e∈Av^e\widehat{v}(A)=\sum_{e\in A}\widehat{v}_e. Let HH be the set of violating vertices (Definition 2.4) and let h=∣H∣≥1h=|H|\ge1. Let ff be the first violating vertex to arrive and let T=tfT=t_f. Before time TT, whenever a vertex arrives, the algorithm adds its edge in M^\widehat{M} if it has one. Let PP be the total true value of these edges. The residual instance RR consists of ff and all later vertices, together with the offline vertices that are not matched before TT.

Theorem 4.5. For any input instance to Problem 2.2 with at least one violating vertex,

E[P+pOPT⁡(R)]≥p2OPT⁡.\mathbb{E}[P+p\operatorname{OPT}(R)]\ge\frac{p}{2}\operatorname{OPT}.

Proof. Say that an edge e=(i,u)∈M∗e=(i,u)\in M^* survives if ii is in RR and uu is not matched before TT. The surviving edges of M∗M^* form a matching in RR, so OPT⁡(R)\operatorname{OPT}(R) is at least their total value. Let BeB_e consist of ii if i∉Hi\notin H, together with the online endpoint i′i' of the edge of M^\widehat{M} at uu if this edge exists and i′∉Hi'\notin H. Then ee survives exactly when every vertex of BeB_e arrives after TT, that is, when the first vertex to arrive among H∪BeH\cup B_e belongs to HH. The sets HH and BeB_e are disjoint and ∣Be∣≤2|B_e|\le2, so

P(e survives)=hh+∣Be∣≥hh+2.(14)\mathbb{P}(e\text{ survives})=\frac{h}{h+|B_e|}\ge\frac{h}{h+2}. \tag*{(14)}

If h≥2h\ge2, this probability is at least 1/21/2 for every edge of M∗M^*. Hence E[OPT⁡(R)]≥OPT⁡/2\mathbb{E}[\operatorname{OPT}(R)]\ge\operatorname{OPT}/2, and since P≥0P\ge0 we get E[P+pOPT⁡(R)]≥pE[OPT⁡(R)]≥p2OPT⁡\mathbb{E}[P+p\operatorname{OPT}(R)]\ge p\mathbb{E}[\operatorname{OPT}(R)]\ge\frac{p}{2}\operatorname{OPT}.

Now suppose H={f}H=\{f\}. Let M^\widehat{M} be the set of edges of M^\widehat{M} whose online endpoint is not ff. Each edge of M^\widehat{M} is accepted before ff with probability 1/21/2, so E[P]=12v(M^)\mathbb{E}[P]=\frac{1}{2}v(\widehat{M}). Let QQ be the set of edges (i,u)∈M∗∖M^(i,u)\in M^*\setminus\widehat{M} with i≠fi\ne f such that uu is matched in M^\widehat{M} to a vertex i′≠fi'\ne f. For e∈Qe\in Q the vertices ff, ii and i′i' are distinct, and ee survives exactly when ff arrives before both ii and i′i'. This has probability 1/31/3. Every other edge e∈M∗e\in M^* has ∣Be∣≤1|B_e|\le1, so it survives with probability at least 1/21/2 by (14). Therefore

E[OPT⁡(R)]≥13v(Q)+12v(M∗∖Q).\mathbb{E}[\operatorname{OPT}(R)]\ge\frac{1}{3}v(Q)+\frac{1}{2}v(M^*\setminus Q).

It remains to relate v(M^)v(\widehat{M}) to v(Q)v(Q). Let Γ⊆M^\Gamma\subseteq\widehat{M} be the set of predicted edges incident to an endpoint of an edge in QQ. Since Q⊆M∗Q\subseteq M^* is a matching, replacing Γ\Gamma by QQ in M^\widehat{M} gives a matching, and predicted optimality gives v^(Γ)≥v^(Q)\widehat{v}(\Gamma)\ge\widehat{v}(Q). Every edge in QQ has an online endpoint other than ff; this holds by definition for edges of QQ, for predicted edges at the online endpoint of an edge of QQ, and, by the definition of QQ, for predicted edges at its offline endpoint. All these edges are therefore non-violating, and

(1−θ)v(Q)≤v^(Q)≤v^(Γ)≤(1+θ)v(Γ).(1-\theta)v(Q)\le\widehat{v}(Q)\le\widehat{v}(\Gamma)\le(1+\theta)v(\Gamma).

Since Γ⊆M‾\Gamma\subseteq\overline{M} and (1−θ)/(1+θ)=p/2(1-\theta)/(1+\theta)=p/2, this gives v(M‾)≥v(Γ)≥p2v(Q)v(\overline{M}) \ge v(\Gamma) \ge\frac{p}{2}v(Q). Combining the bounds on E[P]\mathbb{E}[P] and E[OPT⁡(R)]\mathbb{E}[\operatorname{OPT}(R)],

E[P+pOPT⁡(R)]≥12v(M‾)+p(13v(Q)+12v(M∗∖Q))≥(p4+p3)v(Q)+p2v(M∗∖Q)≥p2v(M∗),\begin{aligned} \mathbb{E}[P+p\operatorname{OPT}(R)] &\ge\frac{1}{2}v(\overline{M})+p\left(\frac{1}{3}v(Q)+\frac{1}{2}v(M^*\setminus Q)\right)\\ &\ge\left(\frac{p}{4}+\frac{p}{3}\right)v(Q)+\frac{p}{2}v(M^*\setminus Q)\\ &\ge\frac{p}{2}v(M^*), \end{aligned}

which proves the theorem.

Integral Knapsack Secretary

In this section we show that, despite the positive result for fractional knapsack secretary, the integral version does not admit a nontrivial consistency–robustness tradeoff. Accepting a small item can make a later item of weight one infeasible, and the value of that later item may be underestimated by the prediction. Formally, we show:

Theorem 5.1. Fix δ∈[0,1]\delta\in[0,1]. Any algorithm for integral knapsack secretary that achieves expected value at least (1−δ)OPT⁡(1-\delta)\operatorname{OPT} whenever all predictions are correct has worst-case competitive ratio at most δ\delta.

The bound of Theorem 5.1 is tight up to a constant factor. Consider the algorithm that runs the 0.178-competitive prediction-free algorithm of Balkanski et al. [11] with probability δ\delta, and follows the predicted optimum otherwise. It achieves expected value at least (1−δ)OPT⁡(1-\delta)\operatorname{OPT} whenever all predictions are correct, and has worst-case competitive ratio 0.178δ0.178\delta.

Proof. The idea is to use many weight-one items as “traps.” On an instance with correct predictions, consistency forces the algorithm to accept small items early, so most weight-one items arrive when the knapsack is already nonempty and therefore cannot be accepted. We then make one such item very valuable. The algorithm cannot notice this change before that item arrives.

Fix an integer k≥2k \ge2. There are kk small items, each with weight and value 1/k1/k, and kk large items, each with weight 11 and value 1/k1/k. All predictions are correct, and OPT⁡=1\operatorname{OPT}=1, achieved by taking all small items. Let ALG⁡0\operatorname{ALG}_0 be the algorithm’s value, and let XX be the number of small items it rejects. A large item fits only into an empty knapsack, so at most one large item is accepted. Hence ALG⁡0≤(k−X)/k+1/k\operatorname{ALG}_0 \le(k-X)/k+1/k. By consistency, E[ALG⁡0]≥1−δ\mathbb{E}[\operatorname{ALG}_0]\ge1-\delta, and therefore

E[X]≤δk+1.(15)\mathbb{E}[X]\le\delta k+1. \tag*{(15)}

For a large item zz, let EzE_z be the event that the knapsack is empty when zz arrives, and let N=∑z large1EzN=\sum_{z\ \mathrm{large}}\mathbf{1}_{E_z}. Let LtL_t and StS_t be the numbers of large and small items among the first tt arrivals, and let Y=max⁡0≤t≤2k(Lt−St)≥0Y=\max_{0\le t\le2k}(L_t-S_t)\ge0. Note that YY depends only on the arrival order, not on the algorithm.

Let ss be the arrival position of the first accepted item, or s=2ks=2k if nothing is accepted. Exactly the large items among the first ss arrivals see an empty knapsack, so N=LsN=L_s. Every small item among the first ss arrivals is rejected, except possibly the one at position ss. Therefore Ss≤X+1S_s\le X+1, and

N=Ss+(Ls−Ss)≤X+1+Y.N=S_s+(L_s-S_s)\le X+1+Y.

It remains to bound E[Y]\mathbb{E}[Y]. The arrival order induces a uniformly random ±1\pm1 path from 0 to 0 with 2k2k steps, where each large arrival is a +1+1 step and each small arrival is a −1-1 step. For 1≤r≤k1\le r\le k, reflecting a path after it first reaches level rr gives a bijection between paths that reach rr and all ±1\pm1 paths ending at 2r2r. Hence

P(Y≥r)=(2kk+r)(2kk)=∏j=1rk−j+1k+j≤∏j=1r(1−2j−12k)≤e−r2/(2k).\mathbb{P}(Y \ge r)=\frac{\binom{2k}{k+r}}{\binom{2k}{k}}=\prod_{j=1}^{r}\frac{k-j+1}{k+j}\le\prod_{j=1}^{r}\left(1-\frac{2j-1}{2k}\right)\le e^{-r^2/(2k)}.

so E[Y]=∑r≥1P(Y≥r)≤∫0∞e−x2/(2k) dx=πk/2\mathbb{E}[Y]=\sum_{r\ge1}\mathbb{P}(Y\ge r)\le\int_{0}^{\infty}e^{-x^2/(2k)}\,dx=\sqrt{\pi k/2}. Combining this with (15) gives

1k∑z largeP(Ez)=E[N]k≤δ+2k+π2k(16)\frac{1}{k}\sum_{z\ \mathrm{large}}\mathbb{P}(E_z)=\frac{\mathbb{E}[N]}{k}\le\delta+\frac{2}{k}+\sqrt{\frac{\pi}{2k}} \tag*{(16)}

By (16), some large item z∗z^* satisfies P(Ez∗)≤δ+2/k+π/(2k)\mathbb{P}(E_{z^*})\le\delta+2/k+\sqrt{\pi/(2k)}. This item depends only on the algorithm and the accurate instance, not on the random order. Change the true value of z∗z^* to kk, while keeping its weight 11 and its prediction 1/k1/k. Use the same arrival order and the same internal randomness in both instances. Before z∗z^* arrives, the algorithm sees exactly the same input, so it makes the same decisions. In particular, Ez∗E_{z^*} is the same event in both runs.

On the modified instance, OPT1=k\mathrm{OPT}_1=k. The algorithm can accept z∗z^* only on Ez∗E_{z^*}. Without z∗z^*, its value is at most 11. Therefore

E[ALG1]OPT1≤P(Ez∗)+1k≤δ+3k+π2k.\frac{\mathbb{E}[\mathrm{ALG}_1]}{\mathrm{OPT}_1}\le\mathbb{P}(E_{z^*})+\frac{1}{k}\le\delta+\frac{3}{k}+\sqrt{\frac{\pi}{2k}}.

Letting k→∞k\to\infty shows that the worst-case competitive ratio is at most δ\delta.

AI Methodology. We used ChatGPT and Claude to assist with the refinement of material in § 4 and § 5. The authors verified the correctness of all content, including all mathematical arguments and references, and take full responsibility for the paper.

References

  1. [1]Hamed Abdi, Kiarash Banihashem, MohammadTaghi Hajiaghayi, Zhiyi Huang, Danny Mittal, and Sahil Singla. As easy as rank one: Optimal algorithms for matroid secretary and single-sample matroid prophet. arXiv:2611.08869, 2026.arxiv.org/abs/2611.08869
  2. [2]Susanne Albers. Online algorithms: A survey. Mathematical Programming, 97(1–2):3–26, 2003.DOI
  3. [3]Antonios Antoniadis, Christian Coester, Marek Eliáš, Adam Polak, and Bertrand Simon. Online metric algorithms with untrusted predictions. In Proceedings of the 37th International Conference on Machine Learning (ICML), pages 345–355, 2020.arxiv.org/abs/2003.02144
  4. [4]Antonios Antoniadis, Themis Gouleakis, Pieter Kleer, and Pavel Kolev. Secretary and online matching problems with machine learned advice. Discrete Optimization, 48, 2023.arxiv.org/abs/2006.01026
  5. [5]Moshe Babaioff, Nicole Immorlica, David Kempe, and Robert Kleinberg. A knapsack secretary problem with applications. In Proceedings of the 10th International Workshop on Approximation and the 11th International Workshop on Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM), 2007a.DOI
  6. [6]Moshe Babaioff, Nicole Immorlica, and Robert Kleinberg. Matroids, secretary problems, and online mechanisms. In Proceedings of the 18th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2007b.DOI
  7. [7]Moshe Babaioff, Nicole Immorlica, David Kempe, and Robert Kleinberg. Online auctions and generalized secretary problems. ACM SIGecom Exchanges, 7(2), 2008.DOI
  8. [8]Moshe Babaioff, Nicole Immorlica, David Kempe, and Robert Kleinberg. Matroid secretary problems. Journal of the ACM, 65(6):35:1–35:26, 2018.DOI
  9. [9]Ashwinkumar Badanidiyuru, Robert Kleinberg, and Yaron Singer. Learning on a budget: Posted price mechanisms for online procurement. In Proceedings of the 13th ACM Conference on Electronic Commerce (EC), pages 128–145, 2012.
  10. [10]Maryam Bahrani, Hedyeh Beyhaghi, Sahil Singla, and S. Matthew Weinberg. Formal barriers to simple algorithms for the matroid secretary problem. In Web and Internet Economics (WINE), 2021.arxiv.org/abs/2111.04114
  11. [11]Eric Balkanski, Jason Chatzitheodorou, Dimitris Fotakis, and Thanos Tolias. The knapsack secretary problem is strictly harder than the secretary problem. arXiv:2607.22840, 2026.arxiv.org/abs/2607.22840
  12. [12]Allan Borodin and Ran El-Yaniv. Online Computation and Competitive Analysis. Cambridge University Press, 1998.
  13. [13]Davin Choo and Chun Kai Ling. A short note about the learning-augmented secretary problem. arXiv:2410.06583, 2024.arxiv.org/abs/2410.06583
  14. [14]José Correa, Patricio Fonseca, Ruben Hoeksma, Tim Oosterwijk, and Tjark Vredeveld. Recent developments in prophet inequalities. ACM SIGecom Exchanges, 17(1):61–70, 2019.DOI
  15. [15]John P. Dickerson, Karthik Abinav Sankararaman, Aravind Srinivasan, and Pan Xu. Allocation problems in ride-sharing platforms: Online matching with offline reusable resources. In Proceedings of the 32nd AAAI Conference on Artificial Intelligence (AAAI), pages 1007–1014, 2018.
  16. [17]Michael Dinitz and Guy Kortsarz. Matroid secretary for regular and decomposable matroids. In Proceedings of the 24th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2013.arxiv.org/abs/1207.5146
  17. [18]Paul Dütting, Silvio Lattanzi, Renato Paes Leme, and Sergei Vassilvitskii. Secretaries with advice. In Proceedings of the 22nd ACM Conference on Economics and Computation (EC), 2021.
  18. [19]Evgenii Borisovich Dynkin. The optimum choice of the instant for stopping a Markov process. Soviet Mathematics, 4:627–629, 1963.
  19. [20]Ran El-Yaniv, Amos Fiat, Richard M. Karp, and Gordon Turpin. Optimal search and one-way trading online algorithms. Algorithmica, 30(1):101–139, 2001.
  20. [21]Jon Feldman, Nitish Korula, Vahab Mirrokni, S. Muthukrishnan, and Martin Pál. Online ad assignment with free disposal. In Proceedings of the 5th International Workshop on Internet and Network Economics (WINE), pages 374–385, 2009.DOI
  21. [22]Moran Feldman, Ola Svensson, and Rico Zenklusen. A simple O(log log(rank))-competitive algorithm for the matroid secretary problem. In Proceedings of the 26th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2015.
  22. [23]Thomas S. Ferguson. Who solved the secretary problem? Statistical Science, 4(3):282–296, 1989.
  23. [24]Peter R. Freeman. The secretary problem and its extensions: A review. International Statistical Review, pages 189–206, 1983.DOI
  24. [25]Kaito Fujii and Yuichi Yoshida. The secretary problem with predictions. Mathematics of Operations Research, 49(2):1241–1262, 2024.DOI
  25. [26]Jeff Giliberti and Andreas Karrenbauer. Improved online algorithm for fractional knapsack in the random order model. In Proceedings of the 19th Workshop on Approximation and Online Algorithms, 2021.DOI
  26. [27]Ronald L. Graham. Bounds for certain multiprocessing anomalies. Bell System Technical Journal, 45(9):1563–1581, 1966.DOI
  27. [28]Theodore P. Hill and Robert P. Kertz. A survey of prophet inequalities in optimal stopping theory. Contemporary Mathematics, 125:191–207, 1992.DOI
  28. [29]Chien-Ju Ho and Jennifer Wortman Vaughan. Online task assignment in crowdsourcing markets. In Proceedings of the 26th AAAI Conference on Artificial Intelligence (AAAI), 2012.
  29. [30]Zhiyi Huang. Settling the matroid secretary problem. arXiv:2609.30421, 2026.arxiv.org/abs/2609.30421
  30. [31]Patrick Jaillet, José A. Soto, and Rico Zenklusen. Advances on matroid secretary problems: Free order model and laminar case. In Integer Programming and Combinatorial Optimization (IPCO), 2013.arxiv.org/abs/1207.1333
  31. [32]Helia Karisani, Mohammadreza Daneshvaramoli, Hedyeh Beyhaghi, Mohammad Hajiesmaili, and Cameron Musco. The secretary problem with predictions and a chosen order. In Proceedings of the 17th Conference on Innovations in Theoretical Computer Science (ITCS), 2026.
  32. [33]Thomas Kesselheim, Klaus Radke, Andreas Tönnis, and Berthold Vöcking. An optimal online algorithm for weighted bipartite matching and extensions to combinatorial auctions. In Proceedings of the 21st European Symposium on Algorithms (ESA), 2013.
  33. [34]Robert Kleinberg. A multiple-choice secretary algorithm with applications to online auctions. In Proceedings of the 16th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2005.DOI
  34. [35]Max Klimm and Martin Knaack. Generalized assignment and knapsack problems in the random-order model. Mathematical Programming, 2026.
  35. [36]Ulrich Krengel and Louis Sucheston. Semiamarts and finite values. Bulletin of the American Mathematical Society, 83(4):745–747, 1977.DOI
  36. [37]Oded Lachish. O(log log rank) competitive ratio for the matroid secretary problem. In Proceedings of the 55th Annual IEEE Symposium on Foundations of Computer Science (FOCS), 2014.arxiv.org/abs/1403.7343
  37. [38]Brendan Lucier. An economic view of prophet inequalities. ACM SIGecom Exchanges, 16(1):24–47, 2017.DOI
  38. [39]Thodoris Lykouris and Sergei Vassilvitskii. Competitive caching with machine learned advice. In Proceedings of the 35th International Conference on Machine Learning (ICML), 2018.arxiv.org/abs/1802.05399
  39. [40]Aranyak Mehta. Online matching and ad allocation. Foundations and Trends in Theoretical Computer Science, 8(4):265–368, 2013.DOI
  40. [41]Aranyak Mehta, Amin Saberi, Umesh Vazirani, and Vijay Vazirani. AdWords and generalized online matching. Journal of the ACM, 54(5):22, 2007.DOI
  41. [42]Shayan Oveis Gharan and Jan Vondrák. On variants of the matroid secretary problem. Algorithmica, 67(4): 472–497, 2013.
  42. [43]Manish Purohit, Zoya Svitkina, and Ravi Kumar. Improving online algorithms via ML predictions. In Advances in Neural Information Processing Systems 31 (NeurIPS), 2018.
  43. [44]Ester Samuel-Cahn. Comparison of threshold stop rules and maximum for independent nonnegative random variables. The Annals of Probability, 12(4):1213–1216, 1984.
  44. [45]Alexander Schrijver. Combinatorial Optimization: Polyhedra and Efficiency. Springer, 2003.
  45. [46]Sahil Singla. The matroid secretary conjecture is true. arXiv:2609.14555, 2026.arxiv.org/abs/2609.14555
  46. [47]José A. Soto. Matroid secretary problem in the random assignment model. In Proceedings of the 22nd Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2011.
  47. [48]Bo Sun, Russell Lee, Mohammad Hajiesmaili, Adam Wierman, and Danny Tsang. Pareto-optimal learning-augmented algorithms for online conversion problems. In Advances in Neural Information Processing Systems 34 (NeurIPS), 2021.arxiv.org/abs/2109.01556
  48. [49]Yunhong Zhou, Deeparnab Chakrabarty, and Rajan Lukose. Budget constrained bidding in keyword auctions and online knapsack problems. In Proceedings of the 4th International Workshop on Internet and Network Economics (WINE), pages 566–576, 2008.

Paper details

vlnc:W_68h23un2
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 3

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents