1 Introduction
We study the power and limitations of (anonymous) pricing schemes in achieving optimal social welfare in combinatorial markets. We consider combinatorial markets with heterogeneous, indivisible goods, and buyers with (publicly known) complex, idiosyncratic preferences over bundles of items. In the most general form, every buyer has a monotone valuation function , which assigns a real (nonnegative) value to every bundle, and the goal is to allocate items to buyers in a way that maximizes the social welfare; i.e., the sum of buyer values.
If only computational constraints are taken into account, a welfare maximizing allocation can be efficiently computed in the full information setting whenever the buyers exhibit preferences as simple as grosssubstitutes [34]. Moreover, the celebrated VCG mechanism [38, 7, 25] achieves this even in strategic settings. Real world markets, however, usually employ simpler mechanisms, such as pricing, and understanding their performance is of great interest.
To this end, we study the welfare maximization problem by means of an anonymous pricing scheme. Apart from being simple, pricing schemes are attractive since they lack an all powerful central authority. Once the prices are set, the buyers arrive and simply choose a desired set of items from the available inventory. This procedure is quite prevalent in market scenarios.
Formally, the seller sets items prices , buyers arrive sequentially (in an arbitrary order), and every buyer chooses a bundle (from the remaining items) that maximizes the (quasilinear) utility: , breaking ties arbitrarily.
Maximizing welfare by pricing is challenging even for relatively simple valuations and even when the seller has full knowledge of the valuation profile, due to the large degree of freedom it leaves to the buyers. A reader familiar with the fundamental notion of Walrasian equilibrium, which dates back to the 19th century
[39] (also known as market/pricing/competitive equilibrium), may conclude that the problem is solved for any market that admits a Walrasian equilibrium. A Walrasian equilibrium is a pair of an allocation and prices , such that for every buyer , maximizes ’s utility given . By the first welfare theorem , every Walrasian equilibrium maximizes social welfare.Are Walrasian prices a solution to our problem? The answer, as was previously observed [10, 28], is no. Walrasian prices alone cannot resolve a market without coordinating the tie breaking. If a buyer is faced with multiple utilitymaximizing bundles, it is crucial that a central authority coordinate the tie breaking in accordance with the corresponding optimal allocation. In realworld markets, however, buyers are only faced with the prices and choose a desired bundle by themselves without caring about global efficiency. [10] demonstrated that lacking a tiebreaking coordinator, Walrasian pricing can lead to an arbitrarily bad allocation. Moreover, they showed that no pricing whatsoever can achieve more than of the optimal social welfare in the worst case, even when restricted to unitdemand buyers (where every buyer has value for every item, and the value for a set is the maximum value of any item in the set).
In order to circumvent this state of affairs, [10] propose a more powerful pricing scheme, namely dynamic pricing, where the seller dynamically updates prices in between buyer arrivals (based on the remaining buyers and the current inventory).
Consider the following example, given by [10], for a market that has no optimal static pricing but does have an optimal dynamic pricing.
Example 1. The market consists of 3 unitdemand buyers Alice, Bob and Carl, and three items . Alice has value 1 for and 0 for , Bob has value 1 for and 0 for , and Carl has value 1 for and 0 for . Consider the initial prices . Since the market is symmetric, we can assume w.l.o.g. that Alice comes first. At these prices she takes either or , and let’s assume (again w.l.o.g.) that she takes . In the second round, the seller can price at and at . If Bob arrives next then he takes , and if Carl arrives next then he takes . The remaining item can then be priced at 0 to guarantee that it is taken by the last buyer. In any case, social welfare is maximized.
For a given valuation class
, the existence of an optimal dynamic pricing reduces to the existence of an adequate initial price vector. If there always is an initial price vector guaranteeing that regardless of the identity of the first buyer, and regardless of how she breaks ties, the bundle she consumes can always be completed to an optimal allocation, then some optimal allocation can always be achieved, by induction. The following definition of optimal dynamic pricing follows (the formal definition appears as Definition
2.1):Definition.
A price vector is an optimal dynamic pricing (hereafter, dynamic pricing) if for every buyer , and every utilitymaximizing bundle for (given ), is allocated to in some optimal allocation.
Due to the first welfare theorem, Walrasian pricing can be defined in the following way, which closely resembles the definition of dynamic pricing:
Definition.
A price vector is a Walrasian pricing if there is an optimal allocation such that maximizes ’s utility (given ) for every buyer .
Despite the similarity between the two definitions, they are incomparable. [10] provide an example of a market with coverage valuations that has a Walrasian pricing but not a dynamic pricing. For the converse direction, we borrow from [20] an example of a market that has no Walrasian pricing, and show that it does admit a dynamic pricing (see section 6).
What is known about the existence of these two pricing notions? For Walrasian pricing we know much. Kelso and Crawford [30] prove that every grosssubstitutes market (a strict superset of unitdemand, and a strict subset of submodular) admits a Walrasian pricing. Moreover, Gul and Stacchetti [26] show that this result is tight in the following sense:
Theorem 1.1 (Maximal Domain Theorem for Walrasian Equilibrium [26]).
Let be a non grosssubstitutes valuation. Then, there exist unitdemand valuations for some such that the valuation profile does not admit a Walrasian equilibrium^{1}^{1}1Yang [40] discovered an error in the proof; details to follow..
The combination of these results completely characterizes the existence of Walrasian pricing for classes of valuations that contain unitdemand valuations.
For dynamic pricing, however, the picture is significantly less clear. [10] show that unitdemand markets always admit dynamic prices. Moreover, their result extends to grosssubstitutes markets in which there is a unique optimal allocation. For markets without unique optimum, no positive result beyond unitdemand buyers is known. On the negative end, the state of affairs is even worse; we only know of the coverage valuations example mentioned above, which does not admit a dynamic pricing. The following natural question arises:
What markets (i.e., what valuation classes) can be resolved optimally using dynamic pricing schemes?
1.1 Our Results
In this work we shrink the gap between possibility and impossibility guarantees for optimal dynamic pricing, from both ends.
Positive Results. A natural extension of unitdemand valuations is multidemand valuations, where every buyer has a cap (a.k.a demand) on the number of desired items, and the value for a set is the sum of the values for the most valued items in the set. Our main positive result is the following:
Theorem 1.2.
Every market with up to multidemand buyers admits a dynamic pricing. Moreover, the prices can be computed in polynomial (in the number of items ) time, using value queries^{2}^{2}2A value query for a valuation receives a set as input, and returns , see Section 2..
A major component in the analysis is the following theorem that characterizes the set of optimal allocations in multidemand markets (with any number of buyers, and any demand vector). For the sake of simplicity, we present the theorem for markets in which all items are allocated in every optimal allocation, and in which the total demand of the players equals supply (however, an analogous result holds also for the case where demand exceeds supply, see Appendix B).
Theorem (Optimal Allocation Characterization).
(Informal) In a market with multidemand buyers, an allocation is optimal if and only if the following hold:

