Abstract
Efficient computability is an important property of solution concepts. We consider the computational complexity of finding and verifying various solution concepts in trading networks—multisided matching markets with bilateral contracts and without transferable utility—under the assumption of full substitutability of agents’ preferences. It is known that outcomes that satisfy trail stability always exist and can be found in linear time. However, we show that the existence of stable outcomes—immune to deviations by arbitrary sets of agents—is an \({{\textsf{N}}}{{\textsf{P}}}\)hard problem in trading networks. We also show that even verifying whether a given outcome is stable is \({{\textsf{N}}}{{\textsf{P}}}\)hard in trading networks.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
One of the most important features of the marriage market or the college admissions problems is that (pairwise) stable outcomes can always be found efficiently using the celebrated Deferred Acceptance algorithm (Gale and Shapley 1962). Efficient computability is key for practical applications of the Deferred Acceptance algorithm and its variants (Roth 1984; Abdulkadiroğlu and Sönmez 2003; Sönmez and Switzer 2013; Hatfield and Kominers 2014). Moreover, since in standard (onetoone) marriage markets or (manytoone) college admissions problems (pairwise) stable outcomes coincide with the core, there is no obvious need to select among various solution concepts.
However, in more complex, manytomany matching markets there are many different, yet economically natural and interpretable solution concepts (Blair 1988; Sotomayor 1999; Echenique and Oviedo 2006; Klaus and Walzl 2009). For example, pairwise stable outcomes do not coincide with the core (Blair 1988). What makes a good solution concept? At the very least, it should make falsifiable predictions. But in economics good solution concepts often derive their appeal for normative reasons: they have sensible properties and make intuitive sense in particular settings. Efficient computability can serve as one such desirable property. As Papadimitriou (2007, p. 29–30) argues:
The reason is simple: If an equilibrium concept is not efficiently computable, much of its credibility as a prediction of the behavior of rational agents is lost – after all, there is no clear reason why a group of agents cannot be simulated by a machine. Efficient computability is an important modelling prerequisite for solution concepts.
If agents cannot efficiently find certain deviations from an outcome in a matching market, then a stability concept that is based on these deviations may be too strong. On the other hand, if it is computationally hard to verify whether an outcome satisfying a particular solution concept exists, then this limits the applicability of this solution concept for matching market design. Finding a solution concept with attractive computational as well as economic properties would allow trading networks to be deployed in a variety of empirical (Fox 2017) and practical applications (Morstyn et al. 2018).
Our model and its connections to previous work. In this paper, we consider the computational complexity of various solution concepts in trading networks. A trading network is a matching market in which heterogeneous agents (firms) can sign many contracts that specify the terms of the trade, quality of the product, price etc. with their suppliers (upstream) and with their buyers (downstream). Following a seminal contribution by Ostrovsky (2008), we assume that agents’ preferences are fully substitutable, that is, upstream and downstream contracts are complements, but contracts on the same side are substitutes. Following Ostrovsky (2008), Westkamp (2010) and Hatfield and Kominers (2012), contracts in our model are discrete and utility is not transferable.^{Footnote 1} However, the model is general enough to capture not only wealth effects, but also distortionary frictions, such as sales taxes or bargaining costs (see, for example, Fleiner et al. 2019).
We allow firms to enter into upstream or downstream contracts (or both) with any other firm. Hence, we impose no restrictions on the structure of the trading network in contrast to models of supply chains (Ostrovsky 2008; Westkamp 2010; Hatfield and Kominers 2012) where no firm can be simultaneously upstream and downstream from another (that is, where the trading network has an acyclic structure).
However, the generality of such a setting comes at a price: here, stable outcomes, i.e., those immune to arbitrary blocks by sets of firms, do not necessarily exist (Hatfield and Kominers 2012). The nonexistence of stable outcomes in a trading network model starkly contrasts models of supply chains where stable outcomes always exist (Hatfield and Kominers 2012), as well as the models with continuous prices without frictions where stable outcomes not only exist but also coincide with competitive equilibrium outcomes (Hatfield et al. 2013; Candogan et al. 2016; Fleiner et al. 2019).
Our contribution. Following Fleiner et al. (2016), we first point out that outcomes satisfying trail stability, an extension of pairwise or chain stability (Ostrovsky 2008), always exist and can be found in linear time (in the number of contracts) by an extension of the Deferred Acceptance algorithm (Theorem 1). Trailstable outcomes are immune to locally blocking trails (sequences of distinct contracts in which a buyer of one contract is the seller in the next). In a locally blocking trail, agents simultaneously accept pairs of upstream and downstream contracts along the trail, but there must also be agents that “kick off” (and “complete”) the blocking trail by unilaterally offering (or “accepting”) a single downstream (or a single upstream) contract. One can think of an agent in a locally blocking trail as a manager in a firm receiving a phone call with offer to buy inputs. The manager keeps the offer on hold until she is able to find a new sale contract. If she is successful, the locally blocking trail continues and if the trail comes back to the firm, another manager picks up the phone. Trail stability is an attractive solution concept in settings where agents are myopic or have only partial commitment power.^{Footnote 2}
Considering stable outcomes, we prove that deciding whether a stable outcome exists in a trading network is \({{\textsf{N}}}{{\textsf{P}}}\)hard. In fact, we prove a stronger result (Corollary 1) by showing that deciding if a stable outcome exists is \({{\textsf{N}}}{{\textsf{P}}}\)complete even in a flow network (Fleiner 2014), which is a special case of a trading network.
To obtain these hardness results, we use a relaxed stability concept that we call pathorcycle stability and that can be derived from trail stability by relaxing the requirement of locally blocking trails that agents can only make an upstream (downstream) offer following the receipt of a downstream (upstream) offer. Thus we allow agents to offer an upstream and a downstream contract simultaneously, forming blocking cycles. In this setting, pathorcyclestable outcomes are immune to blocking sets in the form of paths (trails in which every agent is distinct) or cycles. The key motivation for this concept is that in flow networks pathorcyclestable outcomes coincide with stable outcomes (Theorem 3), because any blocking set in a flow network can be decomposed into a set of blocking cycles and blocking paths. This idea is analogous to a result by Hatfield et al. (2021) showing that in trading networks blocking sets can be decomposed into certain ordered blocking sets (that they call chains) under a monotonicity condition.
Pathorcyclestable outcomes do not always exist in trading networks. We show that the decision problem of whether a pathorcyclestable outcome (or, equivalently by Theorem 3, a stable outcome) exists in a flow network is \({{\textsf{N}}}{{\textsf{P}}}\)complete (Theorem 2). Therefore, the ability to minimally coordinate upstream and downstream contract offers renders the computational problem for existence intractable. The proof gives a reduction to this problem from the problem of partitioning a directed graph into two acyclic sets, which is known to be \({{\textsf{N}}}{{\textsf{P}}}\)complete (Bokal et al. 2004). Our result superficially resembles the problems of determining the existence of pairwise stable outcomes in twosided hospitalresident markets with couples (McDermid and Manlove 2010), with sizes (Delacrétaz 2019), or with multidimensional knapsack constraints (Delacrétaz et al. 2019): in these models, as in ours, finding stable outcomes is hard due to the presence of various constraints. However, as far we know, none of our results has appeared elsewhere in the literature.
Finally, we show that even verifying that a particular outcome is not stable is \({{\textsf{N}}}{{\textsf{P}}}\)complete (Theorem 4). The proof provides a reduction from the set partition problem, which is known to be (weakly) \({{\textsf{N}}}{{\textsf{P}}}\)complete.
Our hardness results do not extend to more restricted models, such as the case of acyclic trading networks, or to alternative models with continuous prices without frictions. Determining computability properties of solution concepts in such settings is an open question.
Organization. Section 2 introduces the full model of trading networks and the special case of flow networks 2.3. In Sect. 3, we introduce trail stability 3.1, pathorcycle stability 3.2, and stability 3.3, and state the main results about the computational complexity of finding outcomes that satisfy these solution concepts.
2 Preliminaries
Our notation follows Fleiner et al. (2016).
2.1 Our model
In a trading network, there is a finite set of agents (firms or consumers) F and a finite set of contracts X. A contract \(x\in X\) is a bilateral agreement between a buyer \(b(x)\in F\) and a seller \(s(x)\in F\). Hence, \(F(x):=\{s(x),b(x)\}\) is the set of firms associated with contract x and, more generally, F(Y) is the set of firms associated with contract set \(Y\subseteq X\). Given a set \(Y \subseteq X\) of contracts, call \(Y^{f}_B:=\{x\in Y \mid b(x)=f\}\) and \(Y^{f}_S:=\{x\in Y \mid s(x)=f\}\) the sets of f’s upstream and downstream contracts in Y – for which f is a buyer and a seller, respectively. Clearly, \(Y^{f}_B\) and \(Y^{f}_S\) form a partition over the set of contracts \(Y^{f}:=\{y\in Y \mid f\in F(y)\}\) which involve f, since an agent cannot be a buyer and a seller in the same contract. A firm f is a terminal seller if there are no upstream contracts in X for f in the network and f is a terminal buyer if the network does not contain any downstream contracts in X for f. An agent who is either a terminal buyer or a terminal seller is called a terminal agent. In an acyclic trading network, no agent can simultaneously buy and sell from another agent, even via intermediaries.
Every firm has a choice function \(C^{f}\), such that \(C^{f}(Y^{f})\subseteq Y^{f}\) for any \(Y^{f}\subseteq X^{f}\).^{Footnote 3} We say that a choice function of \(f\in F\) satisfies the irrelevance of rejected contracts (IRC) condition if for any \(Y\subseteq X\) and \(C^{f}(Y)\subseteq Z\subseteq Y\) we have that \(C^{f}(Z)=C^{f}(Y)\) (Blair 1988; Alkan 2002; Fleiner 2003; Echenique 2007; Aygün and Sönmez 2013).
For any \(Y\subseteq X\) and \(Z\subseteq X\), define the chosen set of upstream contracts
which is the set of contracts f chooses as a buyer when f has access to upstream contracts Y and downstream contracts Z. Analogously, define the chosen set of downstream contracts
For brevity and by abuse of notation, we will also use \(C^f(YZ):=(C_B^f(YZ)C_S^f(ZY))\), so \(C^f(YZ)=(Y'Z')\) means that if f is offered upstream and downstream contracts Y and Z, respectively, then \(Y'\) and \(Z'\) are those among them that f chooses (with \(Y' \subseteq Y\) and \(Z' \subseteq Z\)). We also define the rejected sets of contracts \(R_{B}^{f}(YZ):= Y^f {\setminus } C_{B}^{f}(YZ)\) and \(R_{S}^{f}(ZY):= Z^f {\setminus } C_{S}^{f}(ZY)\). An outcome \(A\subseteq X\) is a set of contracts.
An outcome \(A\subseteq X\) is individually rational for an agent \(f\in F\) if \(C^{f}(A^{f})=A^{f}\). We call A acceptable if A is individually rational for all agents \(f\in F\). For outcomes \(W,A\subseteq X\), we say that A is (W, f)acceptable if \(A^{f}\subseteq C^f(W^{f}\cup A^{f})\), i.e., if the agent f chooses all contracts from set \(A^f\) whenever she is offered A alongside W. An outcome A is Wacceptable if A is (W, f)acceptable for all agents \(f\in F\). Note that outcome A is individually rational for agent f if and only if it is \((\emptyset ,f)\)acceptable.
2.2 Assumptions on choice functions
We can now state our key assumption on choice functions introduced by Ostrovsky (2008).
Definition 1
The choice function of \(f\in F\) is fully substitutable if for all \(Y'\subseteq Y\subseteq X\) and \(Z'\subseteq Z\subseteq X\) it is:

1
Sameside substitutable (SSS):

(a)
\(R_{B}^{f}(Y'Z)\subseteq R_{B}^{f}(YZ)\)

(b)
\(R_{S}^{f}(Z'Y)\subseteq R_{S}^{f}(ZY)\)

(a)

2
Crossside complementary (CSC):

(a)
\(R_{B}^{f}(YZ)\subseteq R_{B}^{f}(YZ')\)

(b)
\(R_{S}^{f}(ZY)\subseteq R_{S}^{f}(ZY')\)

(a)
Contracts are substitutable if every firm regards any of its upstream or any of its downstream contracts as substitutes, but its upstream and downstream contracts as complements. Hence, rejected downstream (upstream) contracts continue to be rejected whenever the set of offered downstream (upstream) contracts expands or whenever the set of offered upstream (downstream) contracts shrinks.
Hatfield et al. (2012) showed that testing substitutability can be performed in polynomial time if there is a preference relation over the contracts, but may require an exponential number of queries if we have access only to the choice functions of the agents.
2.3 Special case: flow networks and flowbased choice functions
We first define flowbased choice functions. Flowbased choice functions work differently for terminal and nonterminal agents. A terminal agent has a flowbased choice function if it always accepts all offered contracts. However, a nonterminal agent has a flowbased choice function if it accepts as many upstream and downstream contracts as it can (using a linear preference ordering) subject to the constraint that the number of accepted upstream and downstream contracts is the same.
Definition 2
\(C^f\) is flowbased if

whenever \(f \in F\) is a terminal agent, \(C^f(Y^f)=Y^f\) for any \(Y \subseteq X\);

whenever \(f \in F\) is not a terminal agent

f has linearorder preferences \(\succ ^f_B\) over \(X^f_B\) and linearorder preferences \(\succ ^f_S\) over \(X_S^f\), and

Given access to upstream contracts \(Y \subseteq X^f_B\) and downstream contracts \(Z \subseteq X^f_S\), a firm f with flowbased choice function will choose its k most preferred upstream contracts from Y according to \(\succ ^f_B\) and k most preferred downstream contracts from Z according to \(\succ ^f_S\) where \(k:=\min \{Y,Z\}\).

Since nonterminal agents with flowbased choice functions always pick the same number of upstream and downstream contracts, their preferences satisfy the socalled Kirchhoff equality.^{Footnote 4} It is immediate that flowbased choice functions defined in this way are fully substitutable and satisfy the IRC condition.
A flow network is a trading network in which there are exactly two terminal agents (and the remaining agents are nonterminal) and all choice functions are flowbased (Fleiner 2014).^{Footnote 5}
2.4 Computational complexity
We now provide a brief overview of the key concepts in computational complexity to ensure that our paper is selfcontained.^{Footnote 6} Computational complexity theory deals with assessing the intrinsic hardness of computational problems. Most often we deal with a decision problem Q where for each input instance I, expressed as a string, there is a correct answer: yes or no; consequently we talk about yes– and no–instances of Q. To measure how hard or easy a certain computational problem is, we consider the resources, in terms of time and space, necessary for an algorithm that answers the problem correctly. The running time of a given algorithm is described by a function T(n), denoting the maximum number of basic computational steps that the algorithm may perform on any input instance of length n.
We consider an algorithm efficient, if its running time can be upperbounded by a polynomial of constant degree. Decision problems that can be solved by such an algorithm are said to be in \({\textsf{P}}\), the class of polynomialtime solvable problems. The class \({{\textsf{N}}}{{\textsf{P}}}\) contains decision problem for which the answer yes can be efficiently verified given some short proof. More precisely, a decision problem Q belongs to the class \({{\textsf{N}}}{{\textsf{P}}}\), if for each yes–instance I of the problem, there exists a proof (or witness) w whose length is polynomial in I and that can be used to verify in polynomial time that I is indeed a yes–instance. As an example, consider the problem of deciding if a Stable Roommates with Ties instance admits a stable matching (the SRT problem): in case of a yes–instance and a witness for this in the form of a stable matching, we can easily verify its correctness by checking all possible blocking pairs.
Although for numerous problems in \({{\textsf{N}}}{{\textsf{P}}}\), such as the SRT problem above, no polynomialtime algorithm is known to exist, we currently have no definitive proof showing that some problem \(Q \in {{\textsf{N}}}{{\textsf{P}}}\) is not in \({\textsf{P}}\). Nevertheless, we can infer the hardness of Q by using polynomialtime reductions: a problem \(Q'\) can be polynomially reduced to Q, if for each instance \(I'\) of \(Q'\) we can compute in polynomial time an instance I of Q such that I is a yes–instance of Q if and only if \(I'\) is a yes–instance of \(Q'\). A problem Q is \({{\textsf{N}}}{{\textsf{P}}}\)hard, if any problem in \({{\textsf{N}}}{{\textsf{P}}}\) can be reduced to Q; and we say that Q is \({{\textsf{N}}}{{\textsf{P}}}\)complete, if it is \({{\textsf{N}}}{{\textsf{P}}}\)hard and contained in \({{\textsf{N}}}{{\textsf{P}}}\). The first problem ever shown to be \({{\textsf{N}}}{{\textsf{P}}}\)hard (by Cook 1971) was the problem of checking whether a formula in propositional logic is satisfiable (the SAT problem). Exploiting the transitivity of polynomialtime reductions, we can prove that a problem Q is \({{\textsf{N}}}{{\textsf{P}}}\)hard by giving a reduction from SAT or any other problem already known to be \({{\textsf{N}}}{{\textsf{P}}}\)hard.
3 Solution concepts and their computational complexity
3.1 Trail stability
In order to explain our first solution concept, we first define a trail.
Definition 3
A sequence \((x_{1},\ldots ,x_{M})\) of M distinct contracts for some \(M \in {\mathbb {N}}^+\) is a trail if \(b(x_{m})=s(x_{m+1})\) holds for all \(m\in \{1,\ldots ,M1\}\).
Note that a firm may appear several times along the trail (as opposed to contracts, which may appear at most once). Further note that a trail T is a sequence of contracts; however, since all contracts of a trail are distinct, we may sometimes use T to refer to the set of contracts contained in T, whenever this does not cause any confusion. The following solution concept was introduced by Fleiner et al. (2016).
Definition 4
An outcome \(A\subseteq X\) is trailstable if

1.
A is acceptable.

2.
There is no trail \(T=(x_1,x_2,\ldots ,x_M)\) such that \(T\in (X {\setminus } A)^M\) and

a
\(\{x_{1}\}\) is \((A,f_1)\)acceptable for \(f_{1}=s(x_{1})\), and

b
\(\{x_{m1}, x_{m}\}\) is \((A,f_m)\)acceptable for \(f_{m}=b(x_{m1})=s(x_{m})\) whenever \(1<m\le M\) and

c
\(\{x_{M}\}\) is \((A,f_{M+1})\)acceptable for \(f_{M+1}=b(x_{M})\).
Such a trail T is called a locally blocking trail to A.

a
Trail stability is a natural solution concept when firms interact mainly with their buyers and suppliers and deviations by arbitrary sets of firms are difficult to arrange. In a trailstable outcome, no agent wants to drop his contracts and there exists no sequence of consecutive bilateral contracts comprising a trail such that any intermediate agent who is offered a downstream (upstream) contract along the trail wants to choose it alongside the subsequent upstream (downstream) contract in the trail. Importantly, we require that the first (final) agent wants to unilaterally offer (accept) the first (final) contract in the trail.^{Footnote 7} For trail stability, we do not require that intermediate agents simultaneously accept all the contracts along the locally blocking trail. Instead they are simply required to myopically accept pairs of upstream and downstream contracts, one pair at a time, as they appear along the trail.^{Footnote 8}
Fleiner et al. (2016) proved that under full substitutability trailstable outcomes always exist in trading networks and, under certain conditions, have a familiar lattice structure. Trailstable outcomes may not be Paretoefficient. In a variant of our model with continuous prices, Fleiner et al. (2019) showed that in the economy, trailstable outcomes essentially coincide with competitive equilibrium outcomes even if distortionary frictions, such as sales taxes are present.^{Footnote 9} Here we focus on the computability of trailstable outcomes.
Theorem 1
(Fleiner et al. 2016). Suppose that in a trading network choice functions are fully substitutable and satisfy the IRC condition. Then a trailstable outcome exists and can be found in time linear in the number of contracts.
The proof of Theorem 1 follows immediately from the proof of existence of trailstable outcomes provided by Fleiner et al. (2016) and Adachi (2017). Trailstable outcomes are found by a generalized GaleShapley algorithm defined in Fleiner et al. (2016). In the generalized GaleShapley algorithm, at least one contract is rejected at each step and since the number of contracts is finite, the number of steps required to find a trailstable outcome is bounded by the number of contracts.
We remark that the running time of the algorithm in Theorem 1 is optimal in the sense that the number of steps necessary for simply reading all contracts is linear in the number of contracts.^{Footnote 10} Whether or not our lineartime algorithm is practical depends on the total number of contracts. In some cases the number of contracts can be rather large because, for example, the same trade at two different discrete prices creates two different contracts.
3.2 Pathorcycle stability
The definition of trail stability requires that there be initial and final agents that would unconditionally offer or accept an upstream or a downstream contract while all the intermediaries only make a downstream (upstream) offer after receiving an upstream (downstream) offer. Let us now relax this condition and allow agents to form blocking cycles: now every agent can offer an upstream and a downstream contract simultaneously without having to accept them individually. This is a mild strengthening of trail stability (whenever there is at most one contract between agents) that treats all blocking agents as intermediate agents in the blocking trail, and thus allows for a small amount of additional coordination among blocking agents.
For the sake of further simplicity, let us only focus on paths, i.e., trails in which all agents are distinct.
Definition 5
A sequence \((x_{1},\ldots ,x_{M})\) of M contracts for some \(M \in {\mathbb {N}}^+\) is a path if

\(b(x_{m})=s(x_{m+1})\) holds for all \(m\in \{1,\ldots ,M1\}\), and

all firms \(s(x_1), s(x_2), \dots , s(x_M)\), and \(b(x_M)\) are distinct.
Now, a trail that returns to its origin agent and goes through each of its agents only once is a cycle. More precisely:
Definition 6
A sequence \((x_{1},\ldots ,x_{M})\) of M contracts is a cycle if

\(b(x_{m})=s(x_{m+1})\) holds for all \(m\in \{1,\ldots ,M1\}\),

\(b(x_M)=s(x_1)\), and

all firms \(s(x_1), s(x_2), \dots , s(x_M)\) are distinct.
Definition 7
An outcome \(A\subseteq X\) is pathorcyclestable if

1.
A is acceptable.

2.
There is no path or cycle B such that \(B\in (X{\setminus } A)^{M}\) and B is (A, f)acceptable for each \(f \in F(B)\). Such paths or cycles are called blocking paths and blocking cycles.
An interesting property of flowbased choice functions is that given an outcome \(A \subseteq X\), any cycle C disjoint from A is a blocking cycle, as any firm which is offered a pair of additional upstream and downstream contracts will accept them. We will use this property to prove our second key result.
Theorem 2
It is \({{\textsf{N}}}{{\textsf{P}}}\)complete to decide if a flow network admits a pathorcyclestable outcome.
Proof
The problem is in \({{\textsf{N}}}{{\textsf{P}}}\), since given an outcome A, we can check in linear time (with respect to the number of contracts) whether it admits a blocking path or a cycle: we only have to check that the contracts \(X {\setminus } A\) do not contain a cycle or a path starting with an (\(A,\cdot )\)acceptable contract and ending with an (\(A,\cdot )\)acceptable contract; both these tasks can be decided using, e.g., some variant of the depthfirst search (DFS) algorithm on the directed graph representing \(X {\setminus } A\) (see the book by Cormen et al. 2009 for more details on the DFS algorithm).
To prove \({{\textsf{N}}}{{\textsf{P}}}\)hardness, we present a polynomial reduction from the following problem: given a directed graph D, decide whether it is possible to partition the vertices of D into two acyclic sets \(V_1\) and \(V_2\). Here, a set U of vertices is acyclic, if there is no directed cycle in D[U]. This problem was proved to be \({{\textsf{N}}}{{\textsf{P}}}\)complete by Bokal et al. (2004).
Given our input \(D=(V,E)\), we construct a set X of contracts and a set F of firms with flowbased choice functions (see Fig. 1 for an illustration). There will be at most one upstream contract and at most one downstream contract between any two firms, so we will denote a contract x with \(s(x)=f_1\) and \(b(x)=f_2\) as \(f_1 f_2\). First, we introduce a node gadget \(D_v\) for each \(v \in V\); the set of firms in \(D_v\) is \(\{s_v,a_v,a'_v,b_v,b'_v,t_v\}\) and the set of contracts in \(D_V\) is \(\{s_v a_v, s_v b_v, a_v a'_v, b_v b'_v, a'_v t_v, b'_v t_v\}\). Next, we add terminal firms s and t, together with the contracts \(s s_v\) and \(t_v t\) for each \(v \in V\). Finally, we add the contract set \(Z= \{ a'_u a_v, b'_u b_v \mid uv \in E\}\) where recall that E is the set of edges of the input graph D.
Instead of describing the full preferences of each firm over its upstream and downstream contracts, we only define a partial ordering (and assume that the preferences of each firm respect this partial order). Namely, for each \(v \in V\), we let \(s_v\) prefer \(s_v a_v\) to \(s_v b_v\), and we let \(t_v\) prefer \(b'_v t_v\) to \(a'_v t_v\). In Fig. 1, we indicate the rankings of the contracts with numbers 1 (highest rank), 2 (second highest) etc. Additionally, we let any firm in \(\{a_v,a'_v,b_v,b'_v\}\) prefer all contracts not in Z to contracts in Z.
We claim that there exists an outcome in X admitting neither blocking paths nor blocking cycles if and only if the vertices of D can be partitioned into two acyclic sets.
“\(\Rightarrow\)”: Let us suppose that there exists an outcome \(A \subseteq X\) that does not admit any blocking paths or cycles.
We show that \(Z \cap A = \emptyset\). To see this, first consider a contract \(a'_u a_v \in Z\), and suppose for contradiction that \(a'_u a_v \in A\). Since \(a_v\) has only one downstream contract \(a_va'_v\), this means that the contract \(s_v a_v\) cannot be contained in A (because of the Kirchhoff equality for \(a_v\)). Note also that \(s_v a_v\) is \((A, a_v)\)acceptable, because it is a contract preferred by \(a_v\) to \(a'_u a_v\). Consider the path P from s through \(s_v\) to \(a_v\). Clearly, if neither contract on P is in A, then it is a blocking path, otherwise the contract \(s_v a_v\) is \((A,s_v)\)acceptable and hence a blocking path itself, a contradiction. So suppose now \(b'_u b_v \in A\). Arguing analogously as before, we can prove that either the path from \(b'_u\) through \(t_u\) to t, or simply the contract \(b'_u t_u\) is blocking. Thus we obtain that A cannot contain any contracts from Z, and only contains contracts within node gadgets and contracts where the seller or the buyer is the terminal agent s or the terminal agent t, respectively.
Therefore, we know that for each \(v \in V\), at most one of the contracts \(a_v a'_v\) and \(b_v b'_v\) can be contained in A (since \(s_v\) can choose at most one of its downstream contracts by the Kirchhoff equality). Let \(Q=\{v \in V \mid a_v a'_v \notin A\}\), and let \(R=V {\setminus } Q\); clearly \(b_v b'_v \notin A\) for any \(v \in R\). It is not hard to see that both Q and R are acyclic. Indeed, any cycle within vertices of Q in D corresponds to a cycle using only contracts of Z and the contracts \(a_v a'_v\), \(v \in Q\), and such a cycle cannot exists as it would block A. The same argument works to show the acyclicity of R, proving the first direction of our reduction.
“\(\Leftarrow\)”: Assume now that Q and R are two acyclic subsets of V forming a partition. We define an outcome \(A \subseteq X\) that contains the contracts \(s s_v\), \(s_v b_v\), \(b_v b'_v\), \(b'_v t_v\), and \(t_v t\) for each \(v \in Q\), and similarly, the contracts \(s s_v\), \(s_v a_v\), \(a_v a'_v\), \(a'_v t_v\), and \(t_v t\) for each \(v \in R\). We claim that there is no blocking path or cycle for A.
To see this, observe that by the Kirchhoff equality a contract that is \((A,\cdot )\)acceptable in itself for some firm (but is not contained in A) must be either \(s_u a_u\) for some \(u \in Q\) or \(b'_v t_v\) for some \(v \in R\). Since there is no path starting with a contract \(s_u a_u\) and ending with a contract \(b'_v t_v\), we know that no path can block A.
To show that A admits no blocking cycles, we simply use that blocking cycles must be disjoint from A. Note that any cycle has to use at least one contract of Z, as node gadgets are acyclic. We partition the contracts in Z into four sets as follows; recall that \(A \cap Z=\emptyset\). Let \(Z_{Q,R}\) denote those contracts in Z that leave a node gadget \(D_u\) with \(u \in Q\) and arrive at a node gadget \(D_v\) with \(v \in R\); we define \(Z_{R,Q}\), \(Z_{Q,Q}\), and \(Z_{R,R}\) analogously. To see that no contract \(xy \in Z_{Q,R} \cup Z_{R,Q}\) can be part of a blocking cycle for A, note that A contains either the unique upstream contract of x or the unique downstream contract of y, by the definition of A. In either case, any cycle that contains the contract xy must also contain a contract in A, and hence cannot be a blocking cycle.
By the same reasoning, no contract \(b'_u b_v\) for some \(u,v \in Q\) can be contained in a blocking cycle, since both the unique upstream contract of \(b'_u\) and the unique downstream contract of \(b_v\) are contained in A. Therefore, any contract of \(Z_{Q,Q}\) used by a blocking cycle must be of the form \(a'_u a_v\) for some \(u,v \in Q\). Similarly, any contract of \(Z_{R,R}\) used by a blocking cycle must be of the form \(b'_u b_v\) for some \(u,v \in R\). By the structure of the network, this implies that no cycle can use contracts both from \(Z_{Q,Q}\) and from \(Z_{R,R}\). However, any blocking cycle that uses only contracts in \(Z_{Q,Q}\) and contracts of the form \(a_u a'_u\) with \(u \in Q\) directly corresponds to a cycle within D[Q]. Similarly, any blocking cycle using only contracts in \(Z_{R,R}\) and contracts of the form \(b_u b'_u\) with \(u \in R\) yields a cycle within D[R]. Therefore, the acyclicity of Q and R ensures that A admits no blocking cycle, proving the correctness of our reduction. \(\square\)
If we translate Theorem 2 into the language of stable flows introduced by Fleiner (2014), we obtain that it is \({{\textsf{N}}}{{\textsf{P}}}\)complete to decide whether a completely stable flow exists in a given network with preferences, where a flow is completely stable if it admits neither blocking paths nor blocking cycles. In fact, our statement holds not only in the discrete case (as implied directly by Theorem 2), but also in the continuous case where the flow can take real values as well; adjusting the proof of Theorem 2 to this case is straightforward. Hence we settle a conjecture posed by Fleiner (2014).
3.3 Stability
We now relax the assumption that blocking sets must be paths or cycles and consider general set blocks in trading networks (Hatfield et al. 2021) and flow networks (Fleiner 2014).
Definition 8
An outcome \(A\subseteq X\) is stable if:

1.
A is acceptable.

2.
There exists no nonempty set of contracts \(Z\subseteq X\), such that \(Z\cap A=\emptyset\) and Z is (A, f)acceptable for all \(f\in F(Z)\); such sets are called blocking.
Stable outcomes are immune to deviations by arbitrary groups of firms, which can recontract freely among themselves while keeping any of their existing contracts. Stable outcomes always exist in acyclic networks if choice functions are fully substitutable. However, Fleiner (2014) and Hatfield and Kominers (2012) showed that stable outcomes may not exist in general trading networks.
3.3.1 Stability in flow networks
We next prove that in flow networks pathorcyclestable outcomes coincide with stable outcomes.
Theorem 3
In a flow network an outcome is pathorcyclestable if and only if it is stable.
Proof
Let X be a set of firms in a flow network. Using the definitions, it is immediate that a stable outcome A is also pathorcyclestable, as a blocking path or cycle is naturally a blocking set as well.
For the opposite direction, assume that A is a pathorcyclestable outcome. Towards contradiction, let us also assume that \(B \subseteq X\) is a blocking set for A. Suppose first that B contains a cycle \(B_C\). Then \(B_C\) is disjoint from A because \(B_C \subseteq B \subseteq X {\setminus } A\). Moreover, \(B_C\) is (A, f)acceptable for any firm f: if f is a terminal then it accepts all contracts offered, and if f is nonterminal then, by the Kirchhoff equality, it accepts \(B_C\) alongside with A since \(B_C^f\) is either empty or it contains an upstream and a downstream contract for f. Hence, \(B_C\) is a blocking cycle for A. This proves that B cannot contain any cycles. Let us now consider a path \(P=(x_1,\dots ,x_p)\) in B that is maximal (in the sense that no contracts can be added to P to obtain a longer path). By the acyclicity of B, \(s:=s(x_1)\) must be a firm with no upstream contracts in B, and \(t:=b(x_p)\) must be a firm with no downstream contracts in B.
Since B is blocking for A, we know that B is (A, s)acceptable. Recall that s has a flowbased choice function. Therefore either s is a terminal firm (always accepting every offered contract), or s must obey the Kirchhoff inequality, and therefore can accept the downstream contract \(x_1 \in X^s_S \cap B\) only if there is a less preferred downstream contract in A. Note that this means that the contract \(x_1\) is \((A,s(x_1))\)acceptable. Using the fact that B is (A, t)acceptable, we can argue analogously to show that the contract \(x_p\) is \((A,b(x_p))\)acceptable. Finally, consider any intermediary firm f lying on path P; assume that \(f=b(x_i)=s(x_{i+1})\) for some \(i \in \{1, \dots , p1\}\). Again, either f is terminal (and thus accepts all offers) or it is nonterminal and obeys the Kirchhoff equality. In the latter case, the path P is (A, f)acceptable because it contains exactly one upstream contract and one downstream contract for f, namely \(x_i\) and \(x_{i+1}\). Hence we get that P is a blocking path for A, a contradiction. \(\square\)
Theorems 2 and 3 imply that deciding whether a stable outcome exists in a flow network is \({{\textsf{N}}}{{\textsf{P}}}\)complete.
Corollary 1
It is \({{\textsf{N}}}{{\textsf{P}}}\)complete to decide if a flow network admits a stable outcome.
3.3.2 Stability in trading networks
We finally turn to the existence of stable outcomes in trading networks. Hatfield et al. (2021) showed that stability is closely related to a solution concept similar to trail stability. They define a chain as a set of contracts that can be ordered in a way that it forms a trail. Chainstable outcomes are immune to blocks that form a chain in which every firm can simultaneously offer and accept all its contracts in the chain. Hatfield et al. (2021) show that, under additional conditions, stability is equivalent to chain stability. Chain stability contrasts to our definition of trail stability, which requires that firms only need to accept pairs of contracts along the trail, one pair at a time. Since a set of contracts that forms a path or a cycle is a chain, pathorcycle stability is weaker than chain stability. Indeed, it is easy to see that in general trading networks pathorcycle stability does not imply stability. But since flow networks are a special case of the trading networks (because flowbased choice functions are fully substitutable and satisfy the IRC condition), Corollary 1 implies that deciding whether a stable outcome exists is \({{\textsf{N}}}{{\textsf{P}}}\)hard in our trading networks model.
Corollary 2
It is \({{\textsf{N}}}{{\textsf{P}}}\)hard to decide if a trading network admits a stable outcome, even if choice functions satisfy full substitutability and IRC conditions.
In fact, dealing with stable outcomes is even trickier in trading networks. Our last result demonstrates that even verifying whether an outcome is stable is computationally intractable in general trading networks.^{Footnote 11}
Let \(\textsc {Instability}\) be the following decision problem. An instance of \(\textsc {Instability}\) is a trading network with a set X of contracts and a set F of agents with choice functions that satisfy the conditions of full substitutability and IRC, and an outcome \(A \subseteq X\). The answer for an instance of \(\textsc {Instability}\) is YES if the particular outcome A is not stable (that is, if there is a set Z of contracts that blocks A), otherwise the answer is NO.
Theorem 4
The \(\textsc {Instability}\) problem is \({{\textsf{N}}}{{\textsf{P}}}\)complete^{Footnote 12} even in the special case where the input consists of a trading network N and an outcome A in N such that either A is the only stable outcome in N, or there exists no stable outcome in N. Moreover, if choice functions are represented by oracles, then finding the right answer for an instance of \(\textsc {Instability}\) requires an exponential number of oracle calls in the worst case.
Proof of Theorem 4
We present separate proofs for the theorem’s two statements.
Proving the first statement. The \(\textsc {Instability}\) problem clearly belongs to the complexity class \({{\textsf{N}}}{{\textsf{P}}}\), as we can verify in polynomial time that a given set Z of contracts is a blocking set for an outcome A.
To show that \(\textsc {Instability}\) is \({{\textsf{N}}}{{\textsf{P}}}\)hard we reduce the \({{\textsf{N}}}{{\textsf{P}}}\)complete Partition problem to \(\textsc {Instability}\). An instance of the Partition problem is given by a ktuple \(\Pi =(a_1,a_2,\ldots ,a_k)\) of positive integers such that \(a_1\le a_2\le \ldots \le a_k\) holds. The answer to this problem is YES if and only if there is a subset I of \(\{1,2,\ldots ,k\}\) such that \(\sum _{i\in I}a_i=s\) where \(2s=\sum _{i=1}^ka_i\). \(\square \)
Intuition. In what follows, we will define a trading network with five agents, where certain contracts between two agents, f and g (see Fig. 2 for an illustration), will correspond to the integers in \(\Pi\) in a bijective manner. The main idea is that f and g can simultaneously engage in trade only if they are able to select, from all contracts corresponding to \(\Pi\), a subset of contracts whose corresponding integers sum up to s, yielding a solution to \(\Pi\). Hence, the ability of f and g to trade with each other depends on the solvability of our Partition instance \(\Pi\). To obtain a reduction to Instability, we define an outcome in which only the remaining three vertices of the trading network participate and in which f and g do not trade; such an outcome is stable exactly if the Partition instance \(\Pi\) is not solvable, meaning that f and g are not able to trade.
Reduction. Given our instance \(\Pi\) of Partition, we define an instance of Instability as follows. First, we construct a trading network N which is based on an example by Fleiner (2014). The trading network N has agent set \(\{f, g, h_1, h_2, h_3\}\) and contract set \(\{x_1, x_2, \dots , x_k,y,z,v_1,v_2,v_3\}\). The sellers and buyers of these contracts are as shown in Figure 2. Let \(h_1\), \(h_2\), and \(h_3\) have flowbased choice functions as defined for nonterminal agents, with \(h_1\) preferring z to \(v_3\). Next, we define the choice function \(C_\Pi ^f\) for f with the help of \(s=\frac{1}{2} \sum _{i=1}^k a_i\) by
for any \(X \subseteq \{x_1, \dots , x_k\}\) and \(Y \subseteq \{y\}\).
One can readily check that \(C_\Pi ^f\) satisfies the IRC condition. To see that it is also fully substitutable, first notice that f never rejects any upstream contracts, so it satisfies the conditions of both SSS and CSC with f as a buyer (that is, conditions 1(a) and 2(a) in Definition 1). To check the requirements for sameside substitutability with f taking the role of a seller (that is, condition 1(b) in Definition 1), let us fix a set Y of upstream contracts. If \(Y=\emptyset\), then f rejects all downstream contracts. Otherwise (that is, if \(Y=\{y\}\)), suppose that f rejects some \(x_j\) from a set X of offered downstream contracts. This means that there exists an index \(t<j\) such that \(\sum \{a_i : x_i \in X, i \le t\} \le s< \sum \{a_i:x_i\in X, i<t+1\}\). But then, for any superset \(X' \supseteq X\) of downstream contracts offered to f, the same condition will hold for some \(t' \le t<j\), and thus \(x_j\) will again be rejected. This proves sameside substitutability with f being a seller. To verify that \(C_\Pi ^f\) also satisfies crossside complementarity with f as a seller (that is, condition 2(b) in Definition 1), it suffices to observe that any downstream contract rejected while \(Y=\{y\}\) is offered to f will get rejected again when \(Y'=\emptyset\) is offered to f. Hence, we get that \(C_\Pi ^f\) is fully substitutable.
Next, define \(C_\Pi ^g\) by
for any \(X \subseteq \{x_1, \dots , x_k\}\) and \(W \subseteq \{y,z\}\).
It is straightforward to check that \(C_\Pi ^g\) satisfies the condition of IRC, so let us check whether it is fully substitutable as well. First, since g always accepts all upstream contracts, both SSS and CSC clearly hold for g as a buyer. To check SSS as a seller for g, let us consider a fixed set X of upstream contracts offered for g. Then g either accepts all downstream contracts (in case X is such that \(\sum \{a_i:x_i\in X\}\ge s\)) or it rejects every downstream contract (otherwise); in either case, the set of contracts rejected by g as a seller satisfies the conditions of SSS. To check crossside complementarity as a seller for g, note that if g rejects a set \(W \subseteq \{y,z\}\) of contracts, then it must be the case that \(\sum \{a_i:x_i\in X\} < s\) for the offered set X of upstream contracts. But then g will reject W for any subset \(X' \subseteq X\) too, so CSC holds as well. Hence, \(C_\Pi ^g\) is fully substitutable.
Note that for any set of downstream contracts accepted by f, the corresponding set of integers in \(\Pi\) sum up to at most s; by contrast, agent g accepts a nonempty set of downstream contracts only if it receives a set of upstream contracts for which the corresponding set of integers in \(\Pi\) sum up to at least s. This will result in the key property of this trading network to “recognize” whether there is a set of elements in \(\Pi\) summing up to exactly s. Such recognition will be manifested here by the stability or instability of a certain outcome.
So far, based on our instance \(\Pi\) of Partition, we have determined a trading network N. To finish the construction of our \(\textsc {Instability}\) instance, we set an outcome \(A=\{v_1,v_2,v_3\}\).
Correctness of the reduction. We have to show that the answer to our instance of the Partition problem is YES if and only if A is not stable, and furthermore, that N and A satisfy the conditions claimed in the theorem. To this end, we first prove the following claim.
Claim 1
If \(Z \subseteq \{x_1, x_2 \dots , x_k, y,z\}\) is a set of contracts acceptable for f and g, then either \(Z = \emptyset\) or \(\sum \{a_i : x_i \in Z\} = s\).
Proof of Claim 1
Define \(I=\{i:x_i\in Z\}\) and \(X_I:=\{x_i:x_i\in Z\}\). Since Z is acceptable for f and g, we have \(C_\Pi ^f(Z \cap \{y\}X_I)=(Z \cap \{y\}X_I)\) and \(C_\Pi ^g(X_IZ \cap \{y,z\})=(X_IZ \cap \{y,z\})\). If \(Z \cap \{y,z\} = \emptyset\), then \((Z \cap \{y\}X_I)=C_\Pi ^f(Z \cap \{y\}X_I)=C_\Pi ^f(\emptyset X_I)= (\emptyset ,\emptyset )\) implies \(X_I =\emptyset\), which yields \(Z=\emptyset\). If \(Z \cap \{y,z\} \ne \emptyset\), then \((X_IZ \cap \{y,z\})=C_\Pi ^g(X_IZ \cap \{y,z\}) \ne (X_I\emptyset )\) which implies \(\sum _{i \in I} a_i \ge s\). As a consequence, \(X_I \ne \emptyset\). Using this, we get \(C_\Pi ^f(Z \cap \{y\}X_I)=(Z \cap \{y\}X_I) \ne (\emptyset  \emptyset )\) which implies \(\sum _{i\in I}a_i\le s\). Consequently \(\sum _{i\in I}a_i= s\). \(\square\)
Assume now that the answer to our instance \(\Pi\) of Partition is YES, that is, \(\sum _{i\in I}a_i=s\) for some \(I \subseteq \{1,2, \dots , k\}\). Define \(X_I:=\{x_i:i\in I\}\) and \(W=\{y,z\}\). By definition, \(C_\Pi ^f(\{y\}X_I)=(\{y\}X_I)\), \(C_\Pi ^g(X_IW)=(X_IW)\), and since \(h_1\) prefers z to \(v_3\), \(h_1\) chooses \(\{z,v_1\}\) from \(A \cup W\). Hence \(X_I \cup W\) blocks A, so A is not stable.
For the other direction, assume now that A is not stable. This means that there is a blocking set Z for A. Clearly, Z must be acceptable for f and g (because \(A^f=A^g=\emptyset\)). Moreover, since \(A \cap Z = \emptyset\), we know that \(Z \subseteq \{x_1, x_2, \dots , x_k, y,z\}\). Hence, Claim 1 implies that \(\sum \{a_i : x_i \in Z \} = s\), and the answer to the Partition problem is YES.
It remains to show that either there exists no stable outcome in N, or A is the unique stable outcome in N. Let S be any stable outcome in N. Now, if \(S \cap \{x_1, x_2, \dots , x_k, y,z\} = \emptyset\), then since each agent in \(\{h_1,h_2,h_3\}\) must choose the same number of upstream and downstream contracts, we know that either \(S=\emptyset\), or \(S=A\). It is easy to see that A blocks the empty outcome, so only \(S=A\) is possible in this case. Suppose now \(z_S:=S \cap \{x_1, x_2, \dots , x_k, y,z\} \ne \emptyset\). Using again that agents \(h_1\), \(h_2\) and \(h_3\) have flowbased choice functions as defined for nonterminal vertices, we get that \(z \notin S\). On the one hand, if \(A \subseteq S\), then \(\{z\}\) blocks S: \(h_1\) prefers z to \(v_3 \in A\), and by applying Claim 1 to \(Z_S\) we know \(\sum \{a_i : x_i \in S\}=s\) which implies \(z \in C^g_\Pi (S \cup \{z\})\). On the other hand, if \(A \not \subseteq S\), then S must be disjoint from A by the flowbased choice functions of agents \(h_1\), \(h_2\) and \(h_3\). But then A blocks S, proving that A is indeed the only outcome that can be stable.
Proving the second statement. To prove the second part of the theorem, define a trading network with agents f and g and with contracts y and \(x_i\) such that \(f=b(y)=s(x_i)\) and \(g=s(y)=b(x_i)\) for \(1\le i\le 2n\). Define the following choice function for f:
As \(C^f=C^f_\Pi\) for \(\Pi =(1,1,\ldots ,1)\), \(C^f\) satisfies the conditions of full substitutability and IRC.
Next, define the following choice function
For any \(I\subseteq \{1,2,\ldots ,2n\}\) with \(I=n\), define \(X_I:=\{x_i:i\in I\}\) and let
It is straightforward to check that choice functions \(C^g_0\) and \(C^g_I\) above are also fully substitutable and satisfy the condition of IRC.
Now assume that an instance of \(\textsc {Instability}\) is given by the above network and an outcome \(A=\emptyset\). Assume that the choice functions are not given explicitly, but by oracles. Moreover, we know exactly that the choice function of f is the one defined in (1) and we know that the choice function of g is either \(C^g_0\) or \(C^g_I\) for some I. It is easy to check that A is not stable if and only if \(C^g=C^g_I\) for some I, and in this case the only blocking set is \(Z=X_I\cup \{y\}\). So if one has to decide stability of A, then one must determine the \(C^g(Z)\) values for all such possible Z, and this means \(\left( {\begin{array}{c}2n\\ n\end{array}}\right)\) oracle calls. \(\square \)
Let us stress that in the Instability problem we assume that every choice function is fully substitutable. This assumption allows us to concentrate on the computational intractability of the Instability problem itself since we do not have to take into account the time necessary to recognize whether agents have fully substitutable choice functions. Therefore, the second statement of Theorem 4 is unrelated to an important result by Hatfield et al. (2012) which shows that any algorithm that can decide if some agent f has a substitutable choice function \(C^f\) must perform an expected number of oracle calls accessing \(C^f\) that is exponential in the number of contracts. Analogously, the statement of Corollary 2 is also unrelated to testing substitutability of choice functions.
Notes
In a setting with continuous prices and distortionary frictions, trailstable outcomes essentially coincide with competitive equilibrium outcomes (Fleiner et al. 2019).
Since firms only care about their own contracts, we can write \(C^{f}(Y)\) to mean \(C^{f}(Y^{f})\).
Flowbased choice functions are a special case of “separable” choice functions (Fleiner et al. 2016).
In fact, what follows is a simplification of Fleiner’s flow network model where all capacities have value 1 and flow values must be integral.
The trail and the order of conditional acceptances can, of course, be reversed with \(f_{M+1}\) offering the first upstream contract to seller \(f_{M}\) and so on.
If agents were required to accept to all the contracts along the locally blocking trail, this would lead to a strictly weaker solution concept (under full substitutability) called “weak trail stability” (Fleiner et al. 2016).
The First Fundamental Welfare Theorem can, of course, fail in the presence of distortionary frictions.
This optimality holds if the contracts are spelled out one by one in the problem description, and if the inputs have to be read completely. We leave open the question of whether it is possible to find a trailstable outcome without spelling out all contracts (cf., Gonczarowski et al. 2019).
The proof of Theorem 2 shows that in flow networks verifying whether an outcome is stable can be done in time linear in the number of contracts.
Equivalently, the problem of verifying the stability of a given outcome is co\({{\textsf{N}}}{{\textsf{P}}}\)complete.
References
Abdulkadiroğlu A, Sönmez T (2003) School choice: a mechanism design approach. Am Econ Rev 93(3):729–747
Adachi H (2017) Stable matchings and fixed points in trading networks: a note. Econ Lett 156:65–67
Alkan A (2002) A class of multipartner matching markets with a strong lattice struture. Econ Theory 19(4):737–746
Aygün O, Sönmez T (2013) Matching with contracts: comment. Am Econ Rev 103(5):2050–2051
Blair C (1988) The lattice structure of the set of stable matchings with multiple partners. Math Oper Res 13(4):619–628
Bokal D, Fijavz̆ G, Juvan M, Kayll PM, Mohar B, (2004) The circular chromatic number of a digraph. J Graph Theory 46(3):227–240
Candogan O, Epitropou M, Vohra, RV (2016) Competitive equilibrium and trading networks: A network flow approach. In: EC ’16: Proceedings of the 2016 ACM Conference on Economics and Computation, pp. 701–702
Cook SA (1971) The complexity of theoremproving procedures. In: Proceedings of the Third Annual ACM Symposium on Theory of Computing, STOC ’71, New York, NY, USA, pp. 151–158. Association for Computing Machinery
Cormen TH, Leiserson CE, Rivest RL, Stein C (2009) Introduction to Algorithms, Third Edition (3rd ed). The MIT Press
Delacrétaz D (2019) January Stability in matching markets with sizes
Delacrétaz D, Kominers SD, Teytelboym A (2019) Matching mechanisms for refugee resettlement
Echenique F (2007) Counting combinatorial choice rules. Games Econ Behav 58(2):231–245
Echenique F, Oviedo J (2006) A theory of stability in manytomany matching markets. Theor Econ 1(1):233–273
Fleiner T (2003) A fixedpoint approach to stable matchings and some applications. Math Oper Res 28(1):103–126
Fleiner T (2014) On stable matchings and flows. Algorithms 7:1–14
Fleiner T, Jankó Z, Tamura A, ATeytelboym (2016) Trading networks with bilateral contracts. Working paper, Oxford University
Fleiner T, Jagadeesan R, Jankó Z, Teytelboym A (2019) Trading networks with frictions. Econometrica 87(5):1633–1661
Fox JT (2017) Specifying a structural matching game of trading networks with transferable utility. Am Econ Rev 107(5):256–60
Gale D, Shapley LS (1962) College admissions and the stability of marriage. Am Math Mon 69(1):9–15
Garey M, Johnson DS (1979) Computers and Intractability: a guide to the theory of NPcompleteness. W. H Freeman and Company, New York
Gonczarowski YA, Nisan N, Ostrovsky R, Rosenbaum W (2019) A stable marriage requires communication. Games Econ Behav 118:626–647
Hatfield JW, Kominers SD (2012) Matching in networks with bilateral contracts. Am Econ J Microecon 4(1):176–208
Hatfield JW, Kominers SD (2014) Hidden substitutes. Technical report, Mimeo
Hatfield JW, Immorlica N, Kominers SD (2012) Testing substitutability. Games Econ Behav 75(2):639–645
Hatfield JW, Kominers SD, Nichifor A, Ostrovsky M, Westkamp A (2013) Stability and competitive equilibrium in trading networks. J Polit Econ 121(5):966–1005
Hatfield JW, Kominers SD, Nichifor A, Ostrovsky M, Westkamp A (2021) Chain stability in trading networks. Theor Econ 16(1):197–234
Klaus B, Walzl M (2009) Stable manytomany matchings with contracts. J Math Econ 45(7–8):422–434
McDermid EJ, Manlove DF (2010) Keeping partners together: algorithmic results for the hospitals/residents problem with couples. J Combinat Optim 19(3):279–303
Morstyn T, Teytelboym A, McCulloch MD (2018) Bilateral contract networks for peertopeer energy trading. IEEE Trans Smart Grid 10(2):2026–2035
Ostrovsky M (2008) Stability in supply chain networks. Am Econ Rev 98(3):897–923
Papadimitriou CH (2007) The complexity of finding nash equilibria. In: Nisan N, Roughgarden T, Éva T, Vazirani VV (eds) Algorithmic Game Theory. Cambridge University Press
Roth A (1984) The evolution of the labor market for medical interns and residents: a case study in game theory. J Polit Econ 92(6):991–1016
Roughgarden T (2010) Computing equilibria: a computational complexity perspective. Econ Theory 42(1):193–236
Sönmez T, Switzer T (2013) Matching with (branchofchoice) contracts at the United States Military Academy. Econometrica 81(2):451–488
Sotomayor M (1999) Three remarks on the manytomany stable matching problem. Math Soc Sci 38:55–70
Westkamp A (2010) Market structure and matching with contracts. J Econ Theory 145(5):1724–1738
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
We would like to thank Péter Biró, John Hatfield, Ravi Jagadeesan, Scott Kominers, Mike Ostrovsky, and Alex Westkamp for fruitful conversations about this project. Fleiner and Jankó were supported by the Hungarian Scientific Research Fund (OTKA grants K128611 and K143858) as well as the MTAELTE Egerváry Research Group. Jankó also acknowledges the support of the MTABCE Strategic Interaction Research Group. Part of Fleiner’s research was carried out during two working visits at Keio University. Schlotter acknowledges the support of the Hungarian Academy of Sciences under its Momentum Programme (LP20212), and the Hungarian Scientific Research Fund (OTKA grants K128611 and K124171). The research by Fleiner and Schlotter reported in this paper was also supported by the BMEArtificial Intelligence FIKP grant of EMMI (BME FIKPMI/SC) and by the BME NC TKP2020 grant of NKFIH Hungary. This work was supported by the Economic and Social Research Council grant number ES/R007470/1. Teytelboym is grateful for the hospitality of the Budapest University of Technology and Economics in August 2016.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Fleiner, T., Jankó, Z., Schlotter, I. et al. Complexity of stability in trading networks. Int J Game Theory 52, 629–648 (2023). https://doi.org/10.1007/s00182022008330
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00182022008330
Keywords
 Matching markets
 Market design
 Computational complexity
 Trading networks
 Flow networks
 Supply chains
 Trail stability
 Chain stability
 Stability
 Contracts