Online Primal-Dual Algorithms For Maximizing Ad-Auctions Revenue
Online Primal-Dual Algorithms For Maximizing Ad-Auctions Revenue
Ad-Auctions Revenue
Abstract. We study the online ad-auctions problem introduced by Mehta et. al.
[15]. We design a (1 − 1/e)-competitive (optimal) algorithm for the problem,
which is based on a clean primal-dual approach, matching the competitive factor
obtained in [15]. Our basic algorithm along with its analysis are very simple. Our
results are based on a unified approach developed earlier for the design of online
algorithms [7, 8]. In particular, the analysis uses weak duality rather than a tailor
made (i.e., problem specific) potential function. We show that this approach is
useful for analyzing other classical online algorithms such as ski rental and the
TCP-acknowledgement problem. We are confident that the primal-dual method
will prove useful in other online scenarios as well.
The primal-dual approach enables us to extend our basic ad-auctions algorithm in
a straight forward manner to scenarios in which additional information is avail-
able, yielding improved worst case competitive factors. In particular, a scenario in
which additional stochastic information is available to the algorithm, a scenario
in which the number of interested buyers in each product is bounded by some
small number d, and a general risk management framework.
1 Introduction
Maximizing the revenue of a seller in an auction has received much attention recently,
and studied in many models and settings. In particular, the way search engine companies
such as MSN, Google and Yahoo! maximize their revenue out of selling ad-auctions
was recently studied by Mehta et al. [15]. In the search engine environment, advertisers
link their ads to (search) keywords and provide a bid on the amount paid each time
a user clicks on their ad. When users send queries to search engines, along with the
(algorithmic) search results returned for each query, the search engine displays funded
ads corresponding to ad-auctions. The ads are instantly sold, or allocated, to interested
advertisers (buyers). The total revenue out of this fast growing market is currently bil-
lions of dollars. Thus, algorithmic ideas that can improve the allocation of the ads, even
by a small percentage, are crucial. The interested reader is refered to [16] for a popular
exposition of the ad-auctions problem and the work of [15].
Mehta et al. [15] modeled the optimal allocation of ad-auctions as a generalization
of online bipartite matching [13]. There are n bidders, where each bidder i (1 ≤ i ≤ n)
has a known daily budget B(i). Ad-auctions, or products, arrive one-by-one in an online
⋆
Work done while visiting Microsoft Research, Redmond, WA.
fashion. Upon arrival of a product, each buyer provides a bid b(i, j) for buying it. The
algorithm (i.e., the seller) then allocates the product to one of the interested buyers
and this decision is irrevocable. The goal of the seller is to maximize the total revenue
accrued. Mehta et al. [15] proposed a deterministic (1 − 1/e)-competitive algorithm for
the case where the budget of each bidder is relatively large compared to the bids. This
assumption is indeed realistic in the ad-auctions scenario.
minimum fraction of budget extracted from a buyer. As expected, the worst case com-
petitive ratio is (1 − 1/e) when g = 0, and it is 1 when g = 1.
Bounded Degree Setting. The proof of the (1 − 1/e) lower bound on the competi-
tiveness in [15] uses the fact that the number of bidders interested in a product can be
unbounded and, in fact, can be as large as the total number of bidders. This assumption
may not be realistic in many settings. In particular, the number of bidders interested
in buying an ad for a specific query result is typically small (for most ad-auctions).
Therefore, it is interesting to consider an online setting in which, for each product, the
number of bidders interested in it is at most d ≪ n. The question is whether one can
take advantage of this assumption and design online algorithms with better competitive
factor (better than 1 − 1/e) in this case.
Lower Bound Upper Bound Lower Bound Upper Bound
d=2 0.75 0.75 d = 10 0.662 0.651
d=3 0.704 0.704 d = 20 0.648 0.641
d=5 0.686 0.672 d → ∞ 0.6321. . . 0.6321 . . .
Fig. 1. Summary of upper and lower bounds on the competitive ratio for certain values of d.
As a first step, we resolve this question positively in a slightly simpler setting, which
we call the allocation problem. In the allocation problem, the seller introduces the prod-
ucts one-by-one and sets a fixed price b(j) for each product j. Upon arrival of a product,
each buyer announces whether it is interested in buying it for the set price and the seller
decides (instantly) to which of the interested buyers to sell the product. We have indica-
tions that solving the more general ad-auctions problem requires overcoming a few ad-
ditional obstacles. Nevertheless, achieving better competitive factors for the allocation
problem is a necessary non-trivial step. We design an online algorithm with competitive
d−1
ratio C(d) = 1 − . This factor is strictly better than 1 − 1/e for any value
d(1+ d−1
1
)d−1
of d, and approaches (1 − 1/e) from above as d goes to infinity. We also prove lower
bounds for the problem that indicate that the competitive factor of our online algorithm
is quite tight. Our improved bounds for certain values of d are shown in Figure 1.
Our improved competitive factors are obtained via a new approach. Our algorithm is
composed of two conceptually separate phases that run simultaneously. The first phase
generates online a fractional solution for the problem. A fractional solution for the prob-
lem allows the algorithm to sell each product in fractions to several buyers. This prob-
lem has a motivation of its own in case products can be divided between buyers. An
example of a divisible product is the allocation of bandwidth in a communication net-
work. This part of our algorithm that generates a fractional solution in an online fashion
is somewhat counter-intuitive. In particular, a newly arrived product is not split equally
between buyers who have spent the least fraction of their budget. Such an algorithm
is referred to as a “water level” algorithm and it is not hard to verify that it does not
improve upon the (1 − 1/e) worst case ratio, even for small values of d. Rather, the idea
is to split the product between several buyers that have approximately spent the same
fraction of their total budget. The analysis is performed through (online) linear program-
ming dual fitting: we maintain during each step of the online algorithm a dual fractional
solution that bounds the optimum solution from above. We also remark that this part
of the algorithm yields a competitive solution even when the prices of the products are
large compared with the budgets of the buyers. As a special case, the first phase implies
a C(d)-competitive algorithm for the online maximum fractional matching problem in
bounded degree bipartite graphs [13].
The second phase consists of rounding the fractional solution (obtained in the first
phase) in an online fashion. We note again that this is only a conceptual phase which is
simultaneously implemented with the previous phase. This step can be easily done by
using randomized rounding. However, we show how to perform the rounding determin-
istically by constructing a suitable potential function. The potential function is inspired
by the pessimistic estimator used to derandomize the offline problem. We show that if
the price of each product is small compared with the total budget of the buyer, then
this rounding phase only reduces the revenue by a factor of 1 − o(1) compared to the
revenue of the fractional solution.
Risk Management. Some researchers working in the area of ad-auctions argue that
typically budgets are not strict. The reason they give is that if clicks are profitable, i.e.,
the bidder is expected to make more money on a click than the bid on the click, then
why would a bidder want to limit its profit. Indeed, Google’s Adwords program al-
lows budget flexibility, e.g., it can overspend the budget by 20%. In fact, the arguments
against daily budgets are valid for any investment choice. For example, if you consider
investing ten thousand dollars in stock A and ten thousand dollars in stock B, then the
expected gain for investing twenty thousand dollars in either stocks is not going to be
less profitable in expectation (estimated with whatever means). Still, the common wis-
dom is to diversify and the reason is risk management. For example, a risk management
tools may suggest that if a stock reaches a certain level, then execute buy/sell of this
stock and/or buy/sell the corresponding call/put options.
Industry leaders are proposing risk management for ad-auctions too. The simplest
form of risk management is to limit the investment. This gives us the notion of a bud-
get. We consider a more complex form of real time risk management. Instead of strict
budgets, we allow a bidder to specify how aggressive it wants to bid. For example, a
bidder may specify that it wants to bid aggressively for the first hundred dollars of its
budget. After having spent one hundred dollars, it still wants to buy ad-auctions if it gets
them at, say, half of its bid. In general, a bidder has a monotonically decreasing function
f of the budget spent so far specifying how aggressive it wants to bid. We normalize
f (0) = 1, i.e., at the zero spending level the bidder is fully aggressive. If it has spent
x dollars, then its next bid is scaled by a factor of f (x). In Section 6 we show how to
extend the primal-dual algorithm to deal with a more general scenario of real time risk
management. For certain settings we also obtain better competitive factors.
2 Preliminaries
In the online ad-auctions problem there is a set I of n buyers, each buyer i (1 ≤ i ≤ n)
has a known daily budget of B(i). We consider an online setting in which m products
Dual (Packing) Primal (Covering)
Pm Pn Pn Pm
Maximize: j=1 i=1 b(i, j)y(i, j) Minimize : i=1 B(i)x(i) + j=1 z(j)
Subject to: Subject to:
For each 1 ≤ j ≤ m: Pn
P
i=1 y(i, j) ≤ 1 For each (i, j): b(i, j)x(i) + z(j) ≥ b(i, j)
m
For each 1 ≤ i ≤ n: j=1 b(i, j)y(i, j) ≤ B(i) For each i, j: x(i), z(j) ≥ 0
For each i, j: y(i, j) ≥ 0
Fig. 2. The fractional ad-auctions problem (the dual) and the corresponding primal problem
arrive one-by-one in an online fashion. Let M denote the set of all the products. The
bid of buyer i on product j (which states the amount of money it is willing to pay for
the item) is b(i, j). The online algorithm can allocate (or sell) the product to any one
of the buyers. We distinguish between integral and fractional allocations. In an integral
allocation, a product can only be allocated to a single buyer. In a fractional allocation,
products can be fractionally allocated to several buyers, however, for each product, the
sum of the fractions allocated to buyers cannot exceed 1. The revenue received from
each buyer is defined to be the minimum between the sum of the costs of the products
allocated to a buyer (times the fraction allocated) and the total budget of the buyer.
That is, buyers can never be charged by more than their total budget. The objective is
to maximize the total revenue of the seller. Let Rmax = maxi∈I,j∈M { b(i,j) B(i) } be the
maximum ratio between a bid of any buyer and its total budget.
A linear programming formulation of the fractional (offline) ad-auctions problem
appears in Figure 2. Let y(i, j) denote the fraction of product j allocated to buyer i.
The objective function is maximizing the total revenue. The first set of constraints guar-
antees that the sum of the fractions of each product is at most 1. The second set of
constraints guarantees that each buyer does not spend more than its budget. In the pri-
mal problem there is a variable x(i) for each buyer i and a variable z(j) for each product
j. For all pairs (i, j) the constraint b(i, j)x(i) + z(j) ≥ b(i, j) needs to be satisfied.
The intuition behind the algorithm is the following. If the competitive ratio we are
aiming for is 1 − 1/c, then we need to guarantee that in each iteration the change in the
primal cost is at most 1 + 1/(c − 1) the change in the dual profit. The value of c is then
maximized such that both the primal and the dual solutions remain feasible.
Theorem 1. The allocation algorithm is (1 − 1/c) (1 − Rmax )-competitive, where c =
1
(1 + Rmax ) Rmax . When Rmax → 0 the competitive ratio tends to (1 − 1/e).
Proof. We prove three simple claims:
1. The algorithm produces a primal feasible solution.
2. In each iteration: (change in primal objective function)/ (change in dual objective
1
function) ≤ 1 + c−1 .
3. The algorithm produces an almost feasible dual solution.
Proof of (1): Consider a primal constraint corresponding to buyer i and product j.
If x(i) ≥ 1 then the primal constraint is satisfied. Otherwise, the algorithm allocates
the product to the buyer i′ for which b(i′ , j)(1 − x(i′ )) is maximized. Setting z(j) =
b(i′ , j)(1 − x(i′ )) guarantees that the constraint is satisfied for all (i, j). Subsequent
increases of the variables x(i)’s cannot make the solution infeasible.
Proof of (2): Whenever the algorithm updates the primal and dual solutions, the change
in the dual profit is b(i, j). (Note that even if the remaining budget of buyer i to which
product j is allocated is less than its bid b(i, j), variable y(i, j) is still set to 1.) The
change in the primal cost is:
b(i, j) 1
B(i)∆x(i) + z(j) = b(i, j)x(i) + + b(i, j)(1 − x(i)) = b(i, j) 1 + .
c−1 c−1
By the second claim the dual it at least 1 − 1/c times the primal, and thus (by weak
duality) we conclude that the competitive ratio of the algorithm is (1−1/c) (1 − Rmax ).
Fig. 3. The fractional multi-slot problem (the dual) and the corresponding primal problem
know that, a bidder i is likely to spent a good fraction of her budget. We want to tweak
the algorithm so that the algorithm’s worst case performance improves. As we tweak the
algorithm it is likely that the bidder may spent more or less fraction of her budget. So
we propose to tweak the algorithm gradually until some steady state is reached, i.e., no
more tweaking is required. Suppose at the steady state, buyer i is likely to spent a good
fraction of his budget. Let 0 ≤ gi ≤ 1 be a lower bound on the fraction of the budget
buyer i is going to spend. We show that having this additional information allows us
to improve the worst case competitive ratio to 1 − e1−g 1−g , where g = mini∈I {gi } is the
Our bound is only tight for d = 2. We can derive better tailor-made lower bounds
for specific values of d. In particular it is not hard to show that our algorithm is optimal
for d = 3. We defer this result to the full version of the paper.
6 Risk Management
We extend our basic ad-auctions algorithm to handle a more general setting of real time
risk management. Here each buyer has a monotonically decreasing function f of budget
spent, specifying how aggressive it wants to bid. We normalize f (0) = 1, i.e., at the zero
spending level it is fully aggressive. If it has spent x dollars then its next bid is scaled by
a factor of f (x). Note that since f is a monotonically decreasing function,P the revenue
obtained by allocating buyer i a set of items is a concave function of j b(i, j)y(i, j).
Since we are interested in solving this problem integrally we assume the revenue
function is piecewise linear. Let Ri be the revenue function of buyer i. Let ri be the
number of pieces of the function Ri . We define for each buyer (ri − 1) different bud-
gets B(i, r), defining the amount of money spent in each “aggression” level. When the
buyer spends money from budget B(i, r), the aggression ratio is a(i, r) ≤ 1 (a(i, 1) = 1
for each buyer i). We then define a new linear program with variables y(i, j, k) indi-
cating that item j is sold to buyer i using the kth budget. Note that the ad-auctions
problem considered earlier is actually this generalized problem with two pieces. In
some scenarios it is likely to assume that each buyer has a lowest “aggression” level
that is strictly more than zero. For instance, a buyer is always willing to buy an item
if he only needs to pay 10% of its value (as estimated by the buyer’s bid). Our modi-
fied algorithm for this more general setting takes advantage of this fact to improve the
worst case competitive ratio. In particular, let amin = minni=1 {a(i, ri )} be the min-
imum “aggression” level of the buyers, then the competitive factor of the algorithm
e−1
is e−a min
. If the minimum level is only 10% (0.1), for example, the competitive ra-
tio is 0.656, compared with 0.632 ≈ 1 − 1/e of the basic ad-auctions algorithm. Let
Rmax = maxi∈I,j∈M,1≤r≤ri −1 { a(i,r)b(i,j)
B(i,r) } be the maximum ratio between a charge
to a budget and the total budget. The modified linear program for the more general risk
management setting along with our modified algorithm are deferred to the full version.
c−1
Theorem 5. The algorithm is c−a min
(1 − Rmax )-competitive, where c tends to e
when Rmax → 0.
Acknowledgements: We thank Allan Borodin for pointing to us the mutiple slot set-
ting.
References
1. N. Alon, B. Awerbuch, Y. Azar, N. Buchbinder, and J. Naor. The online set cover problem.
In Proceedings of the 35th STOC, pp. 100-105, 2003.
2. N. Andelman and Y. Mansour. Auctions with budget constraints. In Proc. of the 9th Scandi-
navian Workshop on Algorithm Theory, pp. 26-38, 2004.
3. J. Aspnes, Y. Azar, A. Fiat, S. Plotkin, and O. Waarts. On-line routing of virtual circuits with
applications to load balancing and machine scheduling. J. ACM, 44(3):486-504, 1997.
4. B. Awerbuch, Y. Azar, and S. Plotkin. Throughput-competitive online routing. In Proc. of
the 34th Annual Symposium on Foundations of Computer Science, pp. 32-40, 1993.
5. A. Blum and J. Hartline. Near-optimal online auctions. 2005.
6. C. Borgs, J. Chayes, N. Immorlica, M. Mahdian, and A. Saberi. Multi-unit auctions with
budget-constrained bidders. In Proc. of the 6th EC, pp. 44-51, 2005.
7. N. Buchbinder and J. Naor. Online primal-dual algorithms for covering and packing prob-
lems. In Proc. of the 13th Annual European Symposium on Algorithms, pp. 689-701, 2005.
8. N. Buchbinder and J. Naor. A primal-dual approach to online routing and packing. In Proc.
of the 47th Annual Symposium on Foundations of Computer Science, 293-204, 2006.
9. D. R. Dooly, S. Goldman, and S. D. Scott. On-line analysis of the TCP acknowledgement
delay problem. Journal of the ACM, 48:243-273, 2001.
10. A. Goel, A. Meyerson, and S. A. Plotkin. Combining fairness with throughput: Online rout-
ing with multiple objectives. J. Comput. Syst. Sci., 63(1):62-79, 2001.
11. B. Kalyanasundaram and K. R. Pruhs. An optimal deterministic algorithm for online b -
matching. Theoretical Computer Science, 233(1-2):319-325, 2000.
12. A. R. Karlin, C. Kenyon, and D. Randall. Dynamic TCP acknowledgement and other stories
about e/(e-1). In Proc. of the 33rd Symposium on Theory of Computing, pp. 502-509, 2001.
13. R. Karp, U. Vazirani, and V. Vazirani. An optimal algorithm for online bipartite matching. In
In Proceedings of the 22nd Annual Symposium on Theory of Computing, pp. 352-358, 1990.
14. M. Mahdian and A. Saberi. Multi-unit auctions with unknown supply. In EC ’06: Proceed-
ings of the 7th ACM conference on Electronic commerce, pp. 243-249, 2006.
15. A. Mehta, A. Saberi, U. Vazirani, and V. Vazirani. Adwords and generalized on-line match-
ing. In Proc. of the 46th IEEE Symp. on Foundations of Computer Science, 264-273, 2005.
16. S. Robinson. Computer scientists optimize innovative ad auction. SIAM News, 38:243-273,
2005.