# An Economic-Based Analysis of RANKING for Online Bipartite Matching

We give a simple proof showing that the RANKING algorithm introduced by Karp, Vazirani and Vazirani DBLP:conf/stoc/KarpVV90 is 1-1/e competitive for the online bipartite matching problem. Our proof resembles the proof given by Devanur, Jain and Kleinberg [2013], but does not make an explicit use of linear programming duality; instead, it is based on an economic interpretation of the matching problem. In our interpretation, one set of vertices represent items that are assigned prices, and the other set of vertices represent unit-demand buyers that arrive sequentially and choose their most-demanded items.

## Authors

• 9 publications
• 24 publications
• 8 publications
• 1 publication
• ### An Optimal Truthful Mechanism for the Online Weighted Bipartite Matching Problem

In the weighted bipartite matching problem, the goal is to find a maximu...
03/04/2021 ∙ by Rebecca Reiffenhäuser, et al. ∙ 0

• ### On Clearing Prices in Matching Markets: A Simple Characterization without Duality

Duality of linear programming is a standard approach to the classical we...
12/02/2019 ∙ by Xiaoming Li, et al. ∙ 0

• ### Vertex-weighted Online Stochastic Matching with Patience Constraints

Online Bipartite Matching is a classic problem introduced by Karp, Vazir...
07/09/2019 ∙ by Brian Brubach, et al. ∙ 0

• ### Prophet inequality for bipartite matching: merits of being simple and non adaptive

We consider Bayesian online selection problem of a matching in bipartite...
02/17/2019 ∙ by Nick Gravin, et al. ∙ 0

• ### Improved Analysis of RANKING for Online Vertex-Weighted Bipartite Matching

In this paper, we consider the online vertex-weighted bipartite matching...
07/25/2020 ∙ by Billy Jin, et al. ∙ 0

• ### Randomized Online Algorithms for Adwords

The general adwords problem has remained largely unresolved. We define a...
07/22/2021 ∙ by Vijay V. Vazirani, et al. ∙ 0

• ### Online Trading as a Secretary Problem

We consider the online problem in which an intermediary trades identical...
12/28/2018 ∙ by Elias Koutsoupias, et al. ∙ 0

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Problem Statement

Consider a bipartite graph , where and are the left and right vertices, respectively, and is the set of edges.

The online bipartite matching problem introduced by Karp, Vazirani and Vazirani [1] is the following: The graph is initially unknown. In iteration , for , vertex arrives, along with its adjacent edges (which are unknown from the outset). The algorithm needs to decide which neighbor of (if any) is matched to; this decision is irrevocable. The objective is to maximize the cardinality of the obtained matching.

A simple greedy algorithm for this problem matches each arriving vertex with an arbitrary unmatched neighbour, if available. Every greedy algorithm outputs a maximal matching, hence has cardinality at least a half of the maximum matching. It is not very difficult to see that this bound is tight; that is, there exist graphs for which this greedy algorithm cannot achieve more than half of the maximum matching. It was also shown that a randomized version of the greedy algorithm, which chooses a currently unmatched neighbor uniformly at random (if one exists) also has a competitive ratio of , up to low order terms [1].

In [1], Karp et al. introduced the randomized RANKING algorithm, and proved that it has a competitive ratio of . They also showed that this bound is tight (up to low order terms). RANKING first chooses a random permutation over the vertices in . Upon the arrival of a vertex , RANKING matches to the highest-ranked (according to ) currently unmatched neighbor of .

The analysis in the original paper was quite complicated. Subsequent papers by Goel and Mehta [3], Birnbaum and Mathieu [4] and Devanur Jain and Kleinberg [2] simplified the analysis considerably. The proof presented here is based on an economic interpretation of the online bipartite matching problem. It is similar to the proof of [2], but does not make an explicit use of linear programming duality.

## 2 An Economic-Based Analysis of RANKING

Consider the following interpretation of the RANKING algorithm. Given a graph , vertices of represent items, and vertices of represent utility maximizing buyers. If , then we say that buyer is connected to item . Every buyer has a binary unit-demand valuation, with value 1 to items connected to and value 0 otherwise.

Before the arrival of buyers, every item is assigned a price , where is a uniformly random number in (chosen independently for every item). Buyers arrive in arbitrary order. Every buyer, upon arrival, chooses an item that maximizes her utility, defined as the difference between her value for the item and the item’s price. This means that every buyer chooses the cheapest item she is connected to, which is still available.

We claim that the market process above is equivalent to the RANKING algorithm. To see this, one needs to show that every buyer purchases the item that is ranked highest among all available items, according to a preset random permutation. In the market setting, every buyer purchases the cheapest (currently available) item she is connected to. But since the price of every item is a strictly monotonically increasing function of , which is chosen independently and uniformly at random, the permutation induced by item prices is a random permutation.

We now proceed to the analysis of the market process.

