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 , this approach achieves competitive ratio , where is the maximum relative error of any prediction. That is, the algorithm is perfectly consistent, achieving competitive ratio as , and robust up to a constant factor relative to the worst-case baseline. For all three problems we study, , 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 items indexed by the integers , with unknown positive values . Each item corresponds to an element of a known matroid .
The goal is to select a set that maximizes the total value subject to being an independent set of .
The items are assigned uniform and independent random arrival times , and are processed in increasing order of arrival time.1
When an item arrives, the decision-maker observes its value , and must irrevocably decide to add to the output set (assuming doing so is feasible) or reject it.
The decision-maker is given positive predicted values 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 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 , we have the -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 has been obtained [30, 1].
A related natural variant of the secretary problem is knapsack secretary [5], where each item has a known weight and the selected set must satisfy . 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 for each item, attempting to maximize subject to .
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 , subject to 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 —i.e., the expected total value output by the algorithm is at least a 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 -secretary variants. For the classic secretary problem, they give an algorithm with competitive ratio , where
is the maximum relative error of any value prediction. That is, as the predictions become more accurate (i.e., ), the algorithm achieves competitive ratio approaching . Thus, the algorithm is consistent. However, even when the error is unbounded, the algorithm achieves a worst-case competitive ratio of . Thus, the algorithm is robust. Fujii and Yoshida’s bound was later slightly improved to by Karisani et al. [32]. No algorithm can achieve better than , as is the optimal competitive ratio even when the predictions are completely uninformative. In fact, Choo and Ling [13] show a stronger upper bound of —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
where is the maximum relative error among all item or edge predictions.
As discussed, for all three problems, it is known that competitive ratio is optimal when no value predictions are given. Thus, our robustness bound of 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 when the predictions exactly equal the true values has worst-case competitive ratio at most . An algorithm matching this bound up to a constant factor can be obtained simply by running a worst-case algorithm with probability 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 be the optimal solution under the predicted values, it selects items according to . 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 , 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 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 , as in Fujii and Yoshida [25], then 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 .
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 . 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 black-box.
Let be the index of the first violating item. Let 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 be the optimal residual value for all items after the first violation , assuming that we reject . Let be the worst-case competitive ratio of . Our algorithm will accept with probability (assuming that doing so is feasible), and otherwise reject it. Let if accepting is feasible, and otherwise. The accepting branch contributes at least to the expected output value. The rejecting branch contributes at least . In total, the expected value of the output is thus at least
where the inequality follows since obtains at most value from , and its remaining choices are feasible for . For all three problems we consider (matroid secretary, knapsack secretary, and online matching), . Thus, if we can show that for some constant , we will have a worst-case competitive ratio when there is at least one violating item. Combining this with the case of no violating items (Lemma 2.3) gives a bound of , 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 . 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 in the true optimal matching whose offline endpoint is matched by some edge in the predicted optimal matching. Note that is available and feasible to include in exactly when the online endpoints of both and arrive at or after the first violation . Further, this event happens with probability at least : the worst case is when and are both non-violating, and there is a single violating item . The event happens exactly when arrives first out of the three items—i.e., with probability . If the online endpoint of or is violating, it must arrive at or after (since is the first violation) and so the probability only increases. Thus, in expectation, edges carrying at least a fraction of the optimal value are feasible to include in , and so we have . Combined with (2) this yields a 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 be the set of ‘violating’ items with large prediction error, let be the predicted optimal basis, and let be the true optimal basis. Let denote the arrival time of the first violation, and condition on . By then, the algorithm has accepted a set and discarded a set of items outside . Fix any , and let be the highest-value items of . Let be the subset of these items that are not discarded before the first violation. Note that , since each item arrives before time with probability at most (probability exactly for non-violating items, and probability for violating items, since is the time of the first violation). While items in have not been discarded before the first violation, they may be blocked by the accepted items . We next bound the probability of this occurring. By the basis exchange property (see § 2), there is a basis with . Let be the set of ‘conflicting’ items in that would potentially block items in . Accepted items in but outside lie in , so together with they form an independent set and block nothing in . On the other hand, each accepted item in blocks at most one item of . In addition, an item of that arrives before the first violation is itself accepted, so it is no longer available in the residual. We can observe that : to form the basis with we remove exactly the items from , replacing them with the items . Thus, we have . Each item of and each item of arrives before the first violation, and is thus accepted, with probability at most . So the expected number of items of that are blocked or already accepted is at most . Overall, the expected number of items from available for use in , conditioning on a first violation at time , is at least . Applying this bound to for every , and using that , gives .
Knapsack Secretary. Finally, for fractional knapsack secretary, we let be the capacity consumed by following the predicted optimal solution before the first violation. We let 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 and uses capacity at most . Scaling this allocation by the remaining capacity therefore gives a feasible residual allocation, so .
Conditioning on the first violation arriving at time , each non-violating item arrives before with probability , while no violating item does. Thus, and . Moreover, conditional on , and are positively correlated: both are nonnegative weighted sums of the same independent indicators for whether an item arrives before . It follows that
Again using that gives .
Tightness of Residual Bound. Unfortunately, it is not hard to see that the bound of 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 , along with optimal and predicted optimal items and , is only available to include in if arrives first—which happens with probability . If arrives second, either is rejected before the first violation, or is accepted, meaning that cannot be later accepted. If arrives last, then there are no remaining items in the residual. Given this, we have . A slightly better bound can indeed be proven since if neither nor is a violating item, they must have relatively comparable values. However, it is not strong enough to give the competitive ratio of Theorem 1.2.
Tighter Bounds via Prefix + Residual Analysis. Given this, the analysis of Theorem 1.2 must look beyond just . In particular, we need to use that when is small, it is because the algorithm has already collected value before the first violation, and this value must be accounted for. We let 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 on all items arriving at or after the first violation. Thus, its expected total value is at least . 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 , yielding the bound of Theorem 1.2. Very roughly, in all three cases, we argue that being small makes large, obtaining a stronger bound than when bounding 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 known ahead of time to the decision-maker.
The goal is to select fractions that maximize the total value subject to the knapsack constraint .
When an item arrives, the decision-maker observes its value and must irrevocably choose its fraction , subject to the capacity left by earlier decisions.
The integral version, which we discuss in § 5, further requires 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 , with unknown positive edge values for .
The goal is to select a set that maximizes the total value subject to being a matching, i.e., no two selected edges share an endpoint.
The vertices in are assigned uniform and independent random arrival times , 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 , subject to the matching constraint, or reject the vertex.
The decision-maker is given predicted values for every edge 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 ; for matching, arriving vertices are indexed by but edges are indexed by . Let denote the corresponding coordinate set: for matroid and knapsack and for matching. For all three problems, arrivals are indexed by . We let denote the set of coordinates whose values are revealed at arrival . In matroid and knapsack secretary, is simply the singleton containing element . For online matching, is the set of edges incident to the arriving vertex .
We write and for the true and predicted values on the coordinates in . Each problem requires selecting a decision vector , with for matroid elements and matching edges and for fractional-knapsack items. Let be the set of decision vectors satisfying the corresponding feasibility constraints. In all cases, is known to the decision-maker in advance.
A decision vector has value . We denote the predicted and true optimum decisions by
We assume that a deterministic tie-breaking rule guarantees a unique optimum for any value vector.
The maximum relative prediction error is defined in (1), with the maximum taken over all coordinates in . We work with the equivalent definition: is the minimum value such that
If the prediction error 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 , the predicted optimal solution has value at least .
Proof. Using (4) we can bound:
As discussed, our general algorithm will follow the predicted optimum 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 . In matroid and knapsack secretary, item is a violation if . In online matching, an arriving vertex is a violation if at least one of its incident edges fails the same inequality. Let denote the set of violating items or arriving vertices.
In Algorithm 1, we will fix the violation threshold to , which is optimized for the competitive ratio of achieved by the worst-case algorithm for all three of the problems we study. In particular, for this setting of , , 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 , as opposed to its corresponding decision vector. We denote and . We say that an algorithm has competitive ratio if on every instance, where is the expected value of the algorithm output, taken over the random arrival sequence and any randomness of the algorithm.
Matroid Preliminaries. Write for the known matroid in Problem 1.1, where 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 has already been accepted, its contraction has independent sets such that and . We let denote the operation of removing a set of elements from consideration. All elements in are removed from the ground set, and any independent set containing an element of is removed from . With this notation, is precisely the remaining matroid after accepting the elements in and discarding the elements in .
Our analysis uses two standard basis exchange properties for matroids ([45 Chapter 39]). Given a basis and an independent set , there is a basis with . I.e., completes to a basis using only elements from . Also, for any two bases and , there is a bijection such that is a basis for every .
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 , until the first violating arrival, i.e., the first arrival with relative prediction error larger than . The algorithm handles this first violating arrival with a random choice: with probability (eventually set to for the three problems studied), it takes the feasible action on the arrival that maximizes total value. Otherwise, it Algorithm 1 General Switching Algorithm
Figure 1.
Require: Feasible set , predictions , and a baseline algorithm .
Compute . Set and .
while do
Observe the next arrival . Let be the set of coordinates whose values are revealed at .
if is not a violation with threshold (Definition 2.4) then
Set the coordinates of in according to .
else
With probability , take the feasible action on maximizing the value added; otherwise reject .
Initialize on later arrivals under the remaining constraints. Set .
end if
end while
while do
Process the next arrival using .
end while
return .
rejects the arrival. For matroid secretary, this means it accepts the violating item with probability , and rejects it otherwise. For fractional knapsack, with probability it sets to the largest allocation that does not violate feasibility, i.e., , where is the remaining capacity. Otherwise, it rejects the item, setting . For online matching, with probability , it selects the maximum-value edge from vertex 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 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 , the order of the later arrivals is still uniform, and their arrival times are uniformly distributed in . Thus, in all instances, with competitive ratio is available ([1, 35, 33]).
Analysis
Observe that if no violation occurs (i.e., all predictions are accurate with threshold ), then the maximum prediction error satisfies (as set in Definition 2.4). So,
In this case, by Lemma 2.3, Algorithm 1 thus obtains competitive ratio , 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 be the index of the first violating arrival and let be the value of immediately before this arrival is processed. Let be the set of feasible decision vectors that match on all items revealed before arrival . We define:
That is, is the value obtained by all decisions before arrival . is the maximum additional obtainable value using all items revealed at arrival or later. Note that both and 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 and are sufficiently large in expectation. At first glance, one might hope that the algorithm obtains expected total value , since the worst-case algorithm has competitive ratio for all problems studied. However, this is not quite the case: potentially includes items revealed by the first violating arrival . While the arrival order of all items arriving after is uniform, since is guaranteed to be the first arriving item in the residual instance, we cannot simply apply to it.
Consider a simple example of the classic secretary problem: assume that the only violating item is the true maximum-value element . All other predictions are accurate. Thus, we always have . If is the classic -competitive algorithm for the secretary problem, it would always reject , since it always rejects the first fraction of elements seen.
Algorithm 1 avoids this issue by making a separate random decision for the first violating arrival , before applying 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 that obtains worst-case competitive ratio and . Then on any input instance containing at least one violating prediction,
Proof. Condition on the history through the arrival of , before its random decision. Let be the maximum additional value obtainable from the indices while keeping the prefix decisions fixed. For matroid secretary, if adding preserves independence, and otherwise. For fractional knapsack, , where is the remaining capacity. For online matching, is the maximum value of an edge from to an unmatched offline vertex, or if no such edge exists.
Let be the residual instance after rejecting , with only the prefix decisions fixed. The later arrivals have uniformly random relative order, so obtains expected value at least on this instance. The accepting branch contributes at least , since its subsequent value is nonnegative. Averaging over the two branches gives
Any solution in obtains at most from , and its remaining choices are feasible in . Thus . Using that and so , we conclude
as desired.
With Lemma 3.2 in place, to prove Theorem 1.2 it suffices to argue that , which lower bounds , is sufficiently large. In particular, we have:
Lemma 3.3 (Reduction to the Prefix and Residual). Suppose Algorithm 1 is implemented with that obtains worst-case competitive ratio and . Assume that on any given problem instance with at least one violating prediction
Then Algorithm 1 achieves competitive ratio
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., . Then by Lemma 3.2 and the assumption of (6) we have:
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 of value whose prediction is correct, along with a single violating item that has negligible true value but whose predicted value exceeds . Then the predicted optimum consists of alone, so the algorithm accepts nothing before the first violation, and . Moreover, is available in the residual instance only if arrives first, which happens with probability ; otherwise has already been rejected. Thus . 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 be the known matroid. For a set of items , write and for its true and predicted values. Let and 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 (Definition 2.4). We write . Let be the first violating item to arrive and let be its arrival time; both are random. Every item arriving before is non-violating, so before the algorithm accepts exactly the items of that arrive. The accepted set is thus and the discarded set is . The residual matroid is , and it contains . If is not independent in , Algorithm 1 rejects ; otherwise it accepts with probability . In this notation, the prefix and residual values of Definition 3.1 are
Let be the non-violating items outside . Since violating items arrive at or after , we always have and . Moreover, conditioned on , each item of belongs to with probability , and each item of belongs to with probability . This holds because is determined by the arrival times of the items in , which are independent of the arrival times of all other items. Since and are determined by the arrival times of disjoint sets of items, they are also independent given . 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 ), letting and be as in (7),
To prove Theorem 4.1, we want to show that every element of the true optimum receives expected weight at least in . We do this in two steps. First, we drop the factor and lower bound . Lemmas 4.2 and 4.3 give a separate guarantee for each element : in expectation, is either accepted before the first violation or still available to the residual solution, with a probability that depends only on whether is in and whether it is violating.
Second, we bring back the factor by writing . 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 weight at least , except in one case: when there is exactly one violating item, an element of that is not violating only gets weight . To cover this shortfall, we pair each such element of with its blocking element in . 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 be a basis of with , and for let . Then for every ,
In our main application of Lemma 4.2, we will take . In this case, is exactly the number of ways in which may become unavailable: by being blocked by an element of accepted before the first violation, or by being discarded before the first violation.
Proof. Order so that , write , and set and . Let denote the maximum size of an independent subset of in , and define
That is, is the number of elements of accepted before the first violation, plus the number of further elements of that can still be added in . We first show that for every ,
Fix and condition on and on . Let . Since is independent, there is a basis with . Let be the set of ‘conflicting’ items: those of that must be removed to complete to a basis, and that may therefore block items of . Both and are determined by and , so they are fixed once we condition on . Because , we have , so is independent. Because , we have and . Deleting does not change the rank of a set disjoint from , and is independent, so
Since is disjoint from , we have , and therefore
Now average over . Only items of can belong to , and each does so with probability , so . Since and are bases of equal size and , we have . Hence
Finally, average over . An element belongs to with probability if , and with probability one otherwise. This gives (9).
Next we convert these bounds into a bound on value. Let be the output of the greedy algorithm that scans in this order, skipping elements of , and adds an element whenever stays independent in . After the elements of have been scanned, is a maximal independent subset of in , and it is not changed by later steps. In a matroid, all maximal independent subsets of a set have the same size, so . For any we have , because . Applying this to and , and using that is independent in , we get
Taking the conditional expectation, applying (9), and using , the right side is at least , where the last step again uses .
Taking and averaging over gives the following bound on the expected prefix plus the full residual value.
Proof. Apply Lemma 4.2 with . Then equals for , equals for , and equals for . Since is the minimum of independent uniform arrival times, , so has density and for . In particular, . Averaging the bound of Lemma 4.2 over gives
Next, an item belongs to exactly when , which has probability , and no other item of belongs to . Thus . Adding this to the display above and using proves (10).
Proof of Theorem 4.1. We write . As shown in the proof of Lemma 4.3, . Combining this with Lemma 4.3, and splitting into its parts inside and outside , we obtain
The coefficient of is , and the coefficient of receives the additional term from the expected prefix value.
If , each of the first four coefficients is at least , since the smallest is . The last term is nonnegative, so the theorem follows from .
Now suppose . The first three coefficients in (11) are at least , so the only coefficients that fall short are those of the non-violating elements of , which equal . By the exchange property in the preliminaries applied to and , there is a bijection such that is a basis for every . Since maximizes the predicted value, for every such .
Let be non-violating, and suppose that , so that is also non-violating. Then
With and we have , so . The partner lies in and has coefficient in (11). The two elements together contribute at least
Since is a bijection, no partner is used for two different elements, and the contributions of partners are disjoint from those of elements of . This covers every non-violating unless and .
It remains to treat and the element . Here we improve the coefficient of by changing the reference basis in Lemma 4.2. By the exchange property, is a basis, and it contains . The sets , and , and hence the algorithm, are unchanged; only the analysis uses . Since , no element of is violating. We have for ; , because ; and for every other . For , is uniform on , so and . Averaging Lemma 4.2 over as in the proof of Lemma 4.3 therefore shows that (10) holds with the coefficient of equal to instead of , and with all other coefficients unchanged. In (11), the coefficient of thus becomes . Every other element of has a non-violating partner and is covered by the previous paragraph. Hence the total weight on every element of is at least , which completes the proof.
Fractional Knapsack Secretary
We next show that (6) holds for the fractional knapsack secretary problem (Problem 2.1).
Problem-Specific Notation. Let be the predicted optimal allocation and let be a true optimal allocation, so . Let be the set of violating items (Definition 2.4), let , and let . We consider instances with . Let be the first violating item to arrive and let . Before time , the algorithm sees only items of , and it accepts the fraction of each. The value of the prefix and the capacity it consumes are therefore
The residual instance consists of and all later items, and the remaining capacity is . We write for the maximum value of a fractional allocation of the items in that uses capacity at most . At , the algorithm accepts the fraction of with probability , and rejects otherwise.
Theorem 4.4. For any input instance to Problem 2.1 with at least one violating item,
Proof. Let be the capacity used by on , let be the value that obtains from , and let be the true value that obtains from . Let . Since and are feasible, and .
We first lower bound . The restriction of to maximizes the predicted value among allocations of the items in with total weight at most , since otherwise we could improve by replacing this restriction and keeping its values on . The allocation is feasible for this smaller capacity, because has total weight at most . Combining this with the prediction bounds on , we get
Now condition on . Since depends only on the arrival times of items in , each item of arrives before time independently with probability . Hence by (12). For the residual value, let be the value that obtains from items that arrive before . The restriction of to the items of has value and total weight at most , so scaling it by gives an allocation that is feasible in with capacity . Therefore . The variables and are weighted sums of the same independent indicators for , each with mean . This gives and . Moreover, , since the product of two distinct indicators has mean and the product of an indicator with itself has mean . It follows that
Combining the bounds on prefix and residual values,
It remains to average over . Since is the minimum of independent uniform arrival times, it has density , so and . Substituting these into (13) and dividing by gives
The right side is bilinear in , so over its minimum is attained at a corner. The values at the corners , , and are
Each is at least . This is clear for the first three since . For the last, if , and for the value is . Hence .
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 , with online endpoint and offline endpoint . Let and be the matchings of maximum predicted and true value, and for a set of edges write and . Let be the set of violating vertices (Definition 2.4) and let . Let be the first violating vertex to arrive and let . Before time , whenever a vertex arrives, the algorithm adds its edge in if it has one. Let be the total true value of these edges. The residual instance consists of and all later vertices, together with the offline vertices that are not matched before .
Theorem 4.5. For any input instance to Problem 2.2 with at least one violating vertex,
Proof. Say that an edge survives if is in and is not matched before . The surviving edges of form a matching in , so is at least their total value. Let consist of if , together with the online endpoint of the edge of at if this edge exists and . Then survives exactly when every vertex of arrives after , that is, when the first vertex to arrive among belongs to . The sets and are disjoint and , so
If , this probability is at least for every edge of . Hence , and since we get .
Now suppose . Let be the set of edges of whose online endpoint is not . Each edge of is accepted before with probability , so . Let be the set of edges with such that is matched in to a vertex . For the vertices , and are distinct, and survives exactly when arrives before both and . This has probability . Every other edge has , so it survives with probability at least by (14). Therefore
It remains to relate to . Let be the set of predicted edges incident to an endpoint of an edge in . Since is a matching, replacing by in gives a matching, and predicted optimality gives . Every edge in has an online endpoint other than ; this holds by definition for edges of , for predicted edges at the online endpoint of an edge of , and, by the definition of , for predicted edges at its offline endpoint. All these edges are therefore non-violating, and
Since and , this gives . Combining the bounds on and ,
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 . Any algorithm for integral knapsack secretary that achieves expected value at least whenever all predictions are correct has worst-case competitive ratio at most .
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 , and follows the predicted optimum otherwise. It achieves expected value at least whenever all predictions are correct, and has worst-case competitive ratio .
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 . There are small items, each with weight and value , and large items, each with weight and value . All predictions are correct, and , achieved by taking all small items. Let be the algorithm’s value, and let 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 . By consistency, , and therefore
For a large item , let be the event that the knapsack is empty when arrives, and let . Let and be the numbers of large and small items among the first arrivals, and let . Note that depends only on the arrival order, not on the algorithm.
Let be the arrival position of the first accepted item, or if nothing is accepted. Exactly the large items among the first arrivals see an empty knapsack, so . Every small item among the first arrivals is rejected, except possibly the one at position . Therefore , and
It remains to bound . The arrival order induces a uniformly random path from 0 to 0 with steps, where each large arrival is a step and each small arrival is a step. For , reflecting a path after it first reaches level gives a bijection between paths that reach and all paths ending at . Hence
so . Combining this with (15) gives
By (16), some large item satisfies . This item depends only on the algorithm and the accurate instance, not on the random order. Change the true value of to , while keeping its weight and its prediction . Use the same arrival order and the same internal randomness in both instances. Before arrives, the algorithm sees exactly the same input, so it makes the same decisions. In particular, is the same event in both runs.
On the modified instance, . The algorithm can accept only on . Without , its value is at most . Therefore
Letting shows that the worst-case competitive ratio is at most .
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]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]Susanne Albers. Online algorithms: A survey. Mathematical Programming, 97(1–2):3–26, 2003.DOI
- [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]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]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]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]Moshe Babaioff, Nicole Immorlica, David Kempe, and Robert Kleinberg. Online auctions and generalized secretary problems. ACM SIGecom Exchanges, 7(2), 2008.DOI
- [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]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]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]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]Allan Borodin and Ran El-Yaniv. Online Computation and Competitive Analysis. Cambridge University Press, 1998.
- [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]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]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.
- [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
- [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.
- [19]Evgenii Borisovich Dynkin. The optimum choice of the instant for stopping a Markov process. Soviet Mathematics, 4:627–629, 1963.
- [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.
- [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
- [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.
- [23]Thomas S. Ferguson. Who solved the secretary problem? Statistical Science, 4(3):282–296, 1989.
- [24]Peter R. Freeman. The secretary problem and its extensions: A review. International Statistical Review, pages 189–206, 1983.DOI
- [25]Kaito Fujii and Yuichi Yoshida. The secretary problem with predictions. Mathematics of Operations Research, 49(2):1241–1262, 2024.DOI
- [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
- [27]Ronald L. Graham. Bounds for certain multiprocessing anomalies. Bell System Technical Journal, 45(9):1563–1581, 1966.DOI
- [28]Theodore P. Hill and Robert P. Kertz. A survey of prophet inequalities in optimal stopping theory. Contemporary Mathematics, 125:191–207, 1992.DOI
- [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.
- [30]Zhiyi Huang. Settling the matroid secretary problem. arXiv:2609.30421, 2026.arxiv.org/abs/2609.30421
- [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
- [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.
- [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.
- [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
- [35]Max Klimm and Martin Knaack. Generalized assignment and knapsack problems in the random-order model. Mathematical Programming, 2026.
- [36]Ulrich Krengel and Louis Sucheston. Semiamarts and finite values. Bulletin of the American Mathematical Society, 83(4):745–747, 1977.DOI
- [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
- [38]Brendan Lucier. An economic view of prophet inequalities. ACM SIGecom Exchanges, 16(1):24–47, 2017.DOI
- [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
- [40]Aranyak Mehta. Online matching and ad allocation. Foundations and Trends in Theoretical Computer Science, 8(4):265–368, 2013.DOI
- [41]Aranyak Mehta, Amin Saberi, Umesh Vazirani, and Vijay Vazirani. AdWords and generalized online matching. Journal of the ACM, 54(5):22, 2007.DOI
- [42]Shayan Oveis Gharan and Jan Vondrák. On variants of the matroid secretary problem. Algorithmica, 67(4): 472–497, 2013.
- [43]Manish Purohit, Zoya Svitkina, and Ravi Kumar. Improving online algorithms via ML predictions. In Advances in Neural Information Processing Systems 31 (NeurIPS), 2018.
- [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.
- [45]Alexander Schrijver. Combinatorial Optimization: Polyhedra and Efficiency. Springer, 2003.
- [46]Sahil Singla. The matroid secretary conjecture is true. arXiv:2609.14555, 2026.arxiv.org/abs/2609.14555
- [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.
- [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
- [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.