The exchange market model has been introduced by Walras in 1874 . In this model, a set of agents arrive at a market with an initial endowment of divisible goods and have a utility function over allocations of goods. Agents can use their revenue from selling their initial endowment to purchase their preferred bundle of goods. In a market equilibrium, the prices are such that each agent can spend their entire revenue on a bundle of goods that maximizes her utility at the given prices, and all goods are fully sold.
The celebrated result of Arrow and Debreu  shows the existence of an equilibrium for a broad class of utility functions. Computational aspects have been already addressed since the 19th century, see e.g. , and polynomial time algorithms have been investigated in the theoretical computer science community over the last twenty years; see the survey  for early work, and the references in  for more recent developments.
In this paper we study the case where all utility functions are linear. Linear market models have been extensively studied since 1950s, see 
for an overview of earlier work. These models are also appealing from a combinatorial optimization perspective due to their connection to classical network flow models and their rich combinatorial structure. A well-studied special case of the exchange market is theFisher market setting, where every buyer arrives with a fixed budget instead of an endowment of goods. Using network flow techniques, Devanur et al.  gave a polynomial-time combinatorial algorithm that was followed by a series of further such algorithms [20, 31], including strongly polynomial ones [28, 34]. In contrast, for the general exchange market the first combinatorial algorithm was developed much later by Duan and Mehlhorn , and no strongly polynomial algorithm has been known thus far.
Strongly polynomial algorithms and rational convex programs
Assume that a problem is given by an input of rational numbers given in binary description. An algorithm for such a problem is strongly polynomial (see [21, Section 1.3]), if it only uses elementary arithmetic operations (addition, comparison, multiplication, and division), and the total number of such operations is bounded by poly(). Further, the algorithm is required to run in polynomial space: that is, the size of the numbers occurring throughout the algorithm remain polynomial in the size of the input. Here, the size of a rational number with integers and is defined as .
It is a major open question to find a strongly polynomial algorithm for linear programming. Most existing strongly polynomial algorithms are for special classes of linear optimization problems, and there are only sporadic results for nonlinear convex optimization. The relevance of certain market equilibrium problems in this context that they can be described by rational convex programs, where a rational optimal solution exists with encoding size bounded in the input size (see ). This property gives hope for finding strongly polynomial algorithms.
The linear Fisher market equilibrium can be captured by two different convex programs, one by Eisenberg and Gale , and one by Shmyrev . These are special cases of natural convex extensions of classical network flow models [33, 34]. In particular, the second model is a network flow problem with a separable convex cost function;  provides a strongly polynomial algorithm for the linear Fisher market using this general perspective.
The exchange market model cannot be described by such simple convex programs. A rational convex program was given in , but the objective is not separable and hence the result in  cannot be applied. Previous convex programs [6, 22, 26] included nonlinear constraints and did not appear amenable for a combinatorial approach (see  for an overview).
Let be the set of agents. Without loss of generality, we can assume that there is one unit in total of each divisible good, and that there is a one-to-one correspondence between agents and goods: agent brings the entire unit of the -th good, to the market. If agent buys units of good , her utility is , where is the utility of agent for a unit amount of good . Given prices , the bundle that maximizes the utility of agent is any choice of maximum bang-per-buck goods, that is, goods that maximize the ratio . The prices and allocations form a market equilibrium, if (i) for all , that is, every good is fully sold; (ii) for all , that is, every agent spends her entire revenue; and (iii) implies that , that is, all purchases maximize bang-per-buck.
Algorithms for the linear exchange market
A finite time algorithm based on Lemke’s scheme  was obtained by Eaves . A necessary and sufficient condition for the existence of equilibrium was described by Gale . The first polynomial-time algorithms for the problem were given by Jain  using the ellipsoid method and by Ye  using an interior point method. The combinatorial algorithm of Duan and Mehlhorn  builds on the algorithm  for linear Fisher markets. An improved variant was given in  with the current best weakly polynomial running time , assuming all values are integers between and . A main measure of progress in these algorithms is the increase in prices. However, the upper bound on the prices depends on the values; therefore, such an analysis can only provide a weakly polynomial bound. The existence of a strongly polynomial algorithm is described in  as a major open question. There is a number of simple algorithms for computing an approximate equilibrium [10, 18, 19, 23], but these do not give rise to polynomial-time exact algorithms.
We provide a strongly polynomial algorithm for linear exchange markets with running time , where is the number of pairs with ; clearly, . Let us give an overview of the main ideas and techniques. Let denote the set of edges (pairs of agents and goods) that correspond to a best bang-per-buck transaction in every equilibrium. In the algorithm, we maintain a set called revealed edges, and the main progress is adding a new edge in strongly polynomial time. At a high level, this approach resembles that of , which extends Orlin’s approach for minimum-cost circulations .
In a money allocation , is a set of prices and represent the amount of money paid for good by agent ; may only be positive for maximum bang-per-buck pairs. In the algorithm we work with a money allocation where goods may not be fully sold and agents may have leftover money; we let denote the total surplus money left, and the maximum surplus of any good. It can be shown that if in a money allocation, then . This is analogous to the method of identifying abundant arcs for minimum cost flows by Orlin .
We use a variant of the Duan-Mehlhorn (DM) algorithm to identify abundant arcs. We show that the potential decreases geometrically in the algorithm; from this fact, it is not difficult to see that an arc with appears in a strongly polynomial number of iterations, yielding the first revealed arc. We need to modify the DM algorithm 
so that, among other reasons, the potential decreases geometrically when we run the algorithm starting with any arbitrary price vector; see Remark 5.1 in Section 5 for all the differences.
To identify subsequent revealed arcs, we need a more flexible framework and a second subroutine. We work with the more general concept of -allocations, where the money amount could be negative if . This is a viable relaxation since an -equilibrium (namely, a market equilibrium with possibly negative allocations in ) can be efficiently turned into a proper market equilibrium, provided that . Given a set of revealed arcs, our Price Boost subroutine finds an approximately optimal -allocation using only edges in . Namely, the subroutine finds an -equilibrium if there exists one; otherwise, it finds an -allocation that is zero outside , and subject to this, it approximately minimizes . This will provide the initial prices for the next iteration of the DM subroutine. Since DM decreases geometrically, after a strongly polynomial number iterations it will need to send a substantial amount of flow on an edge outside , providing the next revealed edge.
Let us now discuss the Price Boost subroutine. The analogous subproblem for Fisher markets in  reduces to a simple variant of the Floyd-Warshall algorithm. For exchange markets, we show that optimizing can be captured by a linear program. A strongly polynomial LP algorithm would therefore immediately provide the desired subroutine. Alas, this LP is not contained in any special class of LP where strongly polynomial algorithms are currently known.
We will exploit the following special structure of the LP. The objective is to maximize the sum of all variables over a feasible set of the form . The first polyhedron is defined by inequalities with one positive and one nonnegative variable per inequality. The constraint matrix defining the second polyhedron is what we call a -matrix: all off-diagonal elements are nonpositive but all column sums are nonnegative. In case we only had constraints of the form , classical results [1, 5, 25] would provide a strongly polynomial running time. To deal with the constraints defining , we approximate our LP by a second LP that can be solved in strongly polynomial time.
More precisely, we replace the second polyhedron by such that , and that is also a system with one positive and one nonnegative variable per inequality. Thus, the algorithms [1, 5, 25] are applicable to maximize the sum of the variables over in strongly polynomial time. For an optimal solution , the vector is feasible to the original LP and the objective value is within a factor of the optimum. For the purposes of identifying a new revealed arc in the algorithm, such an approximation of the optimal value already suffices.
The construction of the approximating polyhedron is obtained via a general method applicable for systems given by -matrices. We show that for such systems, Gaussian elimination can be used to generate valid constraints with at most two nonzero variables per row. Moreover, we show that the intersection of all relevant such constraints provides a good approximation of the original polyhedron.
The rest of the paper is structured as follows. Section 2 introduces basic definitions and notation. Section 3 describes the overall algorithm by introducing the notion of -allocations, the main potential, and the two necessary subroutines. Section 4 proves the lemmas necessary for identifying revealed edges. Section 5 presents the first of these two subroutines, a variant of the Duan-Mehlhorn algorithm. Section 6 shows how the second subroutine, Price Boost, can be reduced to solving an LP. Section 7 exhibits the polyhedral approximation result for -matrices. Section 8 concludes with some open questions.
For a positive integer , we let , and for , we let . For a vector , we let
denote the , , and -norms, respectively. Further, we let denote the support of the vector , that is, . For a subset , we let .
The linear exchange market
We let denote the set of agents, denote the set of goods, and denote the utility of agent for a unit amount of good . Let denote the set of pairs such that ; let . We will assume that for each there exists a such that , and for each there exists an such that . Hence, .
The goods are divisible and there is one unit of each in total. Agent arrives to the market with her initial endowment comprising exactly the unit of good . As mentioned in the introduction, the general case with an arbitrary set of goods and arbitrary initial endowments can be easily reduced to this setting; see [8, 22].
Let denote the prices where is price of good . Given prices , we let
For each agent , the goods satisfying equality here are called maximum bang-per-buck (MBB) goods; for such a good , is called an MBB edge. We let denote the set of MBB edges at prices .
Let denote the money flow where is the money spent by agent on good . We say that is a money allocation if
, and ;
for every agent ;
for every good .
For the money allocation , the surplus of agent is defined as
and the surplus of good is defined as
Parts (iii) and (iv) in the definition of the money allocation assert that the surplus of all agents and goods are nonnegative. We let and denote the surplus vectors of the agents and the goods, respectively. Clearly, , and .
A money allocation is called a market equilibrium if .
Existence of an equilibrium
A market equilibrium may not exist for certain inputs. For example, consider a market with 3 agents and 3 goods, where agent brings one unit of good for . Let . Clearly, in this market, at any prices, Agent 3 will consume the entire . If , then Agent 2 will demand a non-zero amount of , and therefore no market equilibrium exists.
A necessary and sufficient condition for the existence of an equilibrium can be given as follows. Let us define the directed graph , where if and only if (that is, if .
There exists a market equilibrium if and only if for every strongly connected component of the digraph , if , then there is a loop incident to the node in .
This condition can be easily checked in strongly polynomial time. Further, it is easy to see that if the above condition holds, then finding an equilibrium in an arbitrary input can be reduced to finding an equilibrium in an input where the digraph is strongly connected. Thus, we will assume this throughout the paper:
|The graph is strongly connected.||()|
3 The overall algorithm
In this section, we describe the overall algorithm. We formulate the statements that are needed to prove our main theorem:
There exists a strongly polynomial algorithm that computes a market equilibrium in linear exchange markets in time .
We start by introducing the concepts of revealed edges, -allocations, and balanced -flows.
3.1 Revealed edges
Throughout the paper, we let denote the set of edges that are MBB edges for every market equilibrium . In the algorithm, we will maintain a subset of edges that will be called the revealed edge set. This will be initialized as .
For an edge set , is an -money allocation, or -allocation in short, if
, and for ;
for every agent ;
, for every good .
An -allocation is called an -equilibrium if .
Note that could be negative for . A -allocation simply corresponds to a money allocation. Whereas an -equilibrium is not necessarily an equilibrium, the following holds true:
Let , and assume we are given an -equilibrium . Then a market equilibrium can be obtained in time.
We let Final-Flow denote the algorithm as in the Lemma. This is a maximum flow computation in an auxiliary network, as described in the proof in Section 4. The main progress step in the algorithm will be adding new edges to . This will be enabled by the following lemma; this will also be used in the proof of Lemma 3.1.
Let , and let be an -allocation. If for an edge , then .
3.2 Balanced flows
Given an edge set and prices , we say that is a balanced -flow, if is an -allocation that minimizes , and subject to that, it minimizes .
Given and prices such that , a balanced -flow can be computed in time.
3.3 The algorithm
The overall algorithm is presented in Algorithm 1. The main progress is gradually expanding a revealed edge set , initialized as . Every cycle of the algorithm performs the subroutines Boost and DM, and at least one new edge is added to at every such cycle. Once an -equilibrium is obtained for the current , we use the subroutine Final-Flow as in Lemma 3.1 to compute a market equilibrium.
We now introduce the key potential measures used in analysis. For an -allocation , we define
Note that this is invariant under scaling, i.e. for any . Further, is an -equilibrium if and only if . For a given , we define
There exists a strongly polynomial time algorithm that for any input , returns in time an -allocation with such that .
The algorithm in the theorem will be denoted as Boost(), and is described in Section 6. In particular, if , then Boost() returns an -equilibrium.
The second main subroutine DM(), is a variant of the Duan-Mehlhorn algorithm , described in Section 5. As the input, it uses the prices obtained in the -allocation returned by Boost(), and outputs an -allocation such that either , that is, an -equilibrium, or it is guaranteed that for some connecting two different connected components of . Such an edge can be added to by Lemma 3.2. The following simple lemma asserts the existence of such an edge.
Let be an -allocation such that . Then, for at least one edge such that and are in two different undirected connected components of .
For a contradiction, assume for every where and are in different connected components of . Let us define as follows. We start by setting ; then, for every where and are in the same component, we reroute units of flow from to using a path in (that may contain both forward and reverse edges). Further, we set for if and are in different connected components of . The assumption yields
a contradiction to the definition of , since . ∎
There exists a strongly polynomial time algorithm, that, for a given and prices , computes an -allocation such that
where is the balanced flow computed by Balanced().
Proof of Theorem 3.1.
By Lemma 3.4, the number of connected components of decreases after every cycles of Algorithm 1; thus, the total number of cycles is . Consider any cycle. Let denote that -allocation returned by Boost() with , and let denote the balanced -flow at prices . Then,
is extended by at least one new edge in this cycle. The overall running time estimation is dominated by the running time estimation of the calls toDM. ∎
4 -allocations and -equilibria
Proof of Lemma 3.2.
The claim is obvious is ; for the rest of the proof we therefore assume . Let be a market equilibrium. Every edge in is an MBB-edge for by the definition of an -allocation, and also for because of . Since equilibrium prices are scale invariant in linear exchange markets, we can assume that . Let be the set of goods whose prices at are at least the prices at , i.e., . Clearly, . Let be the set of agents who have MBB edges to goods in at , i.e.,
Observe that agents of do not have MBB edges to goods in when prices are .
For a contradiction, suppose is not an MBB edge at . In that case, it follows that . Consider the goods in at prices . Since no good is oversold, we have
Also note that whenever and . This is because could be negative only on edges in ; however, for every such that , we must have , since all edges in have to be MBB in every equilibrium. Therefore, the previous inequality implies
The agents in do not have MBB edges at price to goods in , thus, the first term in the left hand side is the total money they spend. Since their total surplus is at most , we obtain
Using and breaking into two parts, we can rewrite the above as
Let us now examine the market equilibrium , where and is allowed only for the MBB edges at . Since every agent spends their budget exactly at equilibrium, we have
Further, since there are no MBB edges at prices from agents outside to goods in , we obtain
Again we can rewrite the above as
If , then for every -equilibrium , .
Proof of Lemma 3.1.
Note that the only reason for an -equilibrium to be not a market equilibrium is that has negative values on some edges in . If has negative values, then we update to a maximum flow in the following network : The network has vertices , where is a source node and is a sink node, and it has the following set of edges: with capacity for each , and with capacity for each , with infinite capacity for each MBB edge . If saturates all edges out of (equivalently, all edges into ), then clearly is a market equilibrium. We will show that this is indeed the case. The running time is obtained using Orlin’s maximum flow algorithm .
Let be an equilibrium. Since equilibrium prices are invariant to scaling by a positive constant, we can assume that . If , then clearly is an equilibrium. For the other case, , let , and let . Corollary 4.1 and the definition of imply .
Next, let , and . Let be the set of agents who have at least one MBB edge to goods in when prices are , i.e.,
We must have
Now consider the connected components of the bipartite graph . Since , there are connected components of such that . Furthermore, we also have , because prices of goods in are increased by the largest factor when we go from to , and . At the -equilibrium , we have
The equations (4) and (5) imply that and , i.e., the set of goods brought by agents in is exactly equal to . This further implies that for agents in and for goods in is supported only on the edges between them, and hence must saturate all agents in (and equivalently, all goods in ) because the set of MBB edges between and remains same at and . Next, we remove the agents in and goods in , and repeat the same analysis on the remaining set of agents and goods. This proves that is a market equilibrium. ∎
5 The Duan-Mehlhorn (DM) subroutine
In this section, we present a variant of the Duan-Mehlhorn (DM) algorithm  as a subroutine DM in Algorithm 2. This takes as the input a revealed edge set and prices such that , and outputs either an -equilibrium, or an -allocation where for some connecting two different components of . The modifications compared to the original DM algorithm are listed in Remark 5.1. Here, we provide a description where the subroutine terminates once an arc with is identified. We obtain the variant as required in Theorem 3.5 simply by removing the termination condition, and letting the algorithm run for iterations of the outer loop.
We call one execution of the outer loop a phase, and one execution of the inner loop an iteration. Algorithm 2 first computes a balanced flow using the subroutine Balanced() as in Lemma 3.3. Then, the agents are sorted in decreasing order of surplus. Without loss of generality, we assume that . Then, we find the smallest for which the ratio is more than . If there is no such then we let . Let be the set of first agents, and let be the set of goods for which there is a non-zero flow from agents in . Since is balanced, the agents outside have zero flow to goods in , i.e., and the surplus of every good in is zero. We set to before we go into the inner loop.
Next, the algorithm runs the inner loop where it increases the prices of goods in and the flow between agents in and goods in by a multiplicative factor until one of the three events occurs. Observe that except for the MBB edges where , all MBB edges remain MBB with this price change, and the surplus of every good in remains zero. When prices of goods in increase, an edge from and can become MBB. We need to stop when such an event occurs in order to maintain an -allocation. This is captured by Event 1. In Event 2, we stop when the surplus of an agent becomes equal to either the surplus of an agent or zero. Let us note that is maintained throughout; we use the expression to also cover the possible case . In Event 3, we stop when becomes .
If Event 1 occurs, then we have a new MBB edge from to . Using this new edge, it is now possible to decrease the surplus of agent and increase the surpluses of agents by increasing and decreasing . We next check if this can lead to making the surplus of an agent and equal. Observe that it is always possible if there exists an edge . If yes, then we break from the inner loop, otherwise we update flow so that agent buys the entire good , add to , update to , and go for another iteration.
The number of iterations in a phase is at most .
Consider the iterations of a phase. At the beginning of every iteration, the size of grows by , and hence there cannot be more than iterations in a phase. ∎
When we break from the inner loop, we recompute a balanced flow and then check if either is zero or there is an edge with connecting two different components of . If yes, then we return the current , otherwise we go for another phase. Next, we show that remains an -allocation throughout the algorithm, which implies that the algorithm returns an -allocation.
The output of Algorithm 2 is an -allocation.
We only need to show that throughout the algorithm. Observe that an MBB edge becomes non-MBB only if and , where and are obtained with respect to a balanced flow . If an edge is such that and then it contradicts that is a balanced flow because the edges in are allowed to carry negative flow. ∎
The running time analysis of Algorithm 2 is based on the evolution of the norm and prices . If a phase terminates due to Event 3, then we call it price-rise, otherwise balancing. The next two lemmas are crucial that eventually imply that the potential function decreases substantially within a strongly polynomial number of phases.
In Algorithm 2, the price of every good monotonically increases and the total surplus, i.e., , monotonically decreases.
Clearly, price of every good monotonically increases in Algorithm 2. During a price increase step, is maintained for every , and does not change for . If the allocation changes during Event 1, then decreases to 0, and the other surpluses remain unchanged. When a balanced flow is recomputed at the end of a phase, then can only decrease. ∎
Let be a balanced flow in at the beginning of a phase, and let be the prices and flow at the end of the phase. Then
in a price-rise phase, and
in a balancing phase,
The number of arithmetic operations in a phase of Algorithm 2 is .
From Lemma 5.1, the number of iterations in a phase is at most . In each iteration, we find the minimum where one of the events occur, which takes at most arithmetic operations. If Event occurs, then we define another surplus vector , and based on this we decide to exit from the inner loop. This requires additional arithmetic operations. In total, each iteration takes arithmetic operations. The steps before the inner loop like sorting etc. takes arithmetic operations. We compute a balanced flow after exiting from the inner loop, in time according to Lemma 3.3. Overall, each phase takes arithmetic operations. ∎
In the next lemma, we show that the potential function decreases by a large factor within a strongly polynomial number of phases. This together with Lemmas 3.4 and 3.2 imply that every major cycle terminates in strongly polynomial time.
The potential function decreases by a factor of at least in