The number of items that each buyer receives equals that buyer’s demand.

If item is allocated to buyer , then there is an optimal allocation where is allocated to .
In addition to extending the result of [10] beyond unitdemand buyers, we also contribute to the domain of unitdemand buyers. In the pricing scheme proposed by [10] buyers may have to break ties. In section 4 we propose an alternative scheme for unitdemand buyers, where tie breaking is eliminated altogether.
Theorem 1.3.
Every market with unitdemand buyers admits a dynamic pricing scheme where every buyer has a unique utilitymaximizing bundle at every stage of the procedure.
Negative Results. In 2017, Yang [40] discovered an error in the proof of the maximal domain theorem for Walrasian equilibrium by Gul and Stacchetti. Unfortunately, the error is not in the analysis of the construction, rather in the construction itself. Indeed, Yang showed an instance of their constructed market that does admit a Walrasian equilibrium. In the same work he proved an alternative, incomparable theorem: for every non grosssubstitutes valuation there is a (single) grosssubstitutes valuation for which the obtained market has no Walrasian equilibrium. Yang’s theorem is stronger, in the sense that only a single valuation is added to guarantee the nonexistence of Walrasian equilibrium. On the other hand, Gul and Stacchetti’s theorem is stronger in the sense that the added valuations have the simple structure of unitdemand valuations. In section 5 we provide a complete proof of the maximal domain theorem as it was originally stated. The proof is a major component in our main negative result, a maximal domain theorem for dynamic pricing:
Theorem 1.4.
Let be a non grosssubstitutes valuation. Then, there are unitdemand valuations for some such that the valuation profile does not admit a dynamic pricing.
While this result is analogous to the theorem by Gul and Stacchetti, we emphasize that the notions of dynamic pricing and Walrasian pricing are incomparable, and thus none of the maximal domain theorems directly implies the other.
1.2 Our Techniques
Techniques for Positive Results. Our starting point is the dynamic pricing scheme of [10] for unitdemand buyers. In a nutshell, their scheme computes an optimal allocation (the item is allocated to buyer ) and then constructs a complete, weighted directed graph in which the vertices are the items. An edge in this graph represents a preference constraint, requiring that buyer strongly prefer the item over , relative to the output prices. Hereafter, we term this graph the “preference graph”.
The best we could hope for is to compute prices relative to which all edge constraints are satisfied. In this case, all buyers would strongly prefer their items over the rest, and the allocation obtained after the last buyer leaves the market would be . Consequently, this would imply an optimal static pricing scheme for unitdemand buyers, which is impossible. However, [10] prove the following two claims:

An edge participates in a 0weight cycle iff there is an alternative optimal allocation in which is allocated to buyer .

