betaFeedback

WorksComputer Science

Finding Integral Stable Matchings is PPAD-Complete: Unimodular Hypergraphs, Network bb-Matchings, and Kernels in Perfect Graphs

Abstract

Polyhedral integrality guarantees integral stable solutions in several classical stability problems: stable matchings in normal hypergraphs, stable bb-matchings in unimodular hypergraphs, and kernels in clique-acyclic orientations of perfect graphs. Whether they can be computed efficiently has been a long-standing open question; for kernels in perfect graphs it has been open since the existence theorem of Boros and Gurvich in 1996. We show that, unless PPAD⊆FPPPAD\subseteq FP, they cannot. Finding a stable matching is PPADPPAD-complete already in linear unimodular hypergraphs with hyperedges of size at most three and vertex degrees at most three. Consequently, finding a kernel in a clique-acyclic orientation of a perfect graph is PPADPPAD-hard even if all cliques have at most three vertices, answering an open question of Pass-Lanneau, Igarashi and Meunier, and stable matchings are PPADPPAD-hard to find in balanced and in normal hypergraphs. This contrasts with the polynomial algorithm of Chandrasekaran and Kalathur for network hypergraphs. With capacities, even network hypergraphs are hard: University Dual Admission is PPADPPAD-complete with capacities at most nine, so stable bb-matching is PPADPPAD-complete on network hypergraphs with hyperedges of size three. This yields PPADPPAD-completeness for a natural class of hospitals/residents markets with couples where stable matchings always exist, and PPADPPAD-hardness of computing the near-feasible stable matchings, where capacities are flexible. Both reductions are from PURE CIRCUIT with constant-size gadgets. For unit capacities we use a dual-rail encoding, a symmetry-breaking gadget made of two coupled 2×22\times2 stable marriage markets, and a parity criterion on the bipartite incidence graph that certifies total unimodularity. We expect these tools to be useful for further hardness results about problems with guaranteed integral solutions.

Introduction

In the classical bipartite model, a stable matching always exists and can be found by the deferred acceptance algorithm [19]. In stable hypergraph matching (SHM), a vertex ranks the hyperedges containing it, a matching contains at most one hyperedge at each vertex, and an unchosen hyperedge is dominated by a vertex if that vertex prefers its matched hyperedge to it; otherwise the hyperedge blocks the matching [1]. In stable hypergraph bb-matching (SHbM), a vertex vv may lie in b(v)b(v) chosen hyperedges, and a hyperedge is dominated if some vertex is saturated and prefers every chosen hyperedge to it [5]. Stable matchings need not exist, and deciding existence is NP-complete already for three-partite hypergraphs with hyperedges of size three [25].

Scarf’s lemma [30] guarantees a fractional stable solution [1, 5], but computing one is PPAD-complete [21], even under strong restrictions [20, 13]. Integrality gives a stronger existence guarantee. The matching polytope of a normal hypergraph is integral, so normal hypergraphs always admit stable matchings [2], and unimodular hypergraphs, whose incidence matrices are totally unimodular, admit stable bb-matchings for all integer capacities [4]. The complexity of finding these integral solutions has remained a central question. Biró, Csáji and Schlotter [4] gave a polynomial algorithm for SHbM on laminar hypergraphs and for SHM on subtree hypergraphs, and an XP algorithm for weighted SHbM on subpath hypergraphs parameterized by the largest hyperedge. Faenza, He and Sethuraman [17] proved polynomial convergence of a suitable implementation of Scarf’s algorithm for bipartite stable matching. Chandrasekaran et al. [10] established polynomial convergence on arborescence hypergraphs, and Chandrasekaran and Kalathur [11] recently gave a polynomial algorithm for SHM on all network hypergraphs. They leave open the unimodular and the normal cases, and the case of capacities on network hypergraphs.

Kernels in perfect graphs. A kernel of a digraph is an independent set of vertices such that every other vertex has an arc into it. Kernels need not exist, and deciding their existence is NP-complete [12]. A digraph is clique-acyclic if every clique of its underlying graph induces an acyclic subdigraph. Confirming a conjecture of Berge and Duchet, Boros and Gurvich [8] proved that every clique-acyclic orientation of a perfect graph has a kernel (more generally, every clique-acyclic superorientation, where an edge may be oriented in both directions). Aharoni and Holzman [2] gave a short proof via Scarf’s lemma. Stable matchings in a normal hypergraph are exactly the kernels of the conflict digraph on its hyperedges, whose underlying graph is the (perfect) line graph [2, 22]. Computing such a kernel efficiently is a well-known open problem [16, 28]. Polynomial algorithms are known for several subclasses, such as chordal graphs and claw-free perfect graphs [28], line graphs of bipartite graphs [19], and the conflict graphs of network hypergraphs [11].

The University Dual Admission problem (UDA) was introduced in [4], motivated by Hungarian university dual education [18]. A student applies to programs, each program belongs to a university, and both universities and programs have capacities and rank students. A student must be accepted by both the program and its university. Biró et al. [4] showed that UDA is a special case of SHbM on network hypergraphs, so a stable assignment always exists. They also gave a linear-time algorithm when all capacities are one and left the general search complexity open.

Our contribution

We show that these integral solutions are PPAD-hard to compute, even in very restricted settings.

Unit capacities: unimodular and normal hypergraphs, and kernels. Finding a stable matching is PPAD-complete on unimodular hypergraphs, even if the hypergraph is linear, every hyperedge has at most three vertices, and every vertex lies in at most three hyperedges (Theorem 20). Unimodular hypergraphs are balanced and normal, so the problem is PPAD-complete on these classes as well. In the language of kernels, finding a kernel in a clique-acyclic orientation of a perfect graph is PPAD-hard, even if the graph is the line graph of a unimodular hypergraph and has no clique of size four, and PPAD-complete when the maximal cliques are given, in particular for bounded clique size (Corollary 22). This settles a long-standing open problem: unless PPAD ⊆\subseteq FP, there is no polynomial-time algorithm for kernels in perfect graphs, a question open since the existence theorems of Boros and Gurvich [8] and Aharoni and Holzman [2] and listed among the EGRES open problems [16]. It also settles the unimodular and normal cases of stable hypergraph matching, left open in [4, 11]. Together with [11], it draws a sharp boundary inside the totally unimodular world: stable matchings are polynomial-time computable on network hypergraphs, but PPAD-complete on unimodular hypergraphs.

Capacities: network hypergraphs and University Dual Admission. Finding a stable assignment in UDA is PPAD-complete, even when programs have quota one and at most two applicants, students apply to at most two programs at different universities, and university capacities are at most nine (Theorem 9). Consequently, SHbM is PPAD-complete on network hypergraphs, already with hyperedges of size three and capacities at most nine (Corollary 10). Thus capacities make even network hypergraphs hard, whereas their unit-capacity version is polynomial [11], and UDA with unit capacities is solvable in linear time [4].

Implications. Unless PPAD ⊆\subseteq FP, guaranteed existence of an integral stable solution does not imply a polynomial-time algorithm, even when the guarantee comes from total unimodularity. Our results concern an arbitrary stable solution, without any additional optimization objective. Earlier PPAD-hardness results for hypergraph stability [21, 20, 13], including the strong fractional kernel problem [21], concern fractional solutions. Our results transfer this difficulty to integral solutions of natural combinatorial problems on explicitly given graphs and hypergraphs, in classes whose matching polytope is integral.

Besides UDA, the capacitated result applies to a subclass of the hospitals/residents problem with couples (HRC). Interpret each student as a couple, universities as hospitals for the first member, and programs as hospitals for the second member. Every hospital on the program side is associated with one fixed hospital on the university side. In this subclass of dual markets, stable matchings always exist, but finding one is PPAD-complete (Corollary 11). General dual markets do not have this existence guarantee [14].

An important extension concerns near-feasible stable matchings. Nguyen and Vohra [26] proved that changing each hospital’s capacity by at most two always suffices for a stable matching, while increasing total capacity by at most four. We prove that finding such capacities and a stable matching is PPAD-hard (Corollary 26). More generally, hardness holds for every fixed additive allowance, even in the fixed-association subclass and with at most two acceptable pairs per couple (Theorem 25). Thus the hardness concerns the final near-feasible outcome, independently of the fractional solution used in their construction.

Techniques. Both reductions start from Pure-Circuit [15] and represent every node of the circuit by a few students. Each student has a first-choice home hyperedge in the gadget computing the node and a second-choice input hyperedge in the gadget reading it. This wire mechanism makes gadgets interact only through whether these students are at home, which gives a clean local analysis. The reductions are short and modular, and we believe they provide a useful template for proving hardness of other structured problems with guaranteed integral solutions, such as further classes of hypergraphs, digraph kernels, stable flows and matching markets with couples. Section 4 isolates three reusable tools: dual-rail encoding with monotone gadgets, symmetry breaking through two coupled stable marriage markets, and a parity criterion that certifies total unimodularity of composed instances. The last one reduces checking unimodularity of an arbitrarily large instance to a finite check on each gadget.

Proof overview

The source problem Pure-Circuit assigns values in {0,1,⊥}\{0,1,\perp\} to the nodes of a circuit. Its NOR gates behave as Boolean NOR gates on pure values, while a PURIFY gate copies a pure input to both outputs and must produce at least one pure output even from ⊥\perp. These two gate types suffice for PPAD-completeness [15]. Additional PURIFY gates ensure that each node is read at most once.

Capacities (Section 3). We represent a node by three students and decode zero when all three are at home, one when all three are away, and ⊥\perp otherwise. Stability forces every student who is away from home to occupy her input program, so the number of arrivals to a gate is the number of displaced students of its inputs. Two small gadgets turn this number into the correct output by counting arguments, using that program and university priorities disagree.

Unit capacities (Section 4). Without capacities no counting is possible. We represent a node zz by two students, z1z^1 carrying the value and z2z^2 its negation (dual rail). A NOR gate then only needs one AND and one OR of rails, both realized by tiny gadgets. The PURIFY gate must break ties between the two codes (0,0)(0,0) and (1,1)(1,1) of ⊥\perp. The key gadget consists of two copies of the classical 2×22 \times2 stable marriage market with two stable matchings, coupled by a single hyperedge between two men; it never turns the input code (0,0)(0,0) into the output code (0,0)(0,0). Attaching negations to its four ports handles (1,1)(1,1). Finally, we show that every chordless cycle of the bipartite incidence graph of the composed hypergraph has length divisible by four. Since all degrees are at most three, Camion’s characterization [9] then shows that the incidence matrix is totally unimodular.

Organization. Section 2 contains preliminaries. Section 3 proves the result for UDA and network bb-matchings, together with the HRC corollary. Section 4 builds on its wire mechanism and proves the result for unimodular hypergraphs, normal hypergraphs and kernels. Section 5 treats near-feasible stable matchings with couples, and Section 6 concludes.

Preliminaries

Stable hypergraph matching

A hypergraph H=(V,E)\mathcal{H}=(V,E) has a finite vertex set VV and a finite family EE of nonempty subsets of VV, called hyperedges. We write E(v)={e∈E:v∈e}E(v)=\{e\in E:v\in e\} for the star of vv and call ∣E(v)∣|E(v)| its degree. The hypergraph is linear if any two hyperedges share at most one vertex. Each vertex vv has a strict preference order ≻v\succ_v on E(v)E(v), with e≻vfe\succ_v f meaning that vv prefers ee to ff. A capacity function b:V→Z>0b:V\to\mathbb{Z}_{>0} specifies how many hyperedges a vertex may receive. A bb-matching is a set M⊆EM\subseteq E such that ∣M(v)∣≤b(v)|M(v)|\le b(v) for every vv, where M(v)=M∩E(v)M(v)=M\cap E(v). A vertex is full, or saturated, if equality holds.

A bb-matching MM dominates an unchosen hyperedge ee at v∈ev\in e if vv is full and f≻vef\succ_v e for every f∈M(v)f\in M(v). An unchosen hyperedge blocks MM if it is dominated at none of its vertices. A bb-matching is stable if it has no blocking hyperedge. The search problem SHbM asks for a stable bb-matching. For b=1b=1, a bb-matching is a matching, and the corresponding problem is SHM. For a matching MM we write M(v)M(v) also for the hyperedge of MM containing vv, if any; vv is covered by MM if it exists.

The incidence matrix of H\mathcal{H} is A∈{0,1}V×EA\in\{0,1\}^{V\times E} with Ave=1A_{ve}=1 exactly when v∈ev\in e. A matrix is totally unimodular (TU) if every square submatrix has determinant in {0,1,−1}\{0,1,-1\}. A hypergraph is unimodular if its incidence matrix is TU. Its bb-matching polytope

P(H,b)={x∈RE:Ax≤b, 0≤x≤1}\mathcal{P}(\mathcal{H},b)=\{x\in\mathbb{R}^{E}:Ax\le b,\ 0\le x\le1\}

then has only integral vertices for every integer bb [31]. A fractional bb-matching is a point x∈P(H,b)x \in\mathcal{P}(\mathcal{H}, b). It is stable if, for every ee with xe<1x_e < 1, some v∈ev \in e satisfies ∑f∈E(v)xf=b(v)\sum_{f \in E(v)} x_f = b(v) and xf=0x_f = 0 for every f∈E(v)f \in E(v) with e≻vfe \succ_v f. For integral points this is precisely the stability condition above. Scarf’s lemma guarantees such a fractional solution [1, 5].

A hypergraph is normal if its unit-capacity matching polytope P(H,1)\mathcal{P}(\mathcal{H}, 1) is integral, equivalently if the edge chromatic number of every partial hypergraph equals its maximum degree [23].1 A cycle of length k≥2k \ge2 is a sequence v1e1v2e2…vkekv1v_1e_1v_2e_2 \ldots v_ke_kv_1 of distinct vertices and distinct hyperedges with vi,vi+1∈eiv_i, v_{i+1} \in e_i (indices modulo kk). A hypergraph is balanced if in every cycle of odd length some eie_i contains at least three of v1,…,vkv_1, \ldots, v_k [3]. Every unimodular hypergraph is balanced, and every balanced hypergraph is normal [3].

For an oriented tree TT and an ordered pair (s,t)(s,t) of its vertices, the vector of the unique tree path from ss to tt has entry 11 on arcs traversed in their direction, −1-1 on arcs traversed against their direction, and 00 elsewhere. A network matrix has such path vectors as its columns and the arcs of TT as its rows. Network matrices are TU [31]. A network hypergraph has a network matrix as its incidence matrix. Since this incidence matrix is nonnegative, each hyperedge corresponds to the arc set of a directed path in TT. In particular, network hypergraphs are unimodular.

Bipartite incidence graph. The bipartite incidence graph B(H)B(\mathcal{H}) has vertex set V∪EV \cup E and an edge veve whenever v∈ev \in e; it is the bipartite graph of the matrix AA. A hole is an induced cycle and a chordless path is an induced path. The length of a path or cycle is its number of edges. Holes of B(H)B(\mathcal{H}) have even length. A cycle v1e1…vkekv1v_1e_1 \ldots v_ke_kv_1 of H\mathcal{H} is a cycle of length 2k2k in B(H)B(\mathcal{H}), and no eie_i contains three of v1,…,vkv_1, \ldots, v_k exactly when this cycle is a hole. Hence H\mathcal{H} is balanced if and only if every hole of B(H)B(\mathcal{H}) has length divisible by four. We use the following characterization of total unimodularity.

Theorem 1 (Camion [9]). A matrix with entries in {0,1,−1}\{0,1,-1\} is totally unimodular if and only if the sum of the entries of every square submatrix with even row and column sums is divisible by four.

University Dual Admission

In UDA [4], there are finite disjoint sets of students SS, universities UU and programs PP. Each program pp belongs to exactly one university u(p)u(p). Universities have positive integer capacities c(u)c(u) and programs have positive integer quotas q(p)q(p). Each student ss has a strict preference order ≻s\succ_s over their acceptable programs and prefers every such program to being unassigned, denoted by ∅\varnothing. Each university uu has a strict master order ≻u\succ_u over its applicants, and each program pp has a strict order ≻p\succ_p over its applicants. Program and university orders may differ.

An assignment μ\mu maps each student to an acceptable program or to ∅\varnothing. Write μ(p)={s:μ(s)=p}\mu(p)=\{s:\mu(s)=p\} and μ(u)=⋃p:u(p)=uμ(p)\mu(u)=\bigcup_{p:u(p)=u}\mu(p). The assignment is feasible if ∣μ(u)∣≤c(u)|\mu(u)| \le c(u) and ∣μ(p)∣≤q(p)|\mu(p)| \le q(p) for every university and program. A university or program is full if its constraint is tight.

Definition 2. A feasible assignment is stable if no acceptable triple (s,u,p)(s,u,p) with u=u(p)u=u(p) satisfies all three conditions:

(i) p≻sμ(s)p \succ_s \mu(s);

(ii) uu is not full, or s≻us′s \succ_u s' for some s′∈μ(u)s' \in\mu(u), or s∈μ(u)s \in\mu(u);

(iii) pp is not full, or s≻ps′′s \succ_p s'' for some s′′∈μ(p)s'' \in\mu(p).

Such a triple is a blocking triple. The search problem UDA asks for a stable assignment.

The associated hypergraph has vertex set S∪U∪PS \cup U \cup P and a hyperedge {s,u(p),p}\{s,u(p),p\} for every acceptable student–program pair. Students have capacity one, universities capacity c(u)c(u) and programs capacity q(p)q(p). Student and program orders induce their hyperedge orders. A university first compares students by its master order and, for hyperedges of the same student, uses that student’s order of programs. Stable assignments correspond bijectively to stable bb-matchings in this hypergraph [4].

For completeness, its network representation has a vertex rr, a vertex vuv_u for each university, and vertices vp,vsv_p,v_s for programs and students. The three arcs are (vs,r)(v_s,r), (r,vu)(r,v_u) and (vu(p),vp)(v_{u(p)},v_p), indexed by the corresponding agents. The path from vsv_s to vpv_p consists of the arcs indexed by s,u(p),ps,u(p),p. Thus the hypergraph is a network hypergraph [4] and every UDA instance admits a stable assignment.

Observation 3. If μ\mu is stable and p≻sμ(s)p \succ_s \mu(s), where pp is a program of university uu, then

(A)(A) pp is full and prefers every student in μ(p)\mu(p) to ss; or

(B)(B) uu is full, s∉μ(u)s \notin\mu(u), and uu prefers every student in μ(u)\mu(u) to ss.

Case (A)(A) is impossible if ss is ranked first by pp, and case (B)(B) is impossible if uu is not full.

Total search and PPAD

A polynomial search problem has solutions of polynomial encoding length that can be verified in polynomial time. It is total if every input has a solution. The class PPAD consists of the total search problems reducible to End-of-Line [27]. This problem is given a directed graph, described by predecessor and successor circuits, with at most one incoming and one outgoing arc at each vertex, together with one known source. It asks for another source or a sink. A reduction constructs a target instance in polynomial time and converts any solution of that instance to a solution of the source instance in polynomial time. A problem is PPAD-hard if every problem in PPAD reduces to it, and PPAD-complete if it is also in PPAD. We write FP for problems solvable in polynomial time.

Proposition 4. Finding a stable bb-matching in a unimodular hypergraph is in PPAD. So is finding a stable matching in a normal hypergraph. Consequently, UDA is in PPAD.

Proof. Finding a fractional stable bb-matching reduces to computing a dominating vertex of P(H,b)\mathcal{P}(\mathcal{H}, b) in Scarf’s lemma, with row rankings induced by the vertex preference orders, and this is in PPAD [21]. If P(H,b)\mathcal{P}(\mathcal{H}, b) is integral, which holds for unimodular hypergraphs and integer bb and for normal hypergraphs and b≡1b \equiv1, then the dominating vertex is integral and is a stable bb-matching.

As usual, the hypergraph class is a promise on the input; unimodularity can moreover be recognized in polynomial time by Seymour’s decomposition [32, 31].

Pure-Circuit

An instance of Pure-Circuit [15] consists of a finite set of nodes VV and two types of gates. A nor gate (nor, uu, vv, ww) has inputs uu, vv and output ww. A purify gate (purify, uu, vv, ww) has input uu and outputs vv, ww. Within each gate uu, vv, ww are distinct, and every node is the output of exactly one gate. A node may be read by several gates or by none. Directed cycles are allowed.

A solution x:V→{0,1,⊥}x : V \to\{0,1,\perp\} satisfies the following conditions:

  1. For a nor gate, x[u]=x[v]=0x[u] = x[v] = 0 implies x[w]=1x[w] = 1, and 1∈{x[u],x[v]}1 \in\{x[u], x[v]\} implies x[w]=0x[w] = 0. Otherwise its output is unrestricted.

  2. For a purify gate, at least one of x[v],x[w]x[v], x[w] belongs to {0,1}\{0,1\}, and x[u]∈{0,1}x[u] \in\{0,1\} implies x[v]=x[w]=x[u]x[v] = x[w] = x[u].

The values zero and one are called pure. Deligkas et al. [15] proved that finding a solution is PPAD-complete.

Lemma 5. We may assume that the Pure-Circuit instance is fan-out free, that is, every node is an input of at most one gate.

Proof. If a node uu is read by k≥2k \ge2 gates, put r0=ur_0 = u and add

(purify,ri−1,ui,ri)(1≤i≤k−2),(purify,rk−2,uk−1,uk),(\mathrm{purify},r_{i-1},u_i,r_i)\quad(1 \le i \le k-2),\qquad(\mathrm{purify},r_{k-2},u_{k-1},u_k),

where all uiu_i and rir_i for i≥1i \ge1 are newly created helper nodes. Let the ii-th reader of uu read input uiu_i. The number of added gates is linear in the number of original input occurrences. Every node is now read at most once, and a pure value of uu is copied to every uiu_i.

Restrict any solution to the original nodes. For an original nor gate, every pure input triggering a condition is copied to the input of the modified gate, so its original output satisfies that condition. For an original purify gate, its two outputs are unchanged and at least one is pure, while a pure original input is copied to its modified input. Thus the restriction solves the original instance.

Stable bb-matchings in network hypergraphs

We first prove hardness for UDA (Theorem 9); the results for network hypergraphs and for couples then follow from the network representation of § 2. Fix a fan-out free Pure-Circuit instance. We construct a UDA instance as follows.

Node students. For each node zz, we add three students z1,z2,z3z^1,z^2,z^3. Each student zjz^j has a dedicated home program h(zj)h(z^j), which she ranks first, in the gadget of the gate that outputs zz. If zz is read by a gate, she also has a dedicated input program in⁡(zj)\operatorname{in}(z^j), which she ranks second, in the gadget of that gate. That is, zjz^j has preference h(zj)≻in⁡(zj)h(z^j) \succ\operatorname{in}(z^j). A student is at home if she is assigned to her home program and away otherwise.

The NOR gadget. Let g=(NOR⁡,u,v,w)g = (\operatorname{NOR}, u, v, w). The input students are uj,vju^j,v^j (j=1,2,3j = 1,2,3). We create a university UgU_g with capacity 9 and programs in⁡(uj),in⁡(vj),d1,…,d7\operatorname{in}(u^j),\operatorname{in}(v^j),d_1,\ldots,d_7, as well as a university NgN_g that has capacity 3 and programs f1,f2,f3,h(w1),h(w2),h(w3)f_1,f_2,f_3,h(w^1),h(w^2),h(w^3). We create dummy students DkD_k (k≤7k \leq7) that apply only to dkd_k, and reservoir students TkT_k (k≤3k \leq3) with preference dk≻fkd_k \succ f_k. For k≤3k \leq3, program dkd_k ranks Dk≻TkD_k \succ T_k. The master orders are

Ug: u1≻u2≻u3≻v1≻v2≻v3≻T1≻T2≻T3≻D7≻⋯≻D1,U_g:\ u^1 \succ u^2 \succ u^3 \succ v^1 \succ v^2 \succ v^3 \succ T_1 \succ T_2 \succ T_3 \succ D_7 \succ\cdots\succ D_1,
Ng: T1≻T2≻T3≻w3≻w2≻w1.N_g:\ T_1 \succ T_2 \succ T_3 \succ w^3 \succ w^2 \succ w^1.

The PURIFY gadget. Let g=(PURIFY⁡,u,v,w)g = (\operatorname{PURIFY},u,v,w). The input students are u1,u2,u3u^1,u^2,u^3. A single university UgU_g is created with capacity 7 and programs in⁡(uj),h(vj),h(wj)\operatorname{in}(u^j),h(v^j),h(w^j). For x∈{v,w}x \in\{v,w\} and j≤2j \leq2, reservoir students Rx,jR_{x,j} are added too, who apply only to h(xj)h(x^j). The priority order of h(xj)h(x^j) is xj≻Rx,jx^j \succ R_{x,j}. The master order is

Ug: u1≻u2≻u3≻Rv,1≻Rv,2≻Rw,1≻Rw,2≻w3≻w2≻w1≻v3≻v2≻v1.\begin{aligned} U_g:\ &u^1 \succ u^2 \succ u^3 \succ R_{v,1} \succ R_{v,2} \succ R_{w,1} \succ R_{w,2}\\ &\succ w^3 \succ w^2 \succ w^1 \succ v^3 \succ v^2 \succ v^1. \end{aligned}

All programs have quota 1. Gadget students, programs and universities are distinct across gates; the node students are shared between the gate that produces a node and the gate that reads it. Every program whose order has not been specified has only its named applicant, whom it ranks first. Figure 1 shows both gadgets. The construction is polynomial. Every student applies to at most two programs, at different universities, and every program has at most two applicants.

The UDA gadgets

Figure 1. The UDA gadgets. Shaded boxes are universities (capacity in parentheses), white circles are programs of quota 1, dots are node students and squares are gadget students. Solid lines are first choices of students, dashed lines second choices; in (b) the programs joined to vj,wjv^j,w^j are h(vj),h(wj)h(v^j),h(w^j). Input students have their homes elsewhere, and the dashed arrows of output students lead to the gate reading the node.

For a node zz, let d(z)d(z) be the number of students of zz who are away from home. We decode x[z]=0x[z] = 0 if d(z)=0d(z) = 0, x[z]=1x[z] = 1 if d(z)=3d(z) = 3, and x[z]=⊥x[z] = \bot otherwise. For a gate gg, let aga_g be the number of its input students collectively at their input programs.

Correctness. Every constructed instance admits a stable assignment by its network representation. Fix such an assignment μ\mu.

Lemma 6. Every input student of a gate gg is at home or at its input program. Hence ag=d(u)+d(v)a_g = d(u) + d(v) for a NOR-gate and ag=d(u)a_g = d(u) for a PURIFY-gate.

Proof. Suppose an input student ss is unassigned. She is the only applicant of in⁡(s)\operatorname{in}(s), so by Observation 3 the university UgU_g is full of students ranked above ss. Only other input students rank above ss, and there are at most 5<95 < 9 (NOR) or 2<72 < 7 (PURIFY) of them. □

Lemma 7. Let g=(NOR⁡,u,v,w)g = (\operatorname{NOR},u,v,w) and a=aga = a_g. If a≤1a \leq1 then d(w)=3d(w) = 3. If a≥3a \geq3 then d(w)=0d(w) = 0.

Proof. All quotas are 1, so ∣μ(Ug)∣≤a+7|\mu(U_g)| \leq a + 7.

Case a≤1a \leq1. Then UgU_g is not full. Each DkD_k is first at dkd_k, so DkD_k is at dkd_k by Observation 3. Each TkT_k is then not at dkd_k. It is the only applicant of fkf_k, and at most two students rank above it at NgN_g, so TkT_k is at fkf_k. Thus NgN_g is full with T1,T2,T3T_1,T_2,T_3, and d(w)=3d(w) = 3.

::: Case a≥3a \ge3. Let kk be minimal with TkT_k not at dkd_k. At most 6+2=8<96+2=8<9 students rank above TkT_k at UgU_g, so by Observation 3 DkD_k is at dkd_k. Each DmD_m with m>km>k is first at dmd_m, and UgU_g contains Dk≺UgDmD_k \prec_{U_g} D_m, so by stability DmD_m is at dmd_m as well. Then

∣μ(Ug)∣≥a+(k−1)+(8−k)=a+7≥10>9,|\mu(U_g)| \ge a+(k-1)+(8-k)=a+7\ge10>9,

a contradiction. Hence every TkT_k is at UgU_g. Then NgN_g contains only ww-students and is not full if some wjw^j is away. Since wjw^j is the only applicant of h(wj)h(w^j), every wjw^j is at home and d(w)=0d(w)=0.

Lemma 8. Let g=(PURIFY⁡,u,v,w)g=(\operatorname{PURIFY},u,v,w) and a=aga=a_g. If a=0a=0 then d(v)=d(w)=0d(v)=d(w)=0; if a=1a=1 then d(w)=0d(w)=0; if a=2a=2 then d(v)=3d(v)=3; and if a=3a=3 then d(v)=d(w)=3d(v)=d(w)=3.

Proof. List the output students bottom-up in the master order of UgU_g as

y1,…,y6=v1,v2,v3,w1,w2,w3.y_1,\ldots,y_6=v^1,v^2,v^3,w^1,w^2,w^3.

Each yiy_i is first at its home program, so by Observation 3:

(F1) if yiy_i is away, then UgU_g is full and ranks all of μ(Ug)\mu(U_g) above yiy_i.

Hence if yiy_i is at home, so is every yi′y_{i'} with i′>ii'>i, because yi∈μ(Ug)y_i\in\mu(U_g) ranks below yi′y_{i'}. The away students are therefore y1,…,yty_1,\ldots,y_t for some tt, and d(v)=min⁡(t,3)d(v)=\min(t,3), d(w)=max⁡(t−3,0)d(w)=\max(t-3,0).

Now let Rx,jR_{x,j} be a reservoir student whose corresponding xjx^j is away. Then nobody at h(xj)h(x^j) is preferred to Rx,jR_{x,j}, and at most 6<76<7 students rank above Rx,jR_{x,j} at UgU_g. So by Observation 3, Rx,jR_{x,j} is at h(xj)h(x^j). Therefore

∣μ(Ug)∣=a+(6−t)+rt,|\mu(U_g)|=a+(6-t)+r_t,

where rtr_t counts the reservoirs at the homes of y1,…,yty_1,\ldots,y_t, so that (r0,…,r6)=(0,1,2,2,3,4,4)(r_0,\ldots,r_6)=(0,1,2,2,3,4,4). Feasibility requires ∣μ(Ug)∣≤7|\mu(U_g)|\le7, and (F1) requires equality when t≥1t\ge1. Hence

  • t=0t=0 needs a+6≤7a+6\le7;

  • t∈{1,2}t\in\{1,2\} needs a+6=7a+6=7;

  • t∈{3,4,5}t\in\{3,4,5\} needs a+5=7a+5=7;

  • t=6t=6 needs a+4=7a+4=7.

So a=0a=0 forces t=0t=0, a=1a=1 forces t≤2t\le2, a=2a=2 forces 3≤t≤53\le t\le5, and a=3a=3 forces t=6t=6.

Theorem 9. Finding a stable assignment in UDA is PPAD-complete. This holds even if all quotas are 1, programs have at most two applicants, students apply to at most two programs at different universities, and university capacities are at most 9.

Proof. Membership follows from Proposition 4. For hardness, decode a stable assignment as above, and use Lemmas 6–8. For a nor-gate, x[u]=x[v]=0x[u]=x[v]=0 gives ag=0a_g=0 and hence x[w]=1x[w]=1, while 1∈{x[u],x[v]}1\in\{x[u],x[v]\} gives ag≥3a_g\ge3 and hence x[w]=0x[w]=0. For a purify-gate, a pure input gives ag∈{0,3}a_g\in\{0,3\}, and both outputs copy it. In every case ag≤1a_g\le1 makes x[w]=0x[w]=0 and ag≥2a_g\ge2 makes x[v]=1x[v]=1, so an output is pure. Hence xx is a solution, and Pure-Circuit reduces to UDA.

Consequences: network hypergraphs and couples

Corollary 10. SHbM is PPAD-complete on network hypergraphs and on unimodular hypergraphs, already with hyperedges of size 3 and capacities at most 9.

Proof. The network representation in § 2 transforms every instance constructed for Theorem 9 into a three-uniform SHbM instance with the same capacity bound. Network hypergraphs are unimodular, and membership follows from Proposition 4.

The hospitals/residents problem with couples (HRC) also has an interpretation of the reduction. In general, deciding whether an HRC instance admits a stable matching is NP-complete [29, 24]; see [7] for a survey. Scarf-based methods have been used to search for stable matchings [6] and to obtain stable outcomes after modifying hospital capacities [26].

Here we consider instances consisting entirely of couples. Each couple ranks acceptable ordered pairs of hospitals and prefers every such pair to being unassigned. Each hospital has a positive integer capacity and a strict order on its applicants. A feasible matching assigns both members of a couple to an acceptable pair or leaves both unassigned, and respects hospital capacities. We restrict attention to dual markets, with disjoint hospital sets H1,H2H_1,H_2, where first members apply only to H1H_1 and second members only to H2H_2. A couple assigned to (h0,h0′)(h_0,h'_0) blocks with a preferred pair (h,h′)(h,h') if each proposed hospital either already holds the corresponding member, has a free seat, or prefers that member to a current resident. The couple has no current hospitals if it is unassigned.

We impose the additional restriction that a function ϕ:H2→H1\phi: H_2 \to H_1 is fixed and every acceptable pair is of the form (ϕ(h′),h′)(\phi(h'), h'). Thus each hospital on the second side is associated with a single hospital on the first side. This is a subclass of dual markets; unrestricted dual markets may have no stable matching [14].

Corollary 11. Every HRC instance with this fixed hospital association admits a stable matching. Finding one is PPAD-complete, even when each couple ranks at most two pairs and all capacities are at most nine.

Proof. Map a UDA student ss to a couple (sU,sP)(s_U, s_P), universities to H1H_1, and programs to H2H_2, with ϕ(p)=u(p)\phi(p) = u(p). Hospital uu ranks sUs_U by its master order, hospital pp ranks sPs_P by ≻p\succ_p, and the couple ranks (u(p),p)(u(p),p) as ss ranks pp. The same construction in reverse transforms any instance with the fixed association into a UDA instance. Feasibility is preserved. In a preferred pair, the first member’s hospital already holding her is exactly the condition s∈μ(u)s \in\mu(u) in Definition 2. The second member’s current hospital cannot be the proposed program, since then the couple would already hold the proposed pair. The blocking conditions therefore coincide. Existence follows from the network representation, and completeness from Theorem 9 and Proposition 4. □

Stable matchings in unimodular hypergraphs

We now show that unit capacities do not make the problem easy once we move from network hypergraphs to unimodular ones. Following the terminology of Section 3, we refer to the vertices representing circuit values as students. In gadgets based on classical stable marriage markets, we additionally refer to certain internal vertices as men and women. These terms are used solely to aid intuition; formally, all agents are vertices of a hypergraph with unit capacities. As in Section 3, we reduce from a fan-out free Pure-Circuit instance, and every node is represented by students with a first-choice home hyperedge and a second-choice input hyperedge. Since there are no capacities to count with, we use two students per node instead of three, in a dual-rail encoding, and build all gates from small gadgets. Section 4.1 sets up the wiring framework, Sections 4.2–4.3 describe the gadgets, Section 4.4 gives the reduction, and Section 4.5 proves that the constructed hypergraph is unimodular.

Gadgets and wires

A gadget XX is a hypergraph with vertex preferences together with two disjoint sets of vertices, its input ports and output ports. Every input port aa lies in exactly one hyperedge of XX, its input edge in⁡(a)\operatorname{in}(a), and every output port yy lies in exactly one hyperedge of XX, its home edge h(y)h(y). No hyperedge contains two ports.

Given gadgets with pairwise disjoint vertex sets, a wiring identifies some output ports with input ports of other gadgets, such that every port is identified with at most one other port. The identified vertex yy is a wire; it lies in exactly the two hyperedges h(y)h(y) and in⁡(y)\operatorname{in}(y), of the two different gadgets, and ranks h(y)≻yin⁡(y)h(y) \succ_y \operatorname{in}(y). All other vertices keep their hyperedges and preferences. Ports that are not identified remain external ports of the resulting hypergraph, which is therefore again a gadget.

Home and away. For a matching MM and a port yy, we say that yy is at home if h(y)∈Mh(y) \in M and away otherwise, and we write r(y)=0r(y) = 0 or r(y)=1r(y) = 1, respectively. In the reduction, these values of the rail students encode the circuit values. An away input port aa may be covered by in⁡(a)\operatorname{in}(a) or be uncovered; r(a)=1r(a) = 1 only says that in⁡(a)\operatorname{in}(a) is available to aa.

Structure of the argument. The hypergraph H\mathcal{H} constructed in Section 4.4 is unimodular (Theorem 20), so it has a stable matching by Proposition 4. We never construct a stable matching, and we never have to check that a given matching is stable. Instead we fix an arbitrary stable matching MM of H\mathcal{H} and derive necessary conditions on the values r(⋅)r(\cdot), one gadget at a time. This is done in two separate steps.

  1. (Gadget relations.) Each gadget XX is analysed in isolation. For every input vector α\alpha, we take an arbitrary stable matching of the small hypergraph X[α]X[\alpha] defined below and show that its outputs satisfy a relation RXR_X (Lemmas 13 and 14). Here stability is a hypothesis: the proofs only use that no hyperedge blocks.

  2. (Locality.) Lemma 12 proves that the restriction of a stable matching of the whole hypergraph to a gadget XX is a stable matching of X[α]X[\alpha], where α\alpha consists of the values r(a)r(a) of the input ports of XX. This is the only place where stability of a matching is proved.

Together, (1) and (2) show that the values r(⋅)r(\cdot) in MM satisfy the relations of all gadgets simultaneously. Lemma 16 then reads off the circuit values.

The isolated gadget X[α]X[\alpha]. Let XX be a gadget with input ports II and output ports OO, and let α∈{0,1}I\alpha\in\{0,1\}^{I}. Let X[α]X[\alpha] be the hypergraph obtained from XX by deleting in⁡(a)\operatorname{in}(a) for every a∈Ia \in I with αa=0\alpha_a = 0, with the preferences of XX restricted to the remaining hyperedges. The vector α\alpha models everything that XX sees of the rest of the instance.

  • An input port aa with αa=0\alpha_a = 0 is at home in the gadget producing it and prefers h(a)h(a) to in⁡(a)\operatorname{in}(a). So in⁡(a)\operatorname{in}(a) is neither in the matching nor blocking, and it can be deleted.

  • An input port aa with αa=1\alpha_a = 1 is not at home. Inside XX its only hyperedge is in⁡(a)\operatorname{in}(a), which it would accept.

  • An output port yy lies only in h(y)h(y) inside XX. Its input edge in the reading gadget is its second choice, so for XX it behaves like a vertex whose only hyperedge is h(y)h(y).

For a matching of X[α]X[\alpha] and an output port yy, let ry=0r_y = 0 if yy is covered, necessarily by h(y)h(y), and ry=1r_y = 1 otherwise. This agrees with r(y)r(y) defined above.

Computing a relation. We say that XX computes a relation R⊆{0,1}I×{0,1}OR \subseteq\{0,1\}^{I} \times\{0,1\}^{O} if for every α∈{0,1}I\alpha\in\{0,1\}^{I} and every stable matching of X[α]X[\alpha], the pair (α,r)(\alpha,r) belongs to RR. When RR is the graph of a function, we say that XX computes this function. This is a statement about all stable matchings of X[α]X[\alpha]. It does not claim that X[α]X[\alpha] has one, and it may allow several outputs for the same α\alpha, as for BREAK0_0 with α=(0,0)\alpha= (0,0).

Lemma 12 (Locality). Let YY be a wiring of gadgets, α\alpha a vector on the external input ports of YY, and MM a stable matching of Y[α]Y[\alpha]. For each gadget XX of the wiring, define αX\alpha^{X} on the input ports of XX by αaX=αa\alpha^{X}_a = \alpha_a if aa is an external input port of YY, and αaX=r(a)\alpha^{X}_a = r(a) if aa is a wire. Then:

(i) MX=M∩E(X)M_X = M \cap E(X) is a stable matching of X[αX]X[\alpha^{X}];

(ii) an output port yy of XX is covered by MXM_X if and only if r(y)=0r(y) = 0.

Consequently, if every gadget XX computes a relation RXR_X, then the values r(⋅)r(\mathord{\cdot}) satisfy all relations RXR_X simultaneously.

We use Lemma 12 in two ways. With Y=HY = \mathcal{H}, which has no external ports, it transfers the gadget relations to an arbitrary stable matching of H\mathcal{H}. Furthermore, with YY being a small composite gadget, such as BREAK1_1 or the NOR and PURIFY gadgets, it shows that YY computes the relation obtained by composing the relations of its parts (Lemmas 15 and 16).

Proof. The hypothesis is that MM is stable in Y[α]Y[\alpha]; we prove that MXM_X is stable in X[αX]X[\alpha^{X}].

MXM_X is a matching of X[αX]X[\alpha^{X}]. We check that MXM_X contains no deleted hyperedge. For an external input port aa with αa=0\alpha_a = 0, the edge in⁡(a)\operatorname{in}(a) is not in Y[α]Y[\alpha], so it is not in MM. For a wire aa with r(a)=0r(a) = 0, we have h(a)∈Mh(a) \in M, so in⁡(a)∉M\operatorname{in}(a) \notin M.

No hyperedge of X[αX]X[\alpha^{X}] blocks MXM_X. Let ee be a hyperedge of X[αX]X[\alpha^{X}] with e∉MXe \notin M_X. Then ee is a hyperedge of Y[α]Y[\alpha] not in MM. Since MM is stable in Y[α]Y[\alpha], it does not block MM, so some v∈ev \in e is covered by a hyperedge M(v)≺veM(v) \prec_v e. We show that M(v)∈MXM(v) \in M_X, so that vv also dominates ee with respect to MXM_X in X[αX]X[\alpha^{X}].

  • vv is not an output port yy of XX, because then e=h(y)e = h(y), the first choice of yy.

  • vv is not an input port aa of XX. If aa is external, then e=in⁡(a)e = \operatorname{in}(a) is its only hyperedge in Y[α]Y[\alpha]. If aa is a wire, then M(a)≻ain⁡(a)=eM(a) \succ_a \operatorname{in}(a) = e forces M(a)=h(a)M(a) = h(a), so αaX=r(a)=0\alpha^{X}_a = r(a) = 0 and ee was deleted from X[αX]X[\alpha^{X}].

  • Hence vv is an internal vertex of XX. All hyperedges at vv belong to XX, so M(v)∈MXM(v) \in M_X.

Outputs. An output port yy of XX lies only in h(y)h(y) inside XX, so it is covered by MXM_X if and only if h(y)∈Mh(y) \in M, that is, r(y)=0r(y) = 0.

The final claim follows by applying the definition of computing RXR_X to the stable matching MXM_X of X[αX]X[\alpha^{X}], whose input vector is αX\alpha^{X} and whose output values are r(⋅)r(\mathord{\cdot}) by (ii). □\square

How gadget relations are proved. In the proofs of Lemmas 13 and 14, we fix α\alpha and an arbitrary stable matching MM of X[α]X[\alpha], and we use stability only through the following consequence: if a hyperedge ee is not in MM, then some vertex of ee is covered by a hyperedge it prefers to ee. In particular, if every vertex of ee ranks ee first among its hyperedges in X[α]X[\alpha], then e∈Me \in M. These arguments determine what MM must look like; they never require checking that some matching is stable.

Monotone gadgets

Table 1 lists four basic gadgets. A vertex that lies in a single hyperedge has a trivial preference order and is omitted. The gadget NOT is used only inside the gadget BREAK1_1 of Section 4.3.

Lemma 13. The gadgets COPY, OR, AND and NOT compute the functions in Table 1.

Proof. Fix α\alpha and a stable matching MM of X[α]X[\alpha]. Recall that an input port aa with αa=1\alpha_a=1 lies only in in⁡(a)\operatorname{in}(a).

COPY. If αa=1\alpha_a=1, every vertex of in⁡(a)\operatorname{in}(a) ranks it first, so in⁡(a)∈M\operatorname{in}(a)\in M, and y1,y2y_1,y_2 are uncovered. If αa=0\alpha_a=0, then h(yj)h(y_j) is the only hyperedge of sjs_j and of yjy_j, so h(yj)∈Mh(y_j)\in M for j=1,2j=1,2.

OR. If αai=1\alpha_{a_i}=1 for some ii, then in⁡(ai)∈M\operatorname{in}(a_i)\in M as before, so sis_i is not available for h(y)h(y) and yy is uncovered. If α=(0,0)\alpha=(0,0), then h(y)h(y) is the only hyperedge of all its vertices, so h(y)∈Mh(y)\in M.

AND. If αai=1\alpha_{a_i}=1, then in⁡(ai)∈M\operatorname{in}(a_i)\in M, so bi∉Mb_i\notin M and qiq_i can only be covered by pp. If αai=0\alpha_{a_i}=0, then bib_i is the only hyperedge of cic_i and the first choice of qiq_i, so bi∈Mb_i\in M and p∉Mp\notin M. Hence if α=(1,1)\alpha=(1,1), every vertex of pp is uncovered or covered by pp, and ss ranks pp first, so p∈Mp\in M and yy is uncovered. Otherwise p∉Mp\notin M, so h(y)h(y) is the only remaining hyperedge of ss and yy, and h(y)∈Mh(y)\in M.

NOT. If αa=1\alpha_a=1, then in⁡(a)∈M\operatorname{in}(a)\in M, so g∉Mg\notin M, and h(y)h(y) is the only remaining hyperedge of tt and yy, so h(y)∈Mh(y)\in M. If αa=0\alpha_a=0, then gg is the only hyperedge of zz and the first choice of tt, so g∈Mg\in M and yy is uncovered.

Breaking ties with two marriage markets

The only non-monotone behaviour we need comes from a gadget built from two copies of the classical 2×22\times2 marriage market with two stable matchings. We write xyxy for a hyperedge {x,y}\{x,y\}.

The gadget BREAK0_0. It has input ports a1,a2a_1,a_2 and output ports y1,y2y_1,y_2. For i=1,2i=1,2, side ii consists of two men mi,mi′m_i,m'_i and two women fi,fi′f_i,f'_i with the four hyperedges

mifi,h(yi)={mi,fi′,yi},mi′fi′,mi′fi.m_if_i,\quad h(y_i)=\{m_i,f'_i,y_i\},\quad m'_if'_i,\quad m'_if_i.

and the input edge in⁡(ai)=aifi′\operatorname{in}(a_i)=a_if'_i. A single coupling hyperedge c=m1m2c=m_1m_2 joins the two sides. The preferences are

mi:mifi≻c≻h(yi),fi′:h(yi)≻in⁡(ai)≻mi′fi′,mi′:mi′fi′≻mi′fi,fi:mi′fi≻mifi.\begin{aligned} m_i &: m_if_i\succ c\succ h(y_i), & f'_i &: h(y_i)\succ\operatorname{in}(a_i)\succ m'_if'_i,\\ m'_i &: m'_if'_i\succ m'_if_i, & f_i &: m'_if_i\succ m_if_i. \end{aligned}

Ignoring cc, yiy_i and aia_i, for each side ii we get a marriage market in which both men rank different women first and both women rank different men first. It has exactly two stable matchings: the men-optimal Ai={mifi,mi′fi′}A_i=\{m_if_i,m'_if'_i\} and the women-optimal Bi={h(yi),mi′fi}B_i=\{h(y_i),m'_if_i\}. In AiA_i the output yiy_i is away and mim_i has his first choice; in BiB_i the output yiy_i is at home and mim_i would rather take the coupling edge. An arriving input aia_i destroys AiA_i, since fi′f'_i prefers in⁡(ai)\operatorname{in}(a_i) to mi′fi′m'_if'_i. Figure 2(a) shows the gadget.

Lemma 14. BREAK0_0 computes the relation

(y1,y2)=(a2,a1)if (a1,a2)≠(0,0),(y1,y2)≠(0,0)if (a1,a2)=(0,0).(y_1,y_2)=(a_2,a_1)\quad\text{if }(a_1,a_2)\ne(0,0),\qquad(y_1,y_2)\ne(0,0)\quad\text{if }(a_1,a_2)=(0,0).

Proof. Fix α\alpha and a stable matching MM of BREAK0[α]_0[\alpha].

Claim 1: if c∉Mc\notin M, then MM contains AiA_i or BiB_i for each side ii, and it contains AiA_i only if αai=0\alpha_{a_i}=0.

Suppose first mi′fi′∈Mm'_if'_i\in M. Then h(yi)∉Mh(y_i)\notin M, as it meets fi′f'_i, and mi′fi∉Mm'_if_i\notin M, as it meets mi′m'_i. If mifi∉Mm_if_i\notin M, then mim_i and fif_i are both uncovered, since also c∉Mc\notin M, and mifim_if_i blocks. Thus Ai⊆MA_i\subseteq M. If αai=1\alpha_{a_i}=1, then in⁡(ai)\operatorname{in}(a_i) blocks, since aia_i is uncovered and fi′f'_i prefers in⁡(ai)\operatorname{in}(a_i) to mi′fi′m'_if'_i; hence αai=0\alpha_{a_i}=0.

Suppose now mi′fi′∉M.Thenm'_if'_i\notin M. Thenm'_if_i\in M$, since otherwise mi′m'_i is uncovered and fif_i ranks mi′fim'_if_i first, so mi′fim'_if_i blocks. If mifi∉Mm_if_i\notin M and c∉Mc\notin M, so mim_i is uncovered unless h(yi)∈Mh(y_i)\in M. The vertex yiy_i lies only in h(yi)h(y_i), and fi′f'_i ranks h(yi)h(y_i) first. Hence h(yi)∈M,asotherwiseitblocks,andh(y_i)\in M, as otherwise it blocks, andB_i\subseteq M$.

Claim 2: if c∈Mc\in M, then α=(1,1)\alpha=(1,1) and y1,y2y_1,y_2 are uncovered. The edges h(yi)h(y_i) meet cc at mim_i, so y1,y2y_1,y_2 are uncovered. Suppose αai=0\alpha_{a_i}=0. If mi′fi′∈Mm'_if'_i\in M, then fif_i is uncovered, as mifim_if_i meets cc and mi′fim'_if_i meets mi′fi′m'_if'_i; so

mifim_if_i blocks because mim_i prefers it to cc. If mi′fi∈Mm'_if_i\in M, then fi′f'_i is uncovered, since her other hyperedges are h(yi)h(y_i), which meets cc, and the deleted in⁡(ai)\operatorname{in}(a_i); so mi′fi′m'_if'_i blocks. If mi′m'_i is uncovered, then mi′fi′m'_if'_i blocks. Each case contradicts stability.

Conclusion. If c∉Mc\notin M, then cc does not block, so some mim_i prefers his hyperedge in MM to cc, that is, not both sides use BiB_i. For α=(0,0)\alpha=(0,0), Claim 2 gives c∉Mc\notin M, so some side uses AiA_i and its yiy_i is uncovered; hence (y1,y2)≠(0,0)(y_1,y_2)\ne(0,0). For α=(1,0)\alpha=(1,0), Claim 2 gives c∉Mc\notin M, Claim 1 gives B1⊆MB_1\subseteq M, and then A2⊆MA_2\subseteq M; so (y1,y2)=(0,1)(y_1,y_2)=(0,1). The case α=(0,1)\alpha=(0,1) is symmetric. For α=(1,1)\alpha=(1,1), Claim 1 would put B1∪B2B_1\cup B_2 in MM if c∉Mc\notin M, which is impossible as cc would block; so c∈Mc\in M and (y1,y2)=(1,1)(y_1,y_2)=(1,1) by Claim 2.

All three outcomes for α=(0,0)\alpha=(0,0) occur: A1∪A2A_1\cup A_2, A1∪B2A_1\cup B_2 and B1∪A2B_1\cup A_2 are stable. The relation of Lemma 14 is therefore not monotone, and it is exactly what is needed to purify the code (0,0)(0,0).

The gadget BREAK1\mathrm{BREAK}_1. Take a copy of BREAK0\mathrm{BREAK}_0 and four NOT\mathrm{NOT} gadgets. For i=1,2i=1,2, wire the output of the ii-th NOT\mathrm{NOT} gadget to the input port aia_i of BREAK0\mathrm{BREAK}_0, and the output port yiy_i of BREAK0\mathrm{BREAK}_0 to the input of the (2+i)(2+i)-th NOT\mathrm{NOT} gadget. The input ports of BREAK1\mathrm{BREAK}_1 are the inputs a1′,a2′a'_1,a'_2 of the first two NOT\mathrm{NOT} gadgets, and its output ports are the outputs y1′,y2′y'_1,y'_2 of the last two.

Lemma 15. BREAK1\mathrm{BREAK}_1 computes the relation

(y1′,y2′)=(a2′,a1′)  if (a1′,a2′)≠(1,1),(y1′,y2′)≠(1,1)  if (a1′,a2′)=(1,1).(y'_1,y'_2)=(a'_2,a'_1)\ \text{ if }(a'_1,a'_2)\ne(1,1),\qquad(y'_1,y'_2)\ne(1,1)\ \text{ if }(a'_1,a'_2)=(1,1).

Proof. By Lemmas 12 and 13, ai=1−ai′a_i=1-a'_i and yi′=1−yiy'_i=1-y_i, where (a,y)(a,y) satisfies Lemma 14. Complementing that relation gives the claim.

The reduction

Fix a fan-out free Pure-Circuit instance. For each node zz, we create two rail students z1,z2z^1,z^2. We decode

x[z]={1,(r(z1),r(z2))=(1,0),0,(r(z1),r(z2))=(0,1),⊥,otherwise.x[z]= \begin{cases} 1, & (r(z^1),r(z^2))=(1,0),\\ 0, & (r(z^1),r(z^2))=(0,1),\\ \perp, & \text{otherwise}. \end{cases}

Thus z1z^1 carries the value of zz and z2z^2 its negation, and both codes (0,0)(0,0) and (1,1)(1,1) mean ⊥\perp. For each gate we create a gadget whose input ports are the rail students of its inputs and whose output ports are the rail students of its outputs; Figure 2(b,c) shows them.

Break, purify and NOR gadgets

Figure 2. (a) The gadget BREAK0\mathrm{BREAK}_0. Dots are gadget vertices and white circles are ports. Black segments are hyperedges of size two, and the shaded triangles are the home edges h(yi)={mi,fi′,yi}h(y_i)=\{m_i,f'_i,y_i\}. Small numbers give the rank of a hyperedge in the preference order of the adjacent vertex. Dashed segments are input edges in⁡(ai)=aifi′\operatorname{in}(a_i)=a_if'_i, and dashed arrows lead to the gadgets reading y1,y2y_1,y_2. (b) The PURIFY\mathrm{PURIFY} gadget for (PURIFY,u,v,w)(\mathrm{PURIFY},u,v,w); BREAK1\mathrm{BREAK}_1 is BREAK0\mathrm{BREAK}_0 with a NOT\mathrm{NOT} gadget at each port. Ports of BREAK0\mathrm{BREAK}_0 and BREAK1\mathrm{BREAK}_1 are drawn in the order a1,a2a_1,a_2 (left) and y1,y2y_1,y_2 (right). (c) The NOR\mathrm{NOR} gadget for (NOR,u,v,w)(\mathrm{NOR},u,v,w).

  • For g=(NOR,u,v,w)g=(\mathrm{NOR},u,v,w): an AND gadget with input ports u2,v2u^2,v^2 and output port w1w^1, and an OR gadget with input ports u1,v1u^1,v^1 and output port w2w^2.

  • For g = (\textsc{purify}, u, v, w): two \textsc{copy} gadgets, one with input port u1u^1 and one with input port u2u^2; a \textsc{break}_0 gadget whose input aja_j is wired to the first output of the \textsc{copy} gadget of uju^j; and a \textsc{break}_1 gadget whose input aj′a'_j is wired to the second output of the \textsc{copy} gadget of uju^j. Writing (p1,p2)(p_1,p_2) and (q1,q2)(q_1,q_2) for the output ports of \textsc{break}_0 and \textsc{break}_1, the rail students of the outputs are

v1=q2,v2=p1,w1=p2,w2=q1.v^1 = q_2,\qquad v^2 = p_1,\qquad w^1 = p_2,\qquad w^2 = q_1.

Finally, wire every rail student to the gadget of the gate reading its node, if any. Let H\mathcal{H} be the resulting hypergraph. A \textsc{nor} gadget has 9 hyperedges and a \textsc{purify} gadget has 40, so the construction is polynomial. Every wire joins two different gadgets: inside a \textsc{purify} gadget this is clear, and between gates it follows from the distinctness of u,v,wu,v,w within each gate. Every rail student has exactly one home edge, and at most one input edge because the instance is fan-out free.

Lemma 16. Let H\mathcal{H} be a stable matching of H\mathcal{H} and xx its decoding.

(a) For a gate (\textsc{nor},u,v,w), x[u]=x[v]=0x[u]=x[v]=0 implies x[w]=1x[w]=1, and 1∈{x[u],x[v]}1 \in\{x[u],x[v]\} implies x[w]=0x[w]=0.

(b) For a gate (\textsc{purify},u,v,w), x[u]∈{0,1}x[u]\in\{0,1\} implies x[v]=x[w]=x[u]x[v]=x[w]=x[u]. Moreover, x[v]=0x[v]=0 or x[w]=1x[w]=1.

Proof. By Lemma 12, the values r(⋅)r(\cdot) satisfy the relations of all gadgets.

(a) By Lemma 13, r(w1)=r(u2)∧r(v2)r(w^1)=r(u^2)\land r(v^2) and r(w2)=r(u1)∨r(v1)r(w^2)=r(u^1)\lor r(v^1). If x[u]=x[v]=0x[u]=x[v]=0, then r(u1)=r(v1)=0r(u^1)=r(v^1)=0 and r(u2)=r(v2)=1r(u^2)=r(v^2)=1, so (r(w1),r(w2))=(1,0)(r(w^1),r(w^2))=(1,0) and x[w]=1x[w]=1. If x[u]=1x[u]=1, then r(u1)=1r(u^1)=1 and r(u2)=0r(u^2)=0, so (r(w1),r(w2))=(0,1)(r(w^1),r(w^2))=(0,1) and x[w]=0x[w]=0; the case x[v]=1x[v]=1 is symmetric.

(b) Both inputs of \textsc{break}_0 and of \textsc{break}_1 receive (r(u1),r(u2))(r(u^1),r(u^2)) by Lemma 13. Lemmas 14 and 15 give the following cases, where p=(r(p1),r(p2))p=(r(p_1),r(p_2)) and q=(r(q1),r(q2))q=(r(q_1),r(q_2)), and x[v],x[w]x[v],x[w] are decoded from (r(q2),r(p1))(r(q_2),r(p_1)) and (r(p2),r(q1))(r(p_2),r(q_1)).

(r(u1),r(u2))(r(u^1),r(u^2))x[u]x[u]ppqq(r(v1),r(v2))(r(v^1),r(v^2))(r(w1),r(w2))(r(w^1),r(w^2))
(0,1)(0,1)00(1,0)(1,0)(1,0)(1,0)(0,1)(0,1)(0,1)(0,1)
(1,0)(1,0)11(0,1)(0,1)(0,1)(0,1)(1,0)(1,0)(1,0)(1,0)
(0,0)(0,0)⊥\bot≠(0,0)\ne(0,0)(0,0)(0,0)(0,r(p1))(0,r(p_1))(r(p2),0)(r(p_2),0)
(1,1)(1,1)⊥\bot(1,1)(1,1)≠(1,1)\ne(1,1)(r(q2),1)(r(q_2),1)(1,r(q1))(1,r(q_1))

A pure input is copied to both outputs, so x[u]=0x[u]=0 gives x[v]=0x[v]=0 and x[u]=1x[u]=1 gives x[w]=1x[w]=1. For input (0,0)(0,0), either r(p1)=1r(p_1)=1 and x[v]=0x[v]=0, or r(p2)=1r(p_2)=1 and x[w]=1x[w]=1. For input (1,1)(1,1), either r(q2)=0r(q_2)=0 and x[v]=0x[v]=0, or r(q1)=0r(q_1)=0 and x[w]=1x[w]=1.

Lemma 16 shows that the decoding of any stable matching of H\mathcal{H} is a solution of the \textsc{pure-circuit} instance. It remains to show that H\mathcal{H} is unimodular.

Unimodularity

For hypergraphs of bounded degree, Camion’s theorem reduces total unimodularity to a parity condition on holes.

Lemma 17. Let H\mathcal{H} be a hypergraph in which every hyperedge has at most three vertices and every vertex lies in at most three hyperedges. If every hole of B(H)B(\mathcal{H}) has length divisible by four, then H\mathcal{H} is unimodular.

Proof. Let A′A' be a square submatrix of the incidence matrix with even row and column sums. Each row and column of AA has at most three ones, so each row and column of A′A' has zero or two ones. Delete the zero rows and columns. The ones of the remaining matrix form a 2-regular subgraph of B(H)B(\mathcal{H}), which is the subgraph induced by its rows and columns. Hence it is a disjoint union of holes of B(H)B(\mathcal{H}), and the sum of the entries of A′A' is the sum of their lengths, which is divisible by four. Theorem 1 completes the proof.

The next lemma shows that the parity of holes can be checked gadget by gadget. For a gadget XX, let B(X)B(X) be its bipartite incidence graph, with the ports among its vertices. Consider the following two conditions:

(H1) every hole of B(X)B(X) has length divisible by four;

(H2) every chordless path of B(X)B(X) between two distinct ports has length divisible by four if exactly one of the two ports is an input port, and length congruent to 2 modulo 4 otherwise.

Lemma 18. Let H\mathcal{H} be a wiring of gadgets that satisfy (H1) and (H2). Then every hole of B(H)B(\mathcal{H}) has length divisible by four.

Proof. Every edge veve of B(H)B(\mathcal{H}) belongs to B(X)B(X) for the unique gadget XX containing ee. Let CC be a hole of B(H)B(\mathcal{H}). If all its edges belong to one gadget XX, then CC is a hole of B(X)B(X) and (H1) applies. Otherwise, call a vertex of CC a switch if its two edges on CC belong to different gadgets. A switch lies in two gadgets, so it is a wire yy, and its two neighbours on CC are h(y)h(y) and in⁡(y)\operatorname{in}(y). The switches cut CC into paths P1,…,PkP_1,\ldots,P_k, each contained in B(X)B(X) for a single gadget XX and joining two ports of XX. If there were a single switch yy, then all edges of CC would lie in one gadget, since the gadget changes only at switches, contradicting that yy is a switch. Hence k≥2k \ge2, and each PjP_j has two distinct ends. Each PjP_j is chordless in B(X)B(X), as CC is a hole.

Give a port the label +1+1 in a gadget where it is an input port and −1-1 in a gadget where it is an output port. Condition (H2) says that the length of PjP_j is congruent modulo four to the sum of the labels of its two ends in its gadget: 0 for an input and an output, 2 for two inputs, and −2≡2-2 \equiv2 for two outputs. Every switch yy is an end of exactly two paths, one in the gadget where yy is an output port and one in the gadget where it is an input port. Therefore

∣C∣=∑j=1k∣Pj∣≡∑switches y((−1)+(+1))=0(mod4).|C| = \sum_{j=1}^{k} |P_j| \equiv\sum_{\text{switches }y} \bigl((-1) + (+1)\bigr) = 0 \pmod{4}.

Lemma 19

Lemma 19. The gadgets copy⁡\operatorname{copy}, or⁡\operatorname{or}, and⁡\operatorname{and}, break⁡0\operatorname{break}_0 and break⁡1\operatorname{break}_1 satisfy (H1) and (H2).

Proof. For copy⁡\operatorname{copy}, or⁡\operatorname{or} and and⁡\operatorname{and}, the graph B(X)B(X) is a tree, so (H1) holds and each pair of ports is joined by a unique path. The input–output paths have lengths 4 (copy and or, e.g. a,in⁡(a),s1,h(y1),y1a,\operatorname{in}(a),s_1,h(y_1),y_1) and 8 (and: ai,in⁡(ai),ci,bi,qi,p,s,h(y),ya_i,\operatorname{in}(a_i),c_i,b_i,q_i,p,s,h(y),y). The paths between the two outputs of copy and between the two inputs of or have length 6, and between the two inputs of and length 10.

For break⁡0\operatorname{break}_0, side ii forms the cycle

Ci:mi, mifi, fi, mi′fi, mi′, mi′fi′, fi′, h(yi), miC_i : m_i,\ m_i f_i,\ f_i,\ m'_i f_i,\ m'_i,\ m'_i f'_i,\ f'_i,\ h(y_i),\ m_i

of length 8. The rest of B(break⁡0)B(\operatorname{break}_0) consists of the path m1,c,m2m_1,c,m_2 and the pendant paths ai,in⁡(ai),fi′a_i,\operatorname{in}(a_i),f'_i and yi,h(yi)y_i,h(y_i). Thus the holes are C1C_1 and C2C_2, and (H1) holds. A chordless path from aia_i starts with ai,in⁡(ai),fi′a_i,\operatorname{in}(a_i),f'_i, and one from yiy_i starts with yi,h(yi)y_i,h(y_i). Paths between the two sides pass through m1,c,m2m_1,c,m_2.

The only remaining choice is how a path runs through CiC_i, and here we use that a chordless path is induced: any two of its vertices that are adjacent in B(break⁡0)B(\operatorname{break}_0) must be consecutive on the path. The vertex of h(yi)h(y_i) is adjacent exactly to mim_i, fi′f'_i and yiy_i. So if a chordless path contains h(yi)h(y_i) together with mim_i, or together with fi′f'_i, then these two vertices are consecutive on it. This rules out every detour around CiC_i that ends at h(yi)h(y_i):

(a) A chordless path from fi′f'_i to mim_i is either fi′,h(yi),mif'_i,h(y_i),m_i, of length 2, or the other way around CiC_i, namely fi′,mi′fi′,mi′,mi′fi,fi,mifi,mif'_i,m'_i f'_i,m'_i,m'_i f_i,f_i,m_i f_i,m_i, of length 6. The second one avoids h(yi)h(y_i).

(b) A chordless path from fi′f'_i to yiy_i is fi′,h(yi),yif'_i,h(y_i),y_i. Going around CiC_i to mim_i first and then to h(yi)h(y_i) would contain fi′f'_i and h(yi)h(y_i) without being consecutive.

(c) Symmetrically, a chordless path from mim_i to yiy_i is mi,h(yi),yim_i,h(y_i),y_i, since going around CiC_i to fi′f'_i first would contain mim_i and h(yi)h(y_i) without being consecutive.

Combining the initial segments at aia_i and yiy_i, the passage m1,c,m2m_1,c,m_2 between the sides, and (a)–(c), the chordless paths between ports have the following lengths: aia_i–aia_i: 4; aia_i–yiy_i: 2+{2,6}+2∈{8,12}2+\{2,6\}+2 \in\{8,12\}; a1a_1–a2a_2: 2+{2,6}+2+{2,6}+2∈{10,14,18}2+\{2,6\}+2+\{2,6\}+2 \in\{10,14,18\}; y1y_1–y2y_2: 6. This proves (H2).

Finally, B(break⁡1)B(\operatorname{break}_1) is obtained from B(break⁡0)B(\operatorname{break}_0) by attaching at each port a pendant path of length 6 through a NOT gadget, for instance ai′,in⁡(ai′),x,g,t,h(ai),aia'_i,\operatorname{in}(a'_i),x,g,t,h(a_i),a_i. This creates no new hole and adds 12 to the length of every chordless path between ports.

A single NOT gadget violates (H2): its input–output path has length 6. This is why negation in the circuit is realized by the choice of rails, and NOT gadgets occur only inside break⁡1\operatorname{break}_1, where every path between two of its ports passes through exactly two of them.

Theorem 20. Finding a stable matching in a unimodular hypergraph is PPAD-complete. This holds even for linear hypergraphs in which every hyperedge has at most three vertices and every vertex lies in at most three hyperedges. Proof. Membership follows from Proposition 4. For hardness, construct H\mathcal{H} as in § 4.4. It is a wiring of copy, or, and, break0_0 and break1_1 gadgets, so Lemmas 18 and 19 show that every hole of B(H)B(\mathcal{H}) has length divisible by four. Every hyperedge has at most three vertices. A rail student lies in at most two hyperedges, the vertices mim_i and fif_i of a break0_0 gadget in three, and every other vertex in at most two. So H\mathcal{H} is unimodular by Lemma 17. Each gadget is linear by inspection of Table 1 and the definition of break0_0, and hyperedges of different gadgets meet only in a wire, so H\mathcal{H} is linear. Any stable matching decodes in polynomial time to a solution of the Pure-Circuit instance by Lemma 16.*

GadgetHyperedgesPreferencesComputes
COPYin⁡(a)={a,s1,s2}\operatorname{in}(a)=\{a,s_1,s_2\}, h(yj)={sj,yj}h(y_j)=\{s_j,y_j\}sj:in⁡(a)≻h(yj)s_j:\operatorname{in}(a)\succ h(y_j)y1=y2=ay_1=y_2=a
ORin⁡(ai)={ai,si}\operatorname{in}(a_i)=\{a_i,s_i\}, h(y)={s1,s2,y}h(y)=\{s_1,s_2,y\}si:in⁡(ai)≻h(y)s_i:\operatorname{in}(a_i)\succ h(y)y=a1∨a2y=a_1\lor a_2
ANDin⁡(ai)={ai,ci}\operatorname{in}(a_i)=\{a_i,c_i\}, bi={ci,qi}b_i=\{c_i,q_i\}, p={q1,q2,s}p=\{q_1,q_2,s\}, h(y)={s,y}h(y)=\{s,y\}ci:in⁡(ai)≻bic_i:\operatorname{in}(a_i)\succ b_i, qi:bi≻pq_i:b_i\succ p, s:p≻h(y)s:p\succ h(y)y=a1∧a2y=a_1\land a_2
NOTin⁡(a)={a,z}\operatorname{in}(a)=\{a,z\}, g={z,t}g=\{z,t\}, h(y)={t,y}h(y)=\{t,y\}z:in⁡(a)≻gz:\operatorname{in}(a)\succ g, t:g≻h(y)t:g\succ h(y)y=1−ay=1-a

Table 1. The basic gadgets, with i,j∈{1,2}i,j\in\{1,2\}. Input ports are aa, a1a_1, a2a_2 and output ports are yy, y1y_1, y2y_2. The last column states the computed function, writing a port for its value r(⋅)r(\cdot).

Normal hypergraphs and kernels in perfect graphs

Unimodular hypergraphs are balanced and normal [3], and Proposition 4 applies to normal hypergraphs. Hence Theorem 20 gives the following.

Corollary 21. Finding a stable matching is PPAD-complete on balanced hypergraphs and on normal hypergraphs.

We now translate the result to kernels. Let DD be a digraph. A kernel of DD is an independent set KK such that every vertex outside KK has an arc to some vertex of KK. The digraph is an orientation of a graph GG if every edge of GG is oriented in exactly one direction, and it is clique-acyclic if every clique of GG induces an acyclic subdigraph. Boros and Gurvich [8] proved that every clique-acyclic orientation of a perfect graph has a kernel. In the proof of Aharoni and Holzman [2], Scarf’s lemma applied to the maximal-clique constraints yields a dominating vertex of the polytope {x≥0:x(Q)≤1\{x \ge0 : x(Q) \le1 for every maximal clique Q}Q\}; this polytope is integral for perfect graphs, and the integral dominating vertex is a kernel. With the maximal cliques given as input, this places the search problem in PPAD by [21]; as usual for such promise problems, we assume that the input graph is perfect and that the list of maximal cliques is complete.

Corollary 22. Finding a kernel in a clique-acyclic orientation of a perfect graph is PPAD-hard, even if the graph is the line graph of a unimodular hypergraph and has no clique on four vertices. It is PPAD-complete when the maximal cliques are part of the input, in particular for graphs of bounded clique number.

Proof. Let H\mathcal{H} be an instance of Theorem 20, and let DD be the digraph with vertices corresponding to the hyperedges e∈Ee \in E with an arc e→fe \to f whenever e∩f={v}e \cap f = \{v\} and f≻vef \succ_v e. Since H\mathcal{H} is linear, DD is an orientation of the line graph G=L(H)G = L(\mathcal{H}). A set K⊆EK \subseteq E is independent in GG if and only if it is a matching, and every e∉Ke \notin K has an arc into KK if and only if every e∉Ke \notin K is dominated. Hence the kernels of DD are exactly the stable matchings of H\mathcal{H}.

Cliques. Three pairwise intersecting hyperedges without a common vertex would meet in three distinct vertices v1,v2,v3v_1, v_2, v_3 by linearity and form a hole e1,v3,e2,v1,e3,v2,e1e_1, v_3, e_2, v_1, e_3, v_2, e_1 of length 6 in B(H)B(\mathcal{H}), contradicting Lemmas 18 and 19. So every triangle of GG lies in a star E(v)E(v), and by linearity so does every clique: if e1,e2,e3e_1, e_2, e_3 share vv, then any further e4e_4 of the clique contains e1∩e2={v}e_1 \cap e_2 = \{v\}. Consequently, cliques have at most three vertices, and DD restricted to a clique Q⊆E(v)Q \subseteq E(v) follows the order ≻v\succ_v, so it is acyclic.

Perfectness. For F⊆EF \subseteq E, the hypergraph (V,F)(V,F) has a TU incidence matrix, so linear programming duality and integrality give ν(F)=τ(F)\nu(F) = \tau(F), where ν(F)\nu(F) is the maximum number of disjoint hyperedges of FF and τ(F)\tau(F) the minimum number of vertices meeting all of them. In G[F]G[F], ν(F)\nu(F) is the independence number, and since cliques lie in stars, τ(F)\tau(F) is the minimum number of cliques covering FF. Hence the complement of GG is perfect, and so is GG by the perfect graph theorem [23].

The construction of DD is polynomial and kernels translate back to stable matchings, so hardness follows from Theorem 20. Membership was discussed above; for bounded clique number the maximal cliques can be listed in polynomial time.

Our orientations have no pair of opposite arcs, so hardness holds for orientations and hence also for the superorientations considered by Boros and Gurvich [8].

Near-feasible stable matchings with couples

Nguyen and Vohra [26] proved that every HRC instance admits a stable matching after changing each hospital’s capacity by at most two. Their construction first finds a fractional stable solution using Scarf’s lemma and then rounds it. We show that finding the final near-feasible outcome is itself PPAD-hard.

For a fixed allowance r≥1r \ge1, the problem Near-Feasible HRC asks for nonnegative integer capacities c^h\widehat{c}_h and a matching that is stable under them, where ∣c^h−ch∣≤r\lvert\widehat{c}_h - c_h \rvert\le r for every hospital hh. On the fixed-association instances of Corollary 11, a solution exists already with c^=c\widehat{c} = c.

The construction. Start with the reduction in Section 3 from a fan-out free PURE-CIRCUIT instance, and put K=24rK = 24r. Replace every student by KK copies with the same preferences, and give every program quota KK. In each program and university order, replace a student by her entire block of copies, ordered strictly within the block. Multiply university capacities by KK, except that a PURIFY university has capacity 13K/213K/2 instead of 7K7K.

We use Di,Ti,Rz,jD_i, T_i, R_{z,j} also for the corresponding blocks. For a node zz, let ZjZ_j be the block replacing zjz^j, for j=1,2,3j = 1, 2, 3; for nodes vv, we write Vi,WjV_i, W_j, respectively. Every member of ZjZ_j has the same first-choice home program h(zj)h(z^j) and, if zz is read, the same second-choice input program in⁡(zj)\operatorname{in}(z^j). Each of these programs ranks ZjZ_j above its other applicants. The members of Z1∪Z2∪Z3Z_1 \cup Z_2 \cup Z_3 are the zz-students.

Correctness. Fix any allowed changes to all university capacities and program quotas, and a stable assignment μ\mu under them. A program’s new quota satisfies q^(p)∈[K−r,K+r]\widehat{q}(p) \in[K-r,K+r], and a university of original capacity CC has new capacity in [C−r,C+r][C-r,C+r].

We will repeatedly use the following consequence of stability. Suppose a block of KK students ranks a program pp first, the program ranks this block above all other applicants, and its university would accept every member of the block who is not at pp. Then at least min⁡(K,q^(p))≥K−r\min(K,\widehat{q}(p)) \ge K-r members of the block are at pp.

Let d(z)d(z) count the students in Z1∪Z2∪Z3Z_1 \cup Z_2 \cup Z_3 who are away from their home programs, including unassigned students. Decode

x[z]={0,d(z)≤4r,1,d(z)≥3K−4r,⊥,otherwise.x[z] = \begin{cases} 0, & d(z) \le4r,\\ 1, & d(z) \ge3K-4r,\\ \bot, & \text{otherwise}. \end{cases}

For a gate gg reading zz, let ag(z)a_g(z) be the number of zz-students at their input programs. An unassigned input student cannot be rejected by the reading university: only other input students rank above her, and their number is at most 6K−1<9K−r6K-1 < 9K-r in a NOR gadget or 3K−1<13K/2−r3K-1 < 13K/2-r in a PURIFY gadget. Her input program must therefore be full. It has only KK applicants and quota at least K−rK-r, so at most rr students of its block can be unassigned. Summing over the three blocks gives

d(z)−3r≤ag(z)≤d(z).d(z)-3r \le a_g(z) \le d(z).

Therefore, a zero input implies at most 4r4r arrivals and a one input at least 3K−7r3K-7r. Write aga_g for the total number of arrivals to gg.

Lemma 23. Let g=(nor,u,v,w)g=(\mathrm{nor},u,v,w) and a=aga=a_g. If a≤8ra\le8r, then d(w)≥3K−4rd(w)\ge3K-4r. If a≥3K−7ra\ge3K-7r, then d(w)≤4rd(w)\le4r.

Proof. For i=1,2,3i=1,2,3, let tit_i be the number of students of TiT_i at did_i.

Case a≤8ra\le8r. University UgU_g contains at most

a+7(K+r)≤7K+15r<9K−ra+7(K+r)\le7K+15r<9K-r

students, so it is not full. Each did_i therefore admits min⁡(K,q^(di))\min(K,\widehat{q}(d_i)) members of DiD_i, and ti≤rt_i\le r for i≤3i\le3.

If no ww-student is at home, then d(w)=3Kd(w)=3K and we are done. Otherwise NgN_g contains a ww-student, whom it ranks below every reservoir. It would therefore accept every reservoir. At least K−tiK-t_i members of TiT_i are outside did_i and want fif_i, unless already assigned there. Hence

∣μ(fi)∣≥min⁡(K−ti,q^(fi))≥K−r.|\mu(f_i)|\ge\min(K-t_i,\widehat{q}(f_i))\ge K-r.

These programs occupy at least 3K−3r3K-3r places at NgN_g. Its capacity is at most 3K+r3K+r, leaving at most 4r4r students at home. Thus d(w)≥3K−4rd(w)\ge3K-4r.

Case a≥3K−7ra\ge3K-7r. We first show that at least 3K−3r3K-3r reservoirs are at UgU_g. If UgU_g contains no DD-student, it must be full: otherwise a member of D7D_7 could take a free place at the empty program d7d_7 and block. Since at most 6K6K input students are there, at least 3K−r3K-r reservoirs are at UgU_g.

Otherwise UgU_g contains a DD-student and would accept every reservoir. Suppose k∈{1,2,3}k\in\{1,2,3\} is minimal with tk<K−rt_k<K-r. A member of TkT_k missing from dkd_k must be rejected by that program. Thus dkd_k is full and contains a DkD_k-student. For every m>km>k, the university ranks all members of DmD_m above this student, and dmd_m ranks DmD_m first. Hence at least K−rK-r members of each such block are at dmd_m.

Count the earlier k−1k-1 reservoir blocks, the full program dkd_k, and the 7−k7-k higher-ranked DD-blocks. Together with the arrivals, they give

∣μ(Ug)∣≥a+7(K−r)≥10K−14r>9K+r,|\mu(U_g)|\ge a+7(K-r)\ge10K-14r>9K+r,

a contradiction. Therefore ti≥K−rt_i\ge K-r for every ii, proving the reservoir bound in this case too.

At most 3r3r reservoirs can now be at NgN_g. If NgN_g is full, at least 3K−4r3K-4r of its students belong to the output blocks W1,W2,W3W_1,W_2,W_3. If it is not full, each home program contains at least K−rK-r members of its corresponding block WjW_j. In either case d(w)≤4rd(w)\le4r.

Lemma 24. Let g=(purify,u,v,w)g=(\mathrm{purify},u,v,w) and a=aga=a_g. If a≤4ra\le4r, then d(v),d(w)≤3rd(v),d(w)\le3r; if a≥3K−7ra\ge3K-7r, then d(v)=d(w)=3Kd(v)=d(w)=3K. For arbitrary aa, either d(w)≤3rd(w)\le3r or d(v)=3Kd(v)=3K. Proof. Case a≤4ra \le4r. University UgU_g contains at most

a+6(K+r)≤6K+10r<13K/2−ra + 6(K+r) \le6K+10r < 13K/2-r

students and is not full. Each home program ranks its corresponding block VjV_j or WjW_j first. It therefore contains at least K−rK-r students from that block, giving d(v),d(w)≤3rd(v),d(w) \le3r.

Case a≥3K−7ra \ge3K-7r. Suppose an output student is at home. The university ranks every reservoir above her, so it would accept every reservoir. Each of the four programs with a reservoir block must then contain at least K−rK-r students: either all KK reservoirs are there, or an absent reservoir forces the program to be full. Moreover, at least one member of W3W_3 is at home. Otherwise, since every member of W3W_3 is ranked above any other output student, a member of W3W_3 could block with her empty home program (the university has a worse output student by the assumption). As h(w3)h(w^3) is not one of the four programs containing reservoir blocks, we obtain

∣μ(Ug)∣≥a+4(K−r)+1≥7K−11r+1>13K/2+r,|\mu(U_g)| \ge a+4(K-r)+1 \ge7K-11r+1 > 13K/2+r,

a contradiction.

Thus, no output student is at home, so d(v)=d(w)=3Kd(v)=d(w)=3K.

Arbitrary aa. If a vv-student is at home, the university would accept every ww-student, since all of them rank above her. Each home program of ww therefore contains at least K−rK-r members of its block WjW_j, giving d(w)≤3rd(w) \le3r. If no vv-student is at home, then d(v)=3Kd(v)=3K.

Theorem 25. For every fixed integer r≥1r \ge1, Near-Feasible HRC is PPAD-hard, even in the fixed-association subclass, with at most two acceptable pairs per couple and capacities at most 216r216r.

Proof. For a NOR gate, two zero inputs give ag≤8ra_g \le8r, so Lemma 23 gives output one. An input one gives ag≥3K−7ra_g \ge3K-7r, so the output is zero. Lemma 24 shows that a PURIFY gate copies a pure input to both outputs and always has a pure output. Hence every stable assignment under any allowed capacity changes decodes to a PURE-CIRCUIT solution.

Interpret students as couples as in Corollary 11. Every couple lists at most two pairs, the university–program association is unchanged, and all capacities are at most 9K=216r9K=216r. A stable matching exists at the original capacities. For fixed rr, construction and decoding are polynomial, proving the theorem.

Nguyen and Vohra’s guarantee also bounds the aggregate capacity change. Our reduction allows arbitrary individual changes, so the same proof applies under their precise bounds.

Corollary 26. Near-Feasible HRC is PPAD-hard with allowance two even under the additional requirement 0≤∑h(c^h−ch)≤40 \le\sum_h(\widehat{c}_h-c_h) \le4, and with original capacities at most 432432.

Conclusion

We showed that integral stable solutions guaranteed by polyhedral integrality are PPAD-hard to find. For unit capacities, hardness holds on unimodular hypergraphs that are linear and have hyperedges and degrees bounded by three, and therefore on balanced and on normal hypergraphs and for kernels in clique-acyclic orientations of perfect graphs. With capacities, hardness holds already on network hypergraphs with hyperedges of size three and capacities at most nine, in University Dual Admission, and in a natural subclass of dual markets with couples. The near-feasible extension shows that the same difficulty persists when each hospital may change its capacity by any fixed additive amount.

The results leave a clear map of the remaining open cases. Stable matchings are polynomial on network hypergraphs [11] and PPAD-complete on unimodular ones. By Seymour’s decomposition theorem [32], totally unimodular matrices are built from network matrices, their transposes, and a single exceptional matrix. Is SHM polynomial on hypergraphs whose incidence matrix is the transpose of a network matrix? For kernels, our graphs are line graphs with clique number three; the complexity for claw-free perfect graphs with superorientations, left open in [28], remains unresolved. Further questions are the complexity of SHM on subpath hypergraphs [4] and the smallest university capacity sufficient for PPAD-hardness in UDA. Finally, we hope that our techniques will be useful for showing hardness of other combinatorial problems where integral solutions are guaranteed.

Declaration of AI use

During the research, the author used Claude (Anthropic) and ChatGPT (OpenAI) to assist in exploring proof strategies, developing and testing candidate gadget constructions for the reductions in Sections 3 and 4, and searching the literature. The author contributed key mathematical ideas, proposed gadget outlines, directed the exploration of proof strategies, and critically evaluated and refined the AI-generated arguments and constructions. In particular, the author worked extensively on simplifying the reductions, streamlining the gadget constructions, and developing rigorous, intuitive, and accessible proofs.

The author checked all definitions, constructions, proofs, and references and takes full responsibility for the content of this paper. The AI tools are not authors of this work.

References

  1. [1]R. Aharoni and T. Fleiner. On a lemma on Scarf. Journal of Combinatorial Theory, Series B, 87(1):72–80, 2003. 10.1016/S0095-8956(02)00028-X.
  2. [2]R. Aharoni and R. Holzman. Fractional kernels in digraphs. Journal of Combinatorial Theory, Series B, 73(1):1–6, 1998. 10.1006/jctb.1997.1731.DOI
  3. [3]C. Berge. Hypergraphs: Combinatorics of Finite Sets. North-Holland Mathematical Library, volume 45. North-Holland, 1989.
  4. [4]P. Biró, G. Csáji and I. Schlotter. Stable hypergraph matching in unimodular hypergraphs. In 52nd International Colloquium on Automata, Languages, and Programming (ICALP 2025), volume 334 of LIPIcs, pages 31:1–31:20. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2025. 10.4230/LIPIcs.ICALP.2025.31.arxiv.org/abs/2502.08827
  5. [5]P. Biró and T. Fleiner. Fractional solutions for capacitated NTU-games, with applications to stable matchings. Discrete Optimization, 22:241–254, 2016. 10.1016/j.disopt.2015.02.002.DOI
  6. [6]P. Biró, T. Fleiner and R. W. Irving. Matching couples with Scarf’s algorithm. Annals of Mathematics and Artificial Intelligence, 77(3–4):303–316, 2016. 10.1007/s10472-015-9491-5.DOI
  7. [7]P. Biró and F. Klijn. Matching with couples: A multidisciplinary survey. International Game Theory Review, 15(2):1340008, 2013. 10.1142/S0219198913400082.DOI
  8. [8]E. Boros and V. Gurvich. Perfect graphs are kernel solvable. Discrete Mathematics, 159(1–3):35–55, 1996. 10.1016/0012-365X(95)00096-F.DOI
  9. [9]P. Camion. Characterization of totally unimodular matrices. Proceedings of the American Mathematical Society, 16(5):1068–1073, 1965. 10.1090/S0002-9939-1965-0180568-2.DOI
  10. [10]K. Chandrasekaran, Y. Faenza, C. He and J. Sethuraman. Scarf’s algorithm on arborescence hypergraphs. In 52nd International Colloquium on Automata, Languages, and Programming (ICALP 2025), volume 334 of LIPIcs, pages 45:1–45:18. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2025. 10.4230/LIPIcs.ICALP.2025.45.arxiv.org/abs/2412.03397
  11. [11]K. Chandrasekaran and K. Kalathur. Polynomial-time stable matching in network hypergraphs. arXiv:2608.24728, 2026. https://arxiv.org/abs/2608.24728.
  12. [12]V. Chvátal. On the computational complexity of finding a kernel. Report CRM-300, Centre de Recherches Mathématiques, Université de Montréal, 1973.
  13. [13]G. Csáji. On the complexity of stable hypergraph matching, stable multicommodity flow and related problems. Theoretical Computer Science, 931:1–16, 2022. 10.1016/j.tcs.2022.07.025.DOI
  14. [14]G. Csáji, D. Manlove, I. McBride and J. Trimble. Couples can be tractable: New algorithms and hardness results for the hospitals/residents problem with couples. Algorithmica, 88(5), article 63, 2026. 10.1007/s00453-026-01405-4.
  15. [15]A. Deligkas, J. Fearnley, A. Hollender and T. Melissourgos. Pure-Circuit: Tight inapproximability for PPAD. Journal of the ACM, 71(5), article 31, pages 31:1–31:48, 2024. 10.1145/3678166.DOI
  16. [16]EGRES Open. Finding kernels in special digraphs. https://lemon.cs.elte.hu/egres/open/Finding_kernels_in_special_digraphs.
  17. [17]Y. Faenza, C. He and J. Sethuraman. Scarf’s algorithm and stable marriages. Mathematics of Operations Research, 51(2):1174–1204, 2026. 10.1287/moor.2023.0055.arxiv.org/abs/2303.00791
  18. [18]R. Fleiner, A. Ferkai and P. Biró. College admission problem for university dual education. In 2019 IEEE 17th World Symposium on Applied Machine Intelligence and Informatics (SAMI), pages 31–36. IEEE, 2019. 10.1109/SAMI.2019.8782783.DOI
  19. [19]D. Gale and L. S. Shapley. College admissions and the stability of marriage. The American Mathematical Monthly, 69(1):9–15, 1962. 10.2307/2312726.
  20. [20]T. Ishizuka and N. Kamiyama. On the complexity of stable fractional hypergraph matching. In 29th International Symposium on Algorithms and Computation (ISAAC 2018), volume 123 of LIPIcs, pages 11:1–11:12. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2018. 10.4230/LIPIcs.ISAAC.2018.11.DOI
  21. [21]S. Kintali, L. J. Poplawski, R. Rajaraman, R. Sundaram and S.-H. Teng. Reducibility among fractional stability problems. SIAM Journal on Computing, 42(6):2063–2113, 2013. 10.1137/120874655.
  22. [22]T. Király and J. Pap. Kernels, stable matchings, and Scarf’s lemma. RIMS Kôkyûroku Bessatsu, B23:131–145, 2010.
  23. [23]L. Lovász. Normal hypergraphs and the perfect graph conjecture. Discrete Mathematics, 2(3):253–267, 1972. 10.1016/0012-365X(72)90006-4.
  24. [24]E. J. McDermid and D. F. Manlove. Keeping partners together: Algorithmic results for the hospitals/residents problem with couples. Journal of Combinatorial Optimization, 19(3):279–303, 2010. 10.1007/s10878-009-9257-2.DOI
  25. [25]C. Ng and D. S. Hirschberg. Three-dimensional stable matching problems. SIAM Journal on Discrete Mathematics, 4(2):245–252, 1991. 10.1137/0404023.
  26. [26]T. Nguyen and R. Vohra. Near-feasible stable matchings with couples. American Economic Review, 108(11):3154–3169, 2018. 10.1257/aer.20141188.pubmed.ncbi.nlm.nih.gov/30375464
  27. [27]C. H. Papadimitriou. On the complexity of the parity argument and other inefficient proofs of existence. Journal of Computer and System Sciences, 48(3):498–532, 1994. 10.1016/S0022-0000(05)80063-7.DOI
  28. [28]A. Pass-Lanneau, A. Igarashi and F. Meunier. Perfect graphs with polynomially computable kernels. Discrete Applied Mathematics, 272:69–74, 2020. 10.1016/j.dam.2018.09.027.
  29. [29]E. Ronn. NP-complete stable matching problems. Journal of Algorithms, 11(2):285–304, 1990. 10.1016/0196-6774(90)90007-2.DOI
  30. [30]H. E. Scarf. The core of an N-person game. Econometrica, 35(1):50–69, 1967. 10.2307/1909383.DOI
  31. [31]A. Schrijver. Combinatorial Optimization: Polyhedra and Efficiency. Algorithms and Combinatorics, volume 24. Springer, 2003.
  32. [32]P. D. Seymour. Decomposition of regular matroids. Journal of Combinatorial Theory, Series B, 28(3):305–359, 1980. 10.1016/0095-8956(80)90075-1.DOI

Paper details

vlnc:W_ehq459sv
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Claude, ChatGPT

View statement
Looking for related papers…
Contents