For each item , let denote the revenue obtained by (i.e., if the item was purchased and 0 otherwise). The utility of buyer is

 utili={1−pj,if buyer ℓi % purchased item rj0,if buyer ℓi did not purchase any item

Fix some arrival order of the buyers and a price vector

, and let be the set of the corresponding purchased items. Since every buyer that received an item has value 1, the social welfare is the cardinality of the obtained matching. The following equation shows that it can also be written as the sum of the buyers’ utilities and the total revenue:

 ∑ℓi∈Lutili+∑rj∈Rrevj=∑rj∈T(1−pj)+∑rj∈Tpj=∑rj∈T1=|T|. (1)

We note that the approach of expressing the welfare as the sum of utilities and revenue has been used previously in other settings and proved useful [5, 6, 7].

Recall that for weights we set prices . We shall now present the main claim of the proof.

###### Claim 2.1.

For every order of arrival of the buyers, let be chosen uniformly in , and let prices be as above. We have that for all edges :

 Ew[utili+revj]≥1−1e.

Before proving Claim 2.1, we show how it is used to prove the competitive ratio of . Fix a maximum matching and let be the matching produced by the market process above. It follows that

 Ew[|M|] = Ew[∑iutili+∑jrevj]≥Ew⎡⎢⎣∑(ℓi,rj)∈M∗utili+revj⎤⎥⎦ =

where the first equality follows from Equation (1), and the last inequality follows from Claim 2.1.

We now proceed to proving Claim 2.1 — thus proving the competitive ratio of RANKING.

###### Proof of Claim 2.1.

Fix some arbitrary order of buyer arrival , buyer item such that , and let prices p be random prices as above. Consider the market without item and let be the price of the item chosen by buyer under the same arrival order (if buys nothing, set ). Then, under order , in the market with item , we have the two following properties:

1. Item is always sold when . This follows since either (a) some previous buyer bought item , or (b) buyer prefers item over the item chosen by when was unavailable.

2. The utility of buyer , . Observe that after reintroducing item to the market, every buyer has the same set of items available to him plus — possibly — one additional item. This is obviously true for the first incoming buyer, and remains true subsequently since the introduction of an additional item does never induces a buyer to take an item previously waived.

Property (1) above implies that

 Ew[revj]=Ew[pj⋅1rj is sold]≥Ew[pj⋅1pj

It now follows from property (2) that

 Ew[utili+revj]≥1−p+p−1e=1−1e,

as desired.

Remark 1. Devanur et al. [2] gave an elegant and simple proof of the bound achieved by RANKING using primal-dual analysis, where the primal LP represents the matching problem. It is known that the dual variables can be interpreted as these ’s and ’s. Our proof uses a scaled version of the assignment of the relevant dual variables in [2] as prices for items. The new interpretation simplifies the proof in two ways. (a) It removes the need to argue about the dual program and its feasibility. (b) Viewed from the economic perspective, some of the arguments in [2] are more readily apparent.

Remark 2. Note that the proof Claim 2.1 only uses the random choice of , while all other values can be arbitrary.

Remark 3. While the choices of the buyers, and thus the bound, hold when prices are just chosen uniformly at random in 111or an arbitrary bijection from w to , the proof of Claim 2.1 requires that we use the prices as specified above. Specifically, consider the lower bound example from [1]. In this instance, the last buyer to arrive is very unlikely to receive anything (in particular, it must be the case that the price of the last item is maximal, which happens w.p. ). Claim 2.1 is about all edges, in particular the edge from the last buyer. As the utility of the last buyer is small, the revenue must compensate, but the revenue from this item is at most under uniform price distributions.

### Acknowledgements.

This work was partially supported by the European Research Council under the European Union’s Seventh Framework Programme (FP7/2007-2013) / ERC grant agreement number 337122, and by the Israel Science Foundation (grant number 317/17).

## References

• [1] Richard M. Karp, Umesh V. Vazirani, and Vijay V. Vazirani. An optimal algorithm for on-line bipartite matching. In

Proceedings of the 22nd Annual ACM Symposium on Theory of Computing, May 13-17, 1990, Baltimore, Maryland, USA

, pages 352–358, 1990.
• [2] Nikhil R. Devanur, Kamal Jain, and Robert D. Kleinberg. Randomized primal-dual analysis of RANKING for online bipartite matching. In Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2013, New Orleans, Louisiana, USA, January 6-8, 2013, pages 101–107, 2013.
• [3] Gagan Goel and Aranyak Mehta. Online budgeted matching in random input models with applications to adwords. In Proceedings of the Nineteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2008, San Francisco, California, USA, January 20-22, 2008, pages 982–991, 2008.
• [4] Benjamin E. Birnbaum and Claire Mathieu. On-line bipartite matching made simple. SIGACT News, 39(1):80–87, 2008.
• [5] Michal Feldman, Nick Gravin, and Brendan Lucier. Combinatorial auctions via posted prices. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, San Diego, CA, USA, January 4-6, 2015, pages 123–135, 2015.
• [6] Paul Duetting, Michal Feldman, Thomas Kesselheim, and Brendan Lucier. Prophet inequalities made easy: Stochastic optimization by pricing non-stochastic inputs. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017, pages 540–551, 2017.
• [7] Soheil Ehsani, MohammadTaghi Hajiaghayi, Thomas Kesselheim, and Sahil Singla. Prophet secretary for combinatorial auctions and matroids. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2018, New Orleans, LA, USA, January 7-10, 2018, pages 700–714, 2018.