If 0weight cycles are removed from the graph, then one can compute prices that satisfy the remaining edge constraints.
Thus, the scheme removes every edge that participates in a 0weight cycle, and then computes the prices as per the second bullet above. Relative to these prices, every buyer strongly prefers her allocated item to every other item, except (perhaps) for the set of items that are allocated to her in some alternative optimal allocation. Since every buyer takes at most one favorite item (the buyers are unitdemand), this property guarantees that allocating this item to the buyer is consistent with an optimal allocation (not necessarily ), as desired.
A similar approach can be taken in the multidemand setting as well. Indeed, the same techniques can be adapted to output prices, relative to which every buyer strongly prefers each of her allocated items to every other item, except perhaps for those that are allocated to her in some alternative optimal allocation. However, this property is not sufficient to ensure optimal welfare for multidemand buyers, where a buyer may take more than one item. To get intuition for what may go wrong, note that the fact that item is allocated to buyer in some optimal allocation and also item is allocated to in some optimal allocation does not imply that there exists a single optimal allocation where both and are allocated to . This problem is demonstrated in the following running example, which generalizes the example by [10] above.
Running Example. Consider a market with 5 items and 3 buyers, 1, 2, 3. Buyers 1 and 2 are both demand, and buyer 3 is unitdemand. Buyer 1 values at 1 and at 0, Buyer 2 values at 1 and at 0, and buyer 3 values at 1 and at 0. One can verify that allocating to 1, to 2 and to 3 maximizes social welfare. Moreover, both and are allocated to 1 in alternative optimal allocations (different ones). However, if 1 takes both and , then the resulting social welfare can be at most 4, while .
This example demonstrates that removing every edge that participates in a 0weight cycle from the preference graph might lead to a suboptimal allocation. Our challenge is to remove enough edges so that on the one hand, all 0weight cycles are eliminated (this will enable us to compute the prices), and on the other hand, every deviation from implied by the edge removals is consistent with some alternative optimal allocation.
Our first step is to gain a better structural understanding of optimal allocations in multidemand markets. This is cast in the optimal allocation characterization theorem above, which essentially says that an allocation is optimal iff every item is allocated to a buyer that receives it in some optimal allocation. This simple characterization is quite powerful and leads to a significant simplification of the problem: For the sake of optimizing social welfare, the concrete values of the buyers for any specific item are unimportant. The important feature of any item is the set of buyers that receive it in some optimal allocation. Two items are essentially equivalent if their corresponding sets of buyers coincide. This observation allows us to group items into equivalence classes, providing a compact view of the market. For example, in markets with up to 3 multidemand buyers, there are at most 8 (nonempty) equivalence classes, while the total number of items can be arbitrarily large.
Equipped with this new view of the market, we construct a new directed graph, termed the “itemequivalence graph”, which abstracts away the irrelevant information encoded in the preference graph. The vertices are these equivalence classes (refined after intersecting them with the bundles from the initial optimal allocation ), and there is an edge whenever the buyer to which the items in are allocated (in the allocation ) also receives every item in in some alternative optimal allocation. We prove that there is a correspondence between cycles in the itemequivalence graph and 0weight cycles in the preference graph. Thus our challenge is reduced to removing enough edges from the first (and translate these removals back to the second), in a way that eliminates all cycles, but also guarantees the following: every deviation by any buyer from her prescribed bundle, implied by the edge removals, allows the other buyers to simultaneously compensate for their “stolen” items by replacing them with items from other relevant equivalence classes. The optimal allocation characterization theorem will then guarantee that the obtained allocation is indeed optimal. We devise an edgeremoval method satisfying these requirements whenever the number of buyers is at most 3.
The optimal allocation characterization theorem and the item equivalence graph may be of independent interest, and may prove useful in the context of other problems related to multidemand markets.
Techniques for Negative Results. The starting point for our negative results is the following simple observation: If a valuation profile admits a unique optimal allocation, then any dynamic pricing is also a Walrasian pricing. Thus, for the sake of proving our maximal domain theorem for dynamic pricing, it suffices to modify the construction given by Gul and Stacchetti in their theorem for Walrasian equilibrium in a way that preserves the correctness of the proof, but also guarantees a unique optimal allocation for the construction.
In their proof, Gul and Stacchetti characterized grosssubstitutes as the class of valuations that exhibit the single improvement property:
Theorem ([26]).
A valuation is grosssubstitutes if and only if for any bundle and price vector such that is not utilitymaximizing relative to , there is a bundle such that and .
This characterization is used to claim the existence of some bundle and item prices , relative to which is not utility maximizing for ( is the assumed non grosssubstitutes valuation), and any preferred bundle satisfies or . The proof then considers such a bundle minimizing , and splits to cases according to whether or . Suitable unitdemand valuations are then constructed for each case.
In the first case (), we could not manage to modify the construction so as to guarantee uniqueness of the optimal allocation. However, we did manage to perturb the valuations just enough so that every dynamic pricing can be converted to a Walrasian pricing, while maintaining the correctness of the construction (i.e., the construction does not admit a Walrasian pricing).
As for the second case in their proof, Yang [40] discovered a counterexample for the construction. In section 5.1, we harness a new characterization of grosssubstitutes to prove that if is not grosssubstitutes, then one can always find and for which the corresponding minimizer satisfies . Therefore, only the first case in the original proof had to be considered in the first place, and we obtain both maximal domain theorems (for Walraian pricing and dynamic pricing) simultaneously. This new characterization is a variant of the pricebased characterization by Reijnierse et al. [35] in which the item prices are guaranteed to be nonnegative (in contrast to the item prices in [35]).
Open problems. Our results suggest questions for future research. The most obvious one is whether our positive result for 3 multidemand buyers can be extended to any number of buyers. We hope that the tools we develop in this work, including the optimal allocation characterization theorem and the item equivalence graph, which are applicable to multidemand markets of any size, will prove useful in this extension.
More generally, it is still open whether any market with gross substitutes valuations admits an optimal dynamic pricing.
1.3 Related Work
The notion of Walrasian equilibrium was defined for divisiblegoods as early as the 19th century [39]. This notion was later extended to combinatorial markets, where Kelso and Crawford [30] introduced the class of grosssubstitutes valuations as a class for which a natural ascending auction reaches a Walrasian equilibrium. Gul and Stacchetti later showed via their maximal domain theorem that grosssubstitutes is the frontier of this existence result [26, 40]. Grosssubstitutes valuations have been introduced independently in different fields, under different names, and under seemingly different definitions [11, 12, 13, 33]; see [31] for a comprehensive survey of grosssubstitutes valuations. In order to circumvent the nonexistence of a market equilibrium under broader valuation classes, relaxations of market equilibrium were introduced [22, 15], and behavioral biases were harnessed [3, 19].
Posted price mechanisms were shown to be useful in combinatorial markets. Feldman, Gravin and Lucier [21] showed how to compute simple “balanced” static prices in order to obtain at least half of the optimal welfare for submodular valuations, even in the case where the seller has only Bayesian knowledge about the valuations. This idea was generalized by Duetting et al. [14], and was shown to be useful even in the face of complementarities between items [6].
CohenAddad et al. [10] and Hsu et al. [28] were the first to demonstrate that Walrasian prices cannot even approximate the optimal welfare in the absence of a centralized tiebreaking coordinator. CohenAddad et al. resolved this issue by adjusting prices dynamically for unitdemand valuations. They also showed an instance of coverage valuations where a Walrasian equilibrium exists and yet dynamic prices cannot guarantee optimal welfare. On the other hand, Hsu et al. showed that under some conditions, minimal Walrasian prices guarantee nearoptimal welfare for a strict subclass of grosssubstitutes valuations^{3}^{3}3Tran [37] recently showed that the class of matroidbased valuation is a strict subclass of grosssubstitutes valuations.. Ezra et al. [18] and Eden et al. [17] established better guarantees via static pricing for simpler markets (identical items and binary unitdemand, respectively), in comparison to [21].
Posted price mechanisms have been shown to be useful in additional settings with different objective functions, including revenue maximization in combinatorial markets [27, 4, 5, 1], cost minimization in online scheduling [23, 16, 29], and a variety of other online resource allocation problems [8, 9, 24, 2].
2 Preliminaries
We consider a setting with a finite set of indivisible items (with ) and a set of buyers (or players). Every buyer has a valuation function . As standard, we assume monotonicity and normalization of all valuations, i.e. whenever , and . A valuation profile of buyers is denoted and we assume that it is known by all. An allocation is a vector of disjoint subsets of , indicating the bundles of items given to each player (not all items have to be allocated). The social welfare of an allocation is given by . An optimal allocation is an allocation that achieves the maximum social welfare among all allocations.
A pricing or a price vector is a vector indicating the price of each item. We assume a quasilinear utility, i.e. the utility of a buyer from a bundle given prices is . The demand correspondence of buyer given is the collection of utility maximizing bundles .
2.1 Dynamic Pricing
In the dynamic pricing problem buyers arrive to the market in an arbitrary and unknown order. Before every buyer arrival new prices are set to the items that are still available. The arriving buyer then chooses an arbitrary utilitymaximizing bundle based on the current prices and available items. The goal is to set the prices so that for any arrival order and any tie breaking choices by the buyers, the obtained social welfare is optimal. We are interested in proving the guaranteed existence of an optimal dynamic pricing for any market composed entirely of buyers from a given valuation class . It can be easily shown by induction that the problem is reduced to proving the guaranteed existence of item prices such that any utilitymaximizing bundle of any buyer can be completed to an optimal allocation. In other words, we can rephrase the dynamic pricing problem as follows:
Definition 2.1.
An optimal dynamic pricing (hereafter, dynamic pricing) for the buyer profile is a price vector such that for any buyer and any there is an optimal allocation in which player receives .
In the case that a dynamic pricing exists, we will also be interested in efficiently computing it. We assume access to the valuation function of every buyer through a value oracle, namely, given a set the oracle returns .
Definition 2.2.
A polytime dynamic pricing scheme is a time algorithm that computes a dynamic pricing given access to the valuation profile through value oracles.
2.2 Valuation Classes
This paper considers the following valuation classes:

UnitDemand Valuations: A valuation is unitdemand if for all , .

GrossSubstitutes Valuations[30] A valuation is grosssubstitutes if for any two price vectors such that (pointwise), and for any there is a bundle such that .

MultiDemand Valuations: A valuation is demand if for all , .
Note that for we obtain a unitdemand valuation. Furthermore, every multidemand valuation is grosssubstitutes.
3 Dynamic Pricing for MultiDemand Buyers
In this section we prove Theorem 1.2, namely we establish a dynamic pricing scheme for multidemand buyers. As we shall see most of the tools we use hold for any number of buyers . For this entire section we fix a multidemand buyer profile over the item set , where each is demand. We assume w.l.o.g. that all items are essential for optimality (i.e. all items are allocated in every optimal allocation) since otherwise we can price all unnecessary items at in every round to ensure that no player takes any of them (and price the rest of the items as if the unnecessary items do not exist). Note that under this assumption, each optimal allocation gives buyer at most items, for every . In particular we have . For the sake of simplicity we further assume for the rest of this section that every optimal allocation gives each buyer exactly items, and thus . The case introduces substantial technical difficulty and we defer its treatment to Appendix B. In section 3.1 we go over the tools used in our dynamic pricing scheme. In section 3.2 we present the dynamic pricing scheme for buyers.
3.1 Tools and Previous Solutions
In section 3.1.1 we present the main combinatorial construct of our solution, namely the preferencegraph, which generalizes the construct given by [10] in their solution for unitdemand buyers. In section 3.1.2 we explain the obstacles for generalizing the approach of [10] to the multidemand setting. Finally, in sections 3.1.3 and 3.1.4 we develop the necessary machinery needed to overcome these obstacles. All the tools we develop and their properties hold for any number of buyers .
3.1.1 The Preference Graph and an Initial Pricing Attempt
Let be an arbitrary optimal allocation. The preference graph based on is the directed graph whose vertices are the items in . Furthermore there is a special ‘source’ vertex denoted . For any two different players and items we have a directed edge with weight . We also have a 0weight edge for every item . Since an optimal allocation can be computed in time with value queries (the valuations are gross substitutes, see [31]), it follows that the preference graph can also be computed in time with value queries. When for every , the graph is exactly the one introduced by [10] in their unitdemand solution. We remark that a similar graph structure has been used by Murota in order to compute Walrasian equilibria in grosssubstitutes markets ([32]). The proofs of the following two claims and corollary are deferred to Appendix A.
Claim 3.1.
Let be a cycle in , where is allocated to player in and for every . Then the weight of the cycle is where is the allocation obtained from by transferring to player for every (we identify player with player ).
Corollary 3.2.
Every cycle in has nonnegative weight.
Corollary 3.2 implies that the weight of the minweight path from to , denoted , is welldefined for any item .
Claim 3.3.
Let for every item . Let be some player, and let be items such that . Then:

.

.

.
Note that the utility player obtains from any bundle of size at most is the sum of the individual utilities obtained by the individual items. That is, for any and prices we have . Thus, Claim 3.3 shows that setting the prices almost achieves the requirements of dynamic pricing. The prices are nonnegative as required and any player is maximally happy by taking the designated bundle upon arriving first to the market. However, since the inequalities in Claim 3.3 are not strict, the incoming player might deviate from the designated bundle. If the price of some real item is 0, then nothing prevents the incoming player from taking it, irrespective of whether she already achieved her demand through other items. Furthermore, if , then player might take instead of . Finally, if , then player might choose not to take . All of these deviations might lead to a suboptimal allocation.
To illustrate, consider a simple example of a market composed of two unitdemand buyers and two items, each of which is valued at 1 by both buyers. There are two optimal allocations here (each allocating one item to each player) inducing a social welfare of 2. It is easy to see that the resulting preference graph has only 0weight edges, implying a price of 0 to both items. This in turn implies that every nonempty bundle is demanded by both buyers and in particular the first incoming buyer might take both items, resulting in a partial allocation that cannot be completed to an optimal one.
If we could decrease the weight of all edges by some small enough constant , then we would get a strong inequality in parts (2) and (3) of Claim 3.3, guaranteeing that player ’s most preferable items are and that she takes no less than items when arriving first. The item prices could then be increased by another tiny constant so as to also satisfy part (1) with strong inequality, guaranteeing that she also takes no more than items, hereby establishing that the only bundle in her demand is . However, decreasing edge weights can introduce cycles of negative weight in , in which case the minweight path from to is not defined for any in such a cycle!
3.1.2 Solution for UnitDemand Valuations and its Failure to Generalize
The approach taken in [10] to solve this issue in the setting of unitdemand players (where for every ) is to remove every edge that participates in a 0weight cycle in (thus leaving only positive weight cycles, by Corollary 3.2) and then decrease the remaining edge weights by a small enough so that all leftover cycles still have positive weight. Removing an edge for , cancels the preference guarantee of Claim 3.3 (part 2), leading to a possible deviation by buyer from taking to taking . However, since 0weight cycles correspond to alternative optimal allocations (see Claim 3.1 with ), then this is not a problem: if the edge was removed, then there is an optimal allocation in which player receives instead of . As for the edges that were not removed, the decrement causes to strongly prefer over . The other inequalities of Claim 3.3 would also be strict, and we are thus guaranteed that the incoming player indeed takes a oneitem bundle that is part of some optimal allocation, as desired. This approach works in the unitdemand setting, but poses problems in our setting, as illustrated in the running example (presented in the introduction).
[Running Example] Figure 1 shows two 0weight cycles in the preference graph (out of the four existing 0weight cycles) based on the initial optimal allocation that gives buyer 1 , buyer 2 and buyer 3 . If all such cycles are removed, then nothing prevents 1 from taking items and instead of and . At this point buyer 2 has only the item to compensate for the two “stolen” items and . It follows that the partial allocation cannot be completed to an optimal one.
Item in the running example is in some sense a “bottleneck” in the preference graph, and a more sophisticated method of eliminating 0weight cycles must be employed instead of simply removing all edges that participate in some 0weight cycle. To be more precise, we state our informal goal:
Goal.
Remove a set of edges from the preference graph so that no 0weight cycles are left, and every possible deviation implied by the removed edges is consistent with some optimal allocation.
In order to gain a better understanding of the tolerable deviations from the designated bundles , we first characterize the structure of the collection of optimal allocations.
[vstyle = empty]
3.1.3 Legal Allocations
Definition 3.4.

An item is legal for player if there is some optimal allocation such that .

A bundle is legal for player if and every is legal for player .

A legal allocation is an allocation in which is legal for player , for every .
In a legal allocation every player receives exactly items, each of which is allocated to her in some optimal allocation. Note that a legal bundle for buyer might not form a part of any optimal allocation (e.g., the bundle for buyer 1 in the running example). The following theorem provides a characterization of the collection of optimal allocations.
Theorem 3.5.
An allocation is legal if and only if it is optimal.
Before proving Theorem 3.5, we state a corollary of it. Recall that a price vector is a dynamic pricing iff for any and there is an optimal allocation in which player receives . The following is a direct corollary of Theorem 3.5:
Corollary 3.6.
A price vector is a dynamic pricing if for every player and , is legal for player and there exists an allocation of the items to the other players in which every player receives a bundle that is legal for her.
Thus, going back to our informal Goal (see section 3.1.2), Theorem 3.5 determines the deviations from the bundles which are tolerable. A buyer can only deviate to items that are legal for her, in a way that the leftover items can be partitioned “legally” among the rest of the buyers. We now prove Theorem 3.5.
Proof.
Legality follows from optimality due to our assumption that every optimal allocation allocates exactly items to every player . For the other direction we first prove the theorem in the special case of a unitdemand market, i.e. for every player , and then we show how the general case reduces to the unitdemand market case.
Lemma 3.7.
If for all then any legal allocation is optimal.
Proof.
Let be a legal allocation, and let be some optimal allocation. We show that . By definition, for every there is an optimal allocation in which the item is allocated to player and optimality implies that . Summing over all we get
(1) 
The right side in (1) accounts for the welfare of optimal allocations, each of which is by itself a sum of terms of the form where every item and player appears exactly once (recall the assumption that every optimal allocation allocates all items, i.e., is a perfect matching). Thus, the right side in (1) is a sum of terms in which every item and player appears exactly times. Consider the bipartite graph in which the left side is the set of items, the right side is the set of players and there is an edge for each summand appearing in the right side of (1). Then is an regular bipartite graph (possibly with multiedges), and note that the (perfect) matching induced by the legal allocation appears in (since the term appears in , for every i). If we erase the edges of that matching from then we are left with an regular bipartite graph. It is a wellknown fact that in this case the edges of can be split into perfect matchings . Thinking of these matchings as allocations, and together with the allocation , we get
Since and for every (by optimality of ), it must be the case that all weak inequalities are in fact equalities, establishing in particular that , as desired. ∎
We now describe the reduction from the general case to the unitdemand market case. We are given a market with agents where each agent is demand and . Our reduction keeps the same set of items , but splits each agent to identical unitdemand agents, where for each copy, the value of the agent for an item is simply . Clearly, the number of unit demand agents as a result of this reduction is . Let be the set of unit demand bidders that corresponds to agent , and let .
Given an allocation for the original market, where for every , the corresponding allocation in the unitdemand market splits the different items arbitrarily between the unit demand bidders corresponding to bidder , with each bidder receiving exactly one item. Notice that the social welfare achieved by this allocation is the same as in the original allocation. Similarly, given an allocation in the unitdemand market, the corresponding allocation in the original market gives all the items allocated to agents in to agent . Again, since the resulting allocation achieves the same welfare as the original one.
Lemma 3.8.
An allocation is legal in the original market if and only if it is legal in the corresponding unitdemand market. An allocation is optimal in the original market if and only if it is optimal in the corresponding unitdemand market.
Proof.
Consider an optimal allocation in the original market and recall our assumption that optimal allocations give each player exactly items. The corresponding allocation in the unitdemand market obtains the same value. Similarly, given an optimal allocation in the unitdemand market where each agent gets one item, the corresponding allocation in original market obtains the same value. Therefore, an allocation is optimal in the original market if and only if it is optimal in the corresponding unitdemand market.
Similar reasoning shows that given a legal allocation in the original market, the corresponding allocation in the unitdemand market is legal as well and vice versa. ∎
To complete the proof of Theorem 3.5, take a legal allocation in the original market. According to Lemma 3.8 it is also legal in the corresponding unitdemand market. From Lemma 3.7, we get that it is optimal in the unitdemand market. Again, by Lemma 3.8, we get that the corresponding allocation in the original market is also optimal. ∎
3.1.4 The ItemEquivalence Graph
Let be some optimal allocation and the corresponding preference graph. For every player and set of players , we denote by the set of items allocated to player in that can alternatively be allocated to any player in as a part of some optimal allocation (and only to the players in ). For example, is the set of items such that there are optimal allocations , in which is allocated to players 2, 3 (respectively), and for any other player , there is no optimal allocation in which is allocated to . Formally,
In other words, is the set of items allocated to in and whose set of players to which they are legal is exactly . We make a few observations:

The sets form a partition of (some of these sets might be empty sets).

Let and for . If participates in a 0weight cycle in and , then .
The second observation holds since if participates in a 0weight cycle, then there is an alternative optimal allocation in which is allocated to player (see Claim 3.1 with ).
Definition 3.9 (ItemEquivalence Graph).
Given an optimal allocation , its associated itemequivalence graph is the directed graph with vertices
and directed edges
For example, and are edges in the itemequivalence graph (assuming that the participating sets are nonempty), whereas, for example, and are not. Note also that the number of vertices is polynomial in .
The next claim shows that the itemequivalence graph can be computed efficiently.
Claim 3.10.
Given an optimal allocation , its associated itemequivalence graph can be computed in time and value queries.
Proof.
Clearly the main problem is determining the nonempty sets . We can efficiently determine the set that any item belongs to by executing the following subroutine: go over all players and compute the optimal social welfare in the residual market obtained by fixing to player . Denote the result by and compare with the optimal social welfare in the original market, denoted by . belongs to the set for the set of players . ∎
The following lemma uses Theorem 3.5 to establish a correspondence between 0weight cycles in and cycles in .
Lemma 3.11.
Let be an optimal allocation and let and be the corresponding preference graph and itemequivalence graph, respectively. Then:

If is a cycle in then for any items , the cycle is a 0weight cycle in .

If is a 0weight cycle in , and for every then is a cycle in .
Proof.
Let be a cycle in , let and note that the edges exist in (since these are items that belong to different players). Consider the cycle in . We need to show that . We can assume w.l.o.g. that all the items are different as otherwise is a union of two or more cycles for which this assumption holds (these cycles are derived from corresponding subcycles of ), and the weight of a union of 0weight cycles is 0. By definition of we have for every (again we identify with ) and so we conclude that the allocation obtained from by passing to player is a legal allocation and thus optimal (by Theorem 3.5). Since is also optimal, we conclude by Claim 3.1 that
We now prove part 2. Let be a 0weight cycle in . Again we can assume w.l.o.g. that all items are different. For all let and be the player and set such that . By Claim 3.1 the allocation obtained from by passing to player is optimal and thus legal. We conclude that for all implying that the edges exist in . Therefore is a cycle in . ∎
As explained in section 3.1.2, our main challenge in the dynamic pricing problem is to come up with a method to remove all 0weight cycles from in a way that each potential deviation of any player from the designated bundle , that emanates from the edge removals, is consistent with some optimal allocation. In particular the method must overcome the “bottleneck problem” (as illustrated in Figure 1). Lemma 3.11 allows us to shift the focus from removing 0weight cycles in to removing cycles in and translate these removals back to .
[Running Example] Figure 2 shows the (simple) itemequivalence graph obtained from the initial optimal allocation. Each of the items is allocated to buyer 3 in some other optimal allocation (and is never allocated to buyer 2). Thus . Similarly we have and . Note that removing any of the edges of the itemequivalence graph makes it cyclefree. Thus, by Lemma 3.11, if we choose one of the edges and remove all edges in the preference graph corresponding to the chosen edge, then the preference graph will remain cyclefree as desired in the Goal in section 3.1.2. Now, removing the edges corresponding to could cause player 1 to take the bundle instead of his designated bundle , and this cannot be completed to an optimal allocation. On the other hand, removing the preference graph edges that correspond to the edges and is fine. If player 2 arrives first to the market, then the removal of edge might cause her to take the item instead of or , and both options are consistent with some optimal allocation. Likewise if player 3 arrives first and takes or instead of then this too can be completed to an optimal allocation. The important property here is that has minimal size in the cycle, and thus removing its incoming and outgoing edges introduces tolerable potential deviations.
3.2 Solution for 3 MultiDemand Buyers
We are now ready to present the dynamic pricing scheme for multidemand buyers.
Remark 3.12.
The algorithm makes use of the itemequivalence graph. We abuse notation and instead of writing () we write (). Thus the vertices of the itemequivalence graph for three players are
where each column corresponds to a different player.
[Running Example] Figure 3 demonstrates the graphs , and obtained in the pricing scheme when run on our example, based on the optimal allocation . The edges that get marked in the itemequivalence graph are and in step 1. This translates to the removal of the outgoing edges from to and from to when transitioning from to and consequently no 0weight cycles are left. This remains true also after subtracting from every edge that does not touch .
As stated before (Section 3.1.1 and Claim 3.10), computing , and can be done in polynomial time. Finding the cycles in can also be done efficiently ( has a constant number of nodes) as well as computing minweight paths. Thus the algorithm indeed runs in time as desired.
Lemma 3.13.
After step 1 every cycle in has strictly positive weight.
Proof.
Since every cycle in has nonnegative weight (Corollary 3.2), it is enough to show that at least one edge was removed from every 0weight cycle (note that is sufficiently small enough so that any positiveweight cycle in remains positiveweight in ). By Lemma 3.11 it is enough to show that at least one edge was marked in each cycle in the itemequivalence graph. Let be such a cycle. Note that all outgoing edges of every vertex with 3 indices were marked in step 1 (for every such edge, the reverse edge also exists in the itemequivalence graph, forming a 2edge cycle). Furthermore, the vertices do not participate in any cycle as they have no incoming edges. Thus we can assume that contains only vertices with 2 indices. Assume w.l.o.g. that is one of the vertices in . We split to the following cases, based on the structure of starting at :

Case 1: . Here, the first edge is part of a 2edge cycle and thus it was marked.

Case 2: . Here, the second edge was marked similarly to the previous bullet.

Case 3: . Here, at least one of the edges was marked in step 1.
∎
Lemma 3.14.
For any item , .
Proof.
The 0weight path is some path from to , and thus . Thus as desired. ∎
Lemma 3.15.
For any player , and ,if then .
Proof.
By the triangle inequality we have
The claim follows. ∎
Lemma 3.16.
For any player and item we have .
Proof.
Consider a minweight path from to in , , and for every let be the player such that (note that ). Since every cycle in has positive weight (Lemma 3.13) it must be the case that all the vertices are different (otherwise this is not a minweight path) and . We have
where is the allocation obtained from by passing the item to player for all , and disallocating . Therefore, . By the assumption that every optimal allocation allocates all items, we conclude that is a suboptimal allocation and therefore the last term is positive as desired (note that is sufficiently small). ∎
We are now ready to prove that the output of our dynamic pricing scheme meets the requirements of Corollary 3.6. This is cast in the following lemma:
Lemma 3.17.
Let be the price vector output by the dyanmic pricing scheme. Then, For every player and :

is legal for player .

can be completed to a legal allocation, i.e. there exists an allocation of the items to the other players in which every player receives a bundle that is legal for her.
Proof.
We prove for (the same proof applies also for ). We first prove Part 1. We start by showing that every is of size . Since all item prices are positive (Lemma 3.14) and player 1 is demand, it cannot be the case that player 1 maximizes utility with a bundle consisting of more than items. Furthermore, by Lemma 3.16 there are at least legal items from which she derives positive utility. Combining, every demanded bundle has exactly items. Now, for any two items where and is not legal for player 1, the edge was not removed in the transition from to (since there is no corresponding edge in the itemequivalence graph that could have been marked). Thus, player 1 strongly prefers over (by Lemma 3.15) and we conclude that every demanded bundle contains only legal items, as desired.
We proceed to prove part 2. Let . We refer to the items in as the items that player 1 ‘stole’ from players 2 and 3, and to the items in as those player 1 ‘left behind’. We need to show that players 2 and 3 can compensate for their stolen items in a ‘legal manner’, that is, by completing their leftover bundles and to and legal items, respectively. The first step is to determine where the stolen and left behind items are taken from. This is done in the following two claims:
Claim 3.18.
.
Proof.
Since , it is enough to show that is contained in any demanded bundle of Player 1. Note that does not participate in any cycle in the itemequivalence graph, implying that none of its outgoing edges were marked. This in turn implies (by Lemma 3.15) that player 1 strongly prefers every item of over every item . Furthermore, she derives positive utility from these items (Lemma 3.16). We conclude that the items in are contained in every demanded bundle, as desired. ∎
Claim 3.19.
.
Proof.
The claim follows directly from the fact that is legal for player 1. ∎
We denote
In words, is the number of items player 1 left behind in , is the number of items she ‘stole’ from player 2 out of the items in , is the amount she ‘stole’ from player 3 out of the items in , etc. By the previous two claims and by the fact that (since ) we have
(2) 
Consider the bipartite graph whose left side consists of the items in and whose right side consists of the items in , with edges whenever the stolen item can be replaced by the leftover item legally (e.g., if , then ). Specifically, is composed of a biclique between the stolen items from (the stolen items of player 2) and the leftover items from (these are the leftover items that are legal for player 2), and of another biclique between the stolen items of (the stolen items of player 3) and the leftover items of (the leftover items that are legal for player 3). If there is a perfect matching in , then every stolen item can be replaced with the item it was matched to in the perfect matching, resulting in a legal allocation, and we are done. Thus we assume that there is no perfect matching in . In this case Hall’s condition does not hold for . One can verify that this implies one of the following:
Assume w.l.o.g. that . Then, by equation (2), we have . We claim that this implies . The reason is that otherwise, player 1 stole some item, denoted , from and left behind some item, denoted , in . But this cannot be the case since this would imply (by Lemma 3.15) that the edge was removed in the transition from to , but the edge was never marked in the pricing scheme. Therefore and . The combination of and implies that the edge was marked in step 1, and so one of is of minimal size in the cycle . In particular,
where the equality holds by equation (2). In order to complete to a legal allocation, player 2 compensates for his stolen items by taking the items player 1 left behind in and by “stealing” items from (indeed there are enough items there for player 2 to steal). Player 3 now has to compensate for the items stolen from her by both players, a total of items. Since player 1 left precisely this number of items in , player 3 can take them. Note that the resulting allocation is indeed legal and thus optimal.
∎
4 Dynamic Pricing for UnitDemand Bidders Without TieBreaking
In [10] the authors present a polytime dynamic pricing scheme that leads to an optimal allocation for unitdemand buyers. In their pricing scheme, buyers may have multiple bundles in their demand, but every tiebreaking rule leads to optimal welfare. In this section, we show how the scheme from [10] can be modified so that all buyers have exactly one bundle in their demand; i.e., pricing such that for every buyer , , and the unique bundle in is legal. This property decreases the uncertainty regarding the obtained outcome.
As explained in section 3.2, we can assume w.l.o.g. that all items are necessary for optimality (i.e., are allocated in every optimal allocation), thus . Moreover, we think of each optimal allocation as if it allocates exactly items, some of which are imaginary items (recall that for unitdemand buyers, an imaginary item is legal for a player if there is some optimal allocation in which that player receives no item; see Appendix B).
Our scheme also works by removing 0weight cycles from the preference graph, but does so using a different approach than [10]. Recall that in a 0weight cycle, every item is legal for the player possessing the preceding item in the cycle (this is an immediate corollary of Claim 3.1). In [10], the whole cycle is removed, potentially allowing each buyer on the cycle to take the subsequent item. Here, we take some item on the cycle and replace its preceding item with a “copy” of item