0% found this document useful (0 votes)
6 views

2502.02503v1

This paper presents that near-feasible stable solutions exist in various NP-complete stable matching problems, such as Stable Hypergraph Matching and College Admission with Common Quotas, with minimal capacity modifications. An iterative rounding algorithm is introduced to adjust capacities systematically, ensuring the existence of integral stable solutions. The findings have significant implications for market design and allocation problems, demonstrating that small adjustments can lead to stable and implementable outcomes.

Uploaded by

mashitianxia1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

2502.02503v1

This paper presents that near-feasible stable solutions exist in various NP-complete stable matching problems, such as Stable Hypergraph Matching and College Admission with Common Quotas, with minimal capacity modifications. An iterative rounding algorithm is introduced to adjust capacities systematically, ensuring the existence of integral stable solutions. The findings have significant implications for market design and allocation problems, demonstrating that small adjustments can lead to stable and implementable outcomes.

Uploaded by

mashitianxia1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Near-Feasible Solutions to Complex Stable Matching

Problems
GERGELY CSÁJI (HUN-REN KRTK KTI)
arXiv:2502.02503v1 [cs.GT] 4 Feb 2025

In this paper, we demonstrate that in many NP-complete variants of the stable matching problem – such as
the Stable Hypergraph Matching problem and the College Admission problem with Common Quotas – a near-
feasible stable solution – that is, a solution which is stable, but may slightly violate some capacities – always
exists. Our results provide strong theoretical guarantees that even under complex constraints, stability can
be restored with minimal capacity modifications.
To achieve this, we present an iterative rounding algorithm that starts from a stable fractional solution
and systematically adjusts capacities to ensure the existence of an integral stable solution. This approach
leverages Scarf’s algorithm to compute an initial fractional stable solution, which serves as the foundation for
our rounding process. Notably, in the case of the Stable Fixtures problem, where a stable fractional matching
can be computed efficiently, our method runs in polynomial time.
These findings have significant practical implications for market design, college admissions, and other
real-world allocation problems, where small adjustments to institutional constraints can guarantee stable
and implementable outcomes.

Contents
Abstract 0
Contents 0
1 Introduction 1
1.1 Contributions 1
1.2 Related Work 2
2 Preliminaries 3
2.1 Stable Hypergraph Matching 4
2.2 College Admission with Common Quotas 5
2.3 Stable Multicommodity Flow 6
2.4 Scarf’s Lemma 6
3 Near-feasible Stable Hypergraph Matchings 6
3.1 Preparations 6
3.2 The Iterative Rounding algorithm 7
4 Near-feasible solutions for College Admission with Common Quotas 11
5 Near-feasible Stable Multicommodity Flow 13
6 Conclusions 16
References 16

Manuscript submitted for review to the 26th ACM Conference on Economics & Computation (EC'25).
Gergely Csáji (HUN-REN KRTK KTI) 1

1 Introduction
Stable matching problems are fundamental in economics and operations research, underpinning
key applications such as student admissions, job markets, kidney exchanges, and housing allo-
cations. These models provide a structured way to assign agents to institutions while ensuring
fairness and stability.
The stable matching problem was introduced by Gale and Shapley [1962], along with their cele-
brated polynomial-time algorithm to find a stable matching. Intuitively, stability means that there
is no contract, such that all participating agents prefer it to their current assignment and hence
have an incentive to deviate. Since its introduction, extensive generalizations have been studied,
encompassing more complex settings where additional constraints, such as quotas or preferences
over multiple partners, come into play. Some variants remain tractable, such as the stable room-
mates problem and stable fixtures problem [Irving, 1985, Irving and Scott, 2007], but many exten-
sions lead to computational intractability, including Stable Hypergraph Matching, College Admis-
sion (or Many-to-one Stable Matching) with Common Quotas, and the Stable Multicommodity
Flow problem, all of which are NP-hard.
In these NP-hard settings, stable solutions may not always exist. While Scarf’s Lemma [Scarf,
1967] guarantees the existence of a fractional stable solution, fractional allocations are often im-
practical in real-world applications. Thus, a natural approach is to slightly relax either stability
conditions or capacity constraints to ensure that a feasible stable solution always exists. In recent
years, this approach has gained traction through the concept of near-feasible stable solutions, as
studied by Dean et al. [2006] or Nguyen and Vohra [2018, 2019]. Their work demonstrated that in
settings such as stable matching with proportionality constraints, or the NP-complete Hospital-
Resident problem with couples, modifying capacities slightly guarantees the existence of a stable
matching.
In this paper, we build upon and extend these results, demonstrating that small capacity mod-
ifications can ensure the existence of stable solutions in a wider range of problems. Our results
highlight the practical significance of near-feasible stable matchings—offering guarantees that even
under complex quota constraints, stability can be restored with only minimal adjustments. This
insight has profound implications for policy design in college admissions, workforce allocation,
and market design, where slight modifications to institutional constraints can lead to stable, im-
plementable outcomes.

1.1 Contributions
Our main contributions establish existential and algorithmic guarantees for near-feasible stable so-
lutions in stable matching problems, extending the techniques introduced by [Nguyen and Vohra,
2018, 2019].
• Stable Hypergraph Matching with Vertex Capacities: We show that if the largest hyperedge
in the hypergraph has size ℓ, then modifying each capacity by at most ℓ − 1 ensures the
existence of a stable matching. This result holds even when ties are present. Furthermore,
the changes in the total sum of the capacities remain bounded by ℓ −1. For the Stable Fixtures
problem, where ℓ = 2, we provide a polynomial-time algorithm to compute such a modified
instance and its corresponding stable matching.
• College Admission with Common Quotas: We prove that when each college belongs to at most
ℓ subsets with common quotas, modifying each individual and common quota by at most
ℓ − 1 ensures the existence of a stable matching, even in the presence of ties. For example,
in Hungary common quotas arise from the faculty quotas imposed on their programs and
from the national quotas set for state-financed students in each subject (see [Ágoston et al.,
Gergely Csáji (HUN-REN KRTK KTI) 2

2022]), which implies ℓ = 3, and hence the maximum modification required in any capacity is
at most 2, which makes our result very practical and desirable in complex College Admission
mechanisms, where stability is essential.
• Stable Multicommodity Flow: We extend our analysis to network flow settings, showing that
when each commodity-specific capacity remains fixed, adjusting aggregate capacities by at
most 𝑘 −1 (where 𝑘 is the number of commodities) guarantees a stable solution. Furthermore,
the size of the flows can only change by strictly less than 1 and even the change in the size of
the aggregate flow can be bounded by 1, if we allow the change of 2 in the individual flows.
This result provides insights into designing robust, nearly stable network flow mechanisms
in practical applications such as traffic and logistics systems.
As in most cases, the parameters ℓ and 𝑘 are usually quite small, these results reinforce the prac-
tical viability of stable matching models in constrained settings, demonstrating that small, targeted
modifications to system parameters can ensure desirable outcomes. Our findings are particularly
relevant for economists and policymakers designing market mechanisms, offering constructive
methods to restore stability without major systemic changes.

1.2 Related Work


Stable matchings were introduced by Gale and Shapley [1962]. The Stable Fixtures problem, which
is a generalization of the Stable Matching problem to arbitrary graphs and vertex capacities, was
first considered by Irving and Scott [2007]. They showed that a stable solution can be found in
polynomial-time if one exists. Later, by a result of Tan [1991], it turned out that a stable half-
integral solution always exists and can be found in polynomial time. Using structural results of
stable half-matchings of [Tan, 1991], it is known that rounding this solution easily gives a new
instance, where every capacity changes by at most one, which admits a stable matching. However,
our iterative rounding algorithm will have the additional guarantee that the sum of the capacities
also changes by at most one, while a naive rounding approach cannot give a bound on this change.
Aharoni and Fleiner [2003] were the first to consider the generalization of stable matchings to
hypergraphs. They proved that a stable fractional matching always exists by using Scarf’s lemma.
The 3-dimensional variant of stable matching, which is a special case of Stable Hypergraph Match-
ing was proposed by Knuth [1997] and later investigated by Ng and Hirschberg [1991] and Huang
[2007]. They proved that the problem is NP-complete even in restricted settings.
The Many-to-one stable matching, or College-admission problem with common quotas was
studied by Biró et al. [2010]. They showed that it is NP-complete to decide if such an instance
admits a stable matching. However, if the common quotas form a laminar set, then they showed
that a stable matching always exists and can be found in polynomial-time. Ágoston et al. [2022]
gave several Integer Programming formulations for the problem as well as heuristics and provided
feasible ways to compute stable matchings in the presence of both common quotas and lower
qoutas.
The Stable Flow problem was introduced by Fleiner [2010]. He also gave a polynomial-time al-
gorithm to find a stable solution. Later, Király and Pap [2013] extended this notion for the multiple
commodities case. They introduced orderings on the edges too, that rank the possible commodi-
ties that can be forwarded on that edge. In their paper they proved that a stable fractional mul-
ticommodity flow always exists, however it is PPAD-hard to find one. Deciding whether a stable
multicommodity flow exists was shown to be NP-complete by Cseh and Matuschke [2019]. Csáji
[2022] showed that it remains NP-complete even with two commodities.
Allowing modifications in the capacities to achieve desirable stable outcomes has been studied
in several cases. Nguyen and Vohra [2018] studied the Hospital-Resident allocation problem in
Gergely Csáji (HUN-REN KRTK KTI) 3

the presence of couples, which is an NP-hard generalization of the many-to-one stable matching
problem, where some agents are allowed to have joint preferences over pairs of positions. This is
an NP-hard problem even in very restricted settings [Biró et al., 2014]. Dean et al. [2006] proved
that in a model, where couples only apply to positions at the same hospital, then a Gale-Shapley
like algorithm can find a stable matching in polynomial time by modifying the capacities by at
most one. Nguyen and Vohra [2018] showed that if we allow the capacities of the hospitals to be
changed by at most two, then we can guarantee the existence of a stable outcome using an iterative
rounding algorithm. Similarly, in a different paper, Nguyen and Vohra [2019] demonstrated that a
similar approach can find a stable matching satisfying certain proportionality constraints, if the
capacities are allowed to be perturbed. Chen and Csáji [2023] studied capacity modification in a
school choice framework, where the goal was to have matchings that are both stable and Pareto-
efficient, or stable and perfect (meaning every student is matched).
Scarf’s Lemma is a fixed-point theorem that was proven by Scarf [1967]. He also gave an algo-
rithm that finds such a solution, referred to as Scarf’s algorithm in the literature. This algorithm
has several applications to stable matchings literature, especially for showing existential results
[Aharoni and Fleiner, 2003, Biró and Fleiner, 2016, Király and Pap, 2013, Nguyen and Vohra, 2018,
2019].

2 Preliminaries
In this section, we formally define our models and introduce the necessary notation.
We use Z+ and R+ to denote the sets of nonnegative integers and nonnegative real numbers,
respectively. For an integer 𝑘 ∈ Z+ , we define [𝑘] as the set {1, 2, . . . , 𝑘}.
A hypergraph H = (𝑉 , E) consists of a set of vertices 𝑉 and a set of (hyper)edges E ⊆ 2𝑉 \ {∅},
where 2𝑉 denotes the power set of 𝑉 . A graph is a special case of a hypergraph in which each edge
contains exactly two vertices.
In economic markets, such as school-choice, resident-allocation, or team-formation, the set of
vertices corresponds to the set of agents, while the set of edges describes the acceptability relations
or possible contracts.
Given a set of quotas 𝑞 : 𝑉 → Z+ , we define a set of edges 𝑀 ⊆ E as a matching if no vertex
𝑣 ∈ 𝑉 appears in more than 𝑞(𝑣) edges of 𝑀. Formally,
|𝑀 (𝑣)| ≤ 𝑞(𝑣) for each 𝑣 ∈ 𝑉 ,
where 𝑀 (𝑣) denotes the set {𝑒 ∈ 𝑀 | 𝑣 ∈ 𝑒}.
A function 𝑀 : E → [0, 1] is called a fractional matching if it satisfies
Õ
𝑀 (𝑒) ≤ 𝑞(𝑣) for all 𝑣 ∈ 𝑉 .
𝑒 ∋𝑣
(For consistency, we can also view matchings as functions 𝑀 : E → {0, 1}.) A vertex 𝑣 is called
unsaturated in 𝑀 if the inequality is strict, i.e.,
Õ
𝑀 (𝑒) < 𝑞(𝑣),
𝑒 ∋𝑣
and saturated ifÍequality holds. Given a fractional matching 𝑀, we let 𝑀 (𝑣) : = {𝑒 ∈ E | 𝑀 (𝑒) > 0}
and |𝑀 (𝑣)| = 𝑀 (𝑒).
𝑒 ∋𝑣
The characteristic vector of a (fractional) matching 𝑀 is the vector 𝑥 ∈ R E , where 𝑥 [𝑒] = 𝑀 (𝑒).
A directed graph 𝐷 = (𝑉 , E) consists of a set of vertices 𝑉 and a set of directed arcs E ⊆ 𝑉 × 𝑉 .
Each arc 𝑢𝑣 ∈ E starts at vertex 𝑢 and ends at vertex 𝑣. For a vertex 𝑣, we denote the set of incoming
arcs by 𝜌 (𝑣) and the set of outgoing arcs by 𝛿 (𝑣).
Gergely Csáji (HUN-REN KRTK KTI) 4

In a directed graph 𝐷 = (𝑉 , E) with two distinguished vertices 𝑠, 𝑡 ∈ 𝑉 and a capacity function


𝑐 : E → Z+ , a function 𝑓 : E → R+ is called a flow if it satisfies:
(1) Kirchoff law: For every 𝑣 ∈ 𝑉 \ {𝑠, 𝑡 },
Õ Õ
𝑓 (𝑎) = 𝑓 (𝑎).
𝑎∈𝛿 (𝑣) 𝑎∈𝜌 (𝑣)

(2) Capacity constraint: For every 𝑎 ∈ E,


𝑓 (𝑎) ≤ 𝑐 (𝑎).
We refer to the tuple (𝐷, 𝑠, 𝑡, 𝑐) as a directed network.
In the multicommodity flow framework, we consider multiple commodities, indexed by 𝑗 ∈
[𝑘]. Each commodity has its own source-terminal pair (𝑠 𝑗 , 𝑡 𝑗 ) and a commodity-specific capacity
function 𝑐 𝑗 : E → Z+ . A collection of functions 𝑓 = (𝑓 1 , . . . , 𝑓 𝑘 ) is called a multicommodity flow
if:
(1) Each 𝑓 𝑗 is a valid flow in the network (𝐷, 𝑐 𝑗 , 𝑠 𝑗 , 𝑡 𝑗 ), and
(2) The total flow on any arc does not exceed its overall capacity, i.e.,
Õ
𝑓 (𝑎) := 𝑓 𝑗 (𝑎) ≤ 𝑐 (𝑎) for all 𝑎 ∈ E.
𝑗 ∈ [𝑘 ]

Multicommodity flows model scenarios where multiple independent flows compete for limited re-
sources, such as traffic routing in communication networks, logistics and supply chain distribution,
or scheduling in transportation systems.
A polyhedron is a set of points in R𝑛 defined by a finite number of linear inequalities of the form
𝑄𝑥 ≤ 𝑑, where 𝑄 is an 𝑚 × 𝑛 matrix and 𝑑 is an 𝑚-dimensional vector. A polytope is a bounded
polyhedron.
A row of a constraint matrix 𝑄 is called tight for a solution 𝑥 if the corresponding inequality
holds with equality, i.e., 𝑄 𝑖 𝑥 = 𝑑𝑖 . A solution satisfying a set of constraints tightly is said to be on
the corresponding face of the polyhedron.
An extreme point of a polyhedron is a point that cannot be expressed as a convex combination
of two other distinct points in the polyhedron. In other words, an extreme point is a vertex of the
polyhedron.
We proceed to define our central problems.

2.1 Stable Hypergraph Matching


First, we define the Stable Hypergraph Matching (shm) problem with ties and capacities. Let H =
(𝑉 , E) be a hypergraph, where each 𝑣 ∈ 𝑉 has a capacity 𝑞(𝑣) ∈ Z+ and a weak preference order
𝑣 over the hyperedges containing 𝑣. For a weak preference order 𝑣 , we use the notation 𝑒 ≻𝑣 𝑓
to denote that 𝑒 is strictly preferred to 𝑓 by 𝑣, 𝑒 ∼𝑣 𝑓 to denote that 𝑒 and 𝑓 are tied (or 𝑒 = 𝑓 ) and
𝑒 𝑣 𝑓 to denote that either 𝑒 ≻𝑣 𝑓 or 𝑒 ∼𝑣 𝑓 .
Definition 2.1. A fractional matching 𝑀 is blocked by a hyperedge 𝑓 if 𝑀 (𝑓 ) < 1 and, for every
𝑣 ∈ 𝑓 , either 𝑣 is unsaturated by 𝑀 or there exists an edge 𝑓𝑣 ∈ E such that 𝑣 ∈ 𝑓𝑣 , 𝑀 (𝑓𝑣 ) > 0, and
𝑓𝑣 ≺𝑣 𝑓 . Similarly, a matching 𝑀 is blocked by a hyperedge 𝑓 if 𝑓 ∉ 𝑀 and for each 𝑣 ∈ 𝑓 , either 𝑣
is unsaturated or there exists an 𝑓𝑣 ∈ 𝑀 such that 𝑣 ∈ 𝑓𝑣 and 𝑓𝑣 ≺𝑣 𝑓 .
Intuitively, blocking means that the hyperedge (e.g., a contract) is strictly better for each partici-
pating agent in it, who are already at full capacity. Hence, every in the hyperedge has an incentive
to deviate in this case.
Gergely Csáji (HUN-REN KRTK KTI) 5

Definition 2.2. A (fractional) matching 𝑀 is stable if it has no blocking (fractionally blocking)


edge.
An instance of shm is given by the tuple (H, 𝑞, (𝑣 ) 𝑣 ∈𝑉 ) The goal in shm is to find a stable
matching 𝑀.
Stability in hypergraph matchings models scenarios where no group of agents (represented as
hyperedges) has an incentive to deviate, ensuring stability in multi-agent allocation problems such
as group project assignments and research team formation. Stable hypergraph matching can also
incorporate several stable matching problems, including the Stable Fixtures problem, dual admis-
sion problems, where students apply to both university courses and internships at companies, as
well as the restricted case of the Hospital-Resident allocation problem with couples, given that no
couple submits applications to the same position.

2.2 College Admission with Common Quotas


The College Admission problem with Common Quotas (ca-cq) extends the classical college admis-
sion model by introducing quota constraints that apply across multiple colleges. We are given a set
of colleges C = {𝑐 1 , . . . , 𝑐𝑚 } and a set of students S = {𝑠 1 , . . . , 𝑠𝑛 }. Each college 𝑐 𝑖 has a quota 𝑞(𝑐 𝑖 )
and a weak preference order 𝑐𝑖 over acceptable students. Each student 𝑠𝑘 has a weak preference
order 𝑠𝑘 over acceptable colleges. These acceptability relations are modeled by a bipartite graph
𝐺 = (𝑉 ; E) with vertex set 𝑉 = S ∪ C.
Additionally, we are given sets of colleges 𝐶 1, . . . , 𝐶 𝑁 , each with a common quota of 𝑞(𝐶 𝑗 ). Each
𝐶 𝑗 is a subset of C, and a college may belong to multiple such sets. Each set 𝐶 𝑗 follows a weakmaster
preference list 𝐶 𝑗 , which is consistent with individual college preferences, that is, 𝑠𝑘 ≻𝑐𝑖 𝑠𝑘 ′ for
some 𝑐 𝑖 ∈ 𝐶 𝑗 , if and only if 𝑠𝑘 ≻𝐶 𝑗 𝑠𝑘 ′ and 𝑠𝑘 ∼𝑐𝑖 𝑠𝑘 ′ for some 𝑐 𝑖 ∈ 𝐶 𝑗 , if and only if 𝑠𝑘 ∼𝐶 𝑗 𝑠𝑘 ′ .
In a ca-cq instance, we say that a (fractional) matching 𝑀 is feasible if it also respects the
common quotas, that is, for every 𝐶 𝑗 , we have |𝑀 (𝐶 𝑗 )| ≤ 𝑞(𝐶 𝑗 ).
For convenience, it is easier to also think of the preferences ≻𝑠𝑘 over the colleges as preferences
over their incident edges in 𝐺. Since 𝑠𝑘 and 𝑐 𝑖 uniquely determine the edge {𝑠𝑘 , 𝑐 𝑖 } ∈ E, this is
unique and well-defined.
Definition 2.3. An edge 𝑒 = {𝑠𝑘 , 𝑐 𝑖 } ∈ E blocks a (fractional) matching 𝑀 if:
– |𝑀 (𝑠𝑘 )| < 1 or 𝑒 ≻𝑠𝑘 𝑒 ′ for some 𝑒 ′ = {𝑠𝑘 , 𝑐 𝑖 ′ } ∈ 𝑀 (𝑠𝑘 ) (for integral matchings, 𝑀 (𝑠𝑘 ) has at
Í
most one element),
– any set 𝐶 𝑗 containing 𝑐 𝑖 is either below its quota (i.e., |𝑀 (𝑐𝑙 )| < 𝑞(𝐶 𝑗 )) or has a student
Ð 𝑐𝑙 ∈𝐶 𝑗
𝑠𝑘 ′ ∈ 𝑀 (𝑐𝑙 ) assigned to some 𝑐𝑙 ∈ 𝐶 𝑗 such that 𝑠𝑘 ≻𝐶 𝑗 𝑠𝑘 ′ .
𝑐𝑙 ∈𝐶 𝑗

Intuitively, for integral matchings, blocking means that both the student strictly prefers to col-
lege to its current allocation, and for each set 𝐶 𝑗 the college is included in, either the student
can argue that the corresponding common quota is not reached, so there are empty seats left, or
otherwise a student worse than him is admitted there.
Definition 2.4. A (fractional) matching 𝑀 is stable if there is no blocking edge {𝑠𝑘 , 𝑐 𝑖 } to 𝑀.
Stability in college admissions ensures that no student and college prefer each other over their
current assignment, while maintaining global capacity constraints across multiple institutions.
Common quotas are often imposed in national university admission mechanisms, for example
by restricting the total number of students that can be admitted to each department, each university
and also across multiple institutions, such as limiting the total number of students admitted to a
specific major nationwide. Furthermore, there are usually different quotas for self-financed and
state-financed seats.
Gergely Csáji (HUN-REN KRTK KTI) 6

2.3 Stable Multicommodity Flow


The Stable Multicommodity Flow (smf) problem models competition among multiple commodi-
ties for network resources. Given a directed graph 𝐷 = (𝑉 , E) with sources 𝑠 1, . . . , 𝑠 𝑘 and sinks
𝑡 1 , . . . , 𝑡 𝑘 (one per commodity), each vertex 𝑣 ∈ 𝑉 has a weak order 𝑣𝑗 on its incident arcs (i.e.,
𝜌 (𝑣) ∪𝛿 (𝑣)) for each commodity 𝑗 . Each arc 𝑎 ∈ E has a weak order 𝑎 over commodities and inte-
gral capacities 𝑐 (𝑎) and 𝑐 𝑗 (𝑎), where 𝑐 (𝑎) bounds total flow and 𝑐 𝑗 (𝑎) bounds flow of commodity
𝑗 . Intuitively, the ranking 𝑣𝑗 represents an agent’s preference over which routes or companies he
prefers to send or recieve the given commodity, and the rankings 𝑎 represents the preferences
of the transporting agency over the commodities it is willing to deliver. For example, a transport
agency may prefer to deliver non-hazardous and non-perishable goods over those that pose logis-
tical challenges.
In such a model, the blocking structures that may arise, are walks. Here, a walk 𝑊 = (𝑣 1, 𝑎 1,
𝑣 2, . . . , 𝑎𝑙 −1 , 𝑣𝑙 ) denotes an alternating set of vertices and arcs, such that for all 𝑖 ∈ [𝑙 −1], 𝑎𝑖 = 𝑣 𝑖 𝑣 𝑖+1 .
Definition 2.5. A walk 𝑊 = (𝑣 1, 𝑎 1 , 𝑣 2, . . . , 𝑎𝑙 −1 , 𝑣𝑙 ) blocks a flow 𝑓 = (𝑓 1, . . . , 𝑓 𝑘 ) for commodity
𝑗 if:
(1) 𝑓 𝑗 < 𝑐 𝑗 (𝑎𝑖 ) for 𝑖 ∈ [𝑙 − 1], that is, every arc has available capacity for commodity 𝑗 ,
(2) 𝑣 1 = 𝑠 𝑗 or there exists some arc 𝑏 ∈ 𝛿 (𝑣 1 ) such that 𝑓 𝑗 (𝑏) > 0 and 𝑎 1 ≻𝑣1 𝑏, so 𝑣 1 can either
send more flow of commodity 𝑗 , or reroute some outgoing flow from a worse arc,
(3) 𝑣𝑙 = 𝑡 𝑗 or there exists some arc 𝑏 ∈ 𝜌 (𝑣𝑙 ) such that 𝑓 𝑗 (𝑏) > 0 and 𝑎𝑙 −1 ≻𝑣𝑙 𝑏, so 𝑣𝑙 can either
Í
send more flow of commodity 𝑗 , or reroute some incoming flow from a worse arc;

(4) if 𝑖 ∈ [𝑘 ] 𝑓 𝑗 (𝑎𝑖 ) = 𝑐 (𝑎𝑖 ), then there exists 𝑗 ′ ≠ 𝑗 such that 𝑓 𝑗 (𝑎𝑖 ) > 0 and 𝑗 ≻𝑎𝑖 𝑗 ′ , that is, if

an arc is saturated, then another commodity 𝑗 on 𝑎𝑖 is less preferred than 𝑗 .
Definition 2.6. A multicommodity flow 𝑓 is stable if no blocking walk exists for any commodity.
An instance of smf consists of a tuple (𝐷, (𝑠 𝑖 )𝑖 ∈ [𝑘 ], (𝑡 𝑖 )𝑖 ∈ [𝑘 ], 𝑐, (𝑐 𝑖 )𝑖 ∈ [𝑘 ], (𝑣𝑗 ) 𝑗 ∈ [𝑘 ],𝑣 ∈𝑉 , (𝑎 )𝑎∈𝐴 ).

2.4 Scarf’s Lemma


Finally, we state Scarf’s key Lemma.
Lemma 2.7 ([Scarf, 1967]). Let 𝑄 be an 𝑛×𝑚 nonnegative matrix, such that every column of 𝑄 has
a nonzero element and let 𝑞 ∈ R+n . Suppose that every row 𝑖 has a strict ordering ≻𝑖 on those columns 𝑗
for which 𝑄 𝑖 𝑗 > 0. Then there is an extreme point of {𝑄𝑥 ≤ 𝑑, 𝑥 ≥ 0}, that dominates every column
in some row, where we say that 𝑥 ≥ 0 dominates column 𝑗 in row 𝑖, if 𝑄 𝑖 𝑥 = 𝑑 [𝑖] and 𝑘 𝑖 𝑗 for all
𝑘 ∈ {1, . . . , 𝑚}, such that 𝑄 𝑖𝑘 𝑥𝑘 > 0. Also, this extreme point can be found algorithmically.
Scarf’s Lemma gives existential guarantees for fractional stable solutions in a large set of stable
matching problems.

3 Near-feasible Stable Hypergraph Matchings


First, we consider the Stable Hypergraph Matching problem.

3.1 Preparations
To begin with, suppose that our instance includes ties in some preference lists. Then, in the begin-
ning we break the ties in an arbitrary way. On one hand, the stable fractional matchings of this
new instance are stable for the original instance too, because if a hyperedge blocks a matching 𝑀
in the original instance, then it still blocks 𝑀 after the tie breaking. This holds because if 𝑒 ≻𝑣 𝑓
then 𝑒 and 𝑓 are not tied, so breaking the ties maintain that 𝑒 ≻𝑣 𝑓 . On the other hand, if we find
new 𝑞 ′ capacities, such that there is a stable matching 𝑀 with respect to the capacities 𝑞 ′ after the
Gergely Csáji (HUN-REN KRTK KTI) 7

tie-breaking, then the same matching is also stable with respect to the capacities 𝑞 ′ in the original
instance, by the same reasoning.
Therefore, we obtain that it is enough to work with strict preferences for our purposes. Hence,
in the remainder of this section, we suppose that all preference lists are strict.
We continue with describing how to obtain a stable fractional matching. To do this, for an
instance 𝐼 = (H, 𝑞, (≻𝑣 ) 𝑣 ∈𝑉 ) of shm (with strict preferences), we create a polyhedron satisfying
the conditions of Scarf’s lemma the following way.
First, we create a matrix 𝑄 that consists of the incidence matrix 𝐴 of the H with an additional
identity matrix at the bottom. Each row in 𝐴 corresponds to a vertex 𝑣 ∈ 𝑉 and each row in the
bottom identity matrix corresponds to a hyperedge 𝑒 ∈ E. Let us denote these rows by 𝐴𝑣 and 𝐼𝑒
respectively.
Let the bounding vector 𝑑 be defined such that it is the capacity 𝑞(𝑣) in vertex 𝑣’s row, and 1 in
the rows corresponding to the bottom identity matrix.
For the rows of the bottom identity matrix, there is only a single nonzero element, so their
preference over the nonzero entries is trivial. The strict preferences of the rows corresponding to
vertices 𝑣 ∈ 𝑉 are created according to 𝑣 (which we assumed to be strict). Note that since the
nonzero elements correspond exactly to the hyperedges containing 𝑣, this is well-defined.
It is straightforward to verify, that the characteristic vectors of the (fractional) stable matchings
of I are in a one-to-one correspondence with the dominating (not necessarily extreme) points of
the polyhedron given by {𝑥 ≥ 0 | 𝑄𝑥 ≤ 𝑑 } = {0 ≤ 𝑥 ≤ 1, 𝐴𝑥 ≤ 𝑞}. Recall that we say that 𝑥 ≥ 0
dominates column 𝑗 in row 𝑖, if 𝑄 𝑖 𝑥 = 𝑑 [𝑖] and 𝑘 𝑖 𝑗 for all 𝑘 ∈ {1, . . . , 𝑚}, such that 𝑄 𝑖𝑘 𝑥𝑘 > 0
and a point is dominating, if it dominates every column in at least one row.
Hence, we can find a stable fractional solution with Scarf’s algorithm.
Next, we argue that we can assume that all fractional stable matchings saturate every vertex
𝑣 ∈ 𝑉 , and hence we can consider the polyhedron P = {0 ≤ 𝑥 ≤ 1, 𝐴𝑥 = 𝑞} instead for Scarf’s
algorithm.

Claim 1. We can suppose that all fractional stable matchings in the starting instance 𝐼 satisfy
|𝑀 (𝑣)| = 𝑞(𝑣) for 𝑣 ∈ 𝑉 .
𝑞 (𝑣)
Proof. To prove the claim, for each vertex 𝑣 ∈ 𝑉 , we add hyperedges 𝑒 𝑣1, . . . , 𝑒 𝑣 that are
strictly worst for 𝑣 in this order. All these hyperedges contain the single vertex 𝑣. Let this new
hypergraph be H ′ = (𝑉 , E ′ ).
It is clear that in this new instance, any fractional stable matching saturates all vertices. If some
𝑣 ∈ 𝑉 is left unsaturated, then there exists some hyperedge 𝑒 𝑣𝑗 = {𝑣 } such that 𝑀 (𝑒 𝑣𝑗 ) < 1, so 𝑒 𝑣𝑗
blocks 𝑀, a contradiction.
What we have to show for our purposes is that if we find capacities 𝑞 ′ and a stable matching 𝑀
with respect to the capacities 𝑞 ′ , then deleting all hyperedges of the form 𝑒 𝑣𝑗 leads to a matching
𝑀 ′ that is stable in the original hypergraph H = (𝑉 , E) too with respect to the capacities 𝑞 ′ .
Suppose that this matching 𝑀 ′ admits a blocking edge 𝑒 ∈ E. As 𝑒 did not block 𝑀 in E ′ with
respect to 𝑞 ′ , there was a vertex 𝑣 ∈ 𝑉 , such that |𝑀 (𝑣)| = 𝑞 ′ (𝑣) and for each 𝑓 ∈ 𝑀 (𝑣), we had
𝑓 ≻𝑣 𝑒. If |𝑀 ′ (𝑣)| = 𝑞 ′ (𝑣) holds too, then we get that 𝑒 does not block by the previous observation.
Else, there was a hyperedge 𝑒 𝑖𝑣 with 𝑀 (𝑒 𝑖𝑣 ) > 0. However, by the construction, 𝑒 𝑖𝑣 ≺𝑣 𝑒, so we
cannot have 𝑓 ≻𝑣 𝑒 for all 𝑓 ∈ 𝑀 (𝑣), contradiction. 

3.2 The Iterative Rounding algorithm


We start with a structural observation.
Gergely Csáji (HUN-REN KRTK KTI) 8

Lemma 3.1. Let 𝑥 ∗ be the dominating solution found by running Scarf’s algorithm on {𝑥 ≥ 0 |
𝑄𝑥 ≤ 𝑞}. Let 𝑦 be an (integer vector such that, if 𝑥 ∗ [𝑒] = 0 or 1, then 𝑦 [𝑒] = 0 or 1, respectively. Fur-
𝐴𝑣𝑦 if 𝐴𝑣 𝑥 ∗ = 𝑞(𝑣)
thermore, let 𝑞 ′ (𝑣) = . Then the matching 𝑀 whose characteristic
max{𝑞(𝑣), 𝐴𝑣𝑦} otherwise
vector is 𝑦 is stable and feasible with respect to 𝑞 ′ .
Proof. By the definition of the capacities in 𝑞 ′ , it is immediate that 𝑀 respects all capacity
constraints.
Let us suppose for the contrary that 𝑀 is not stable. Then, there exists a hyperedge 𝑒 ∈ E that
blocks 𝑀.
Since 𝑥 ∗ was a dominating solution, it must have dominated column 𝑒 at some row. If it dom-
inated 𝑒 at row 𝐼𝑒 , then 𝑥 ∗ [𝑒] = 1 = 𝑦 [𝑒] = 𝑀 (𝑒), contradicting that 𝑒 ∉ 𝑀. Otherwise, it was
dominated at some row 𝐴𝑣 such that 𝑣 ∈ 𝑒. This implies that 𝐴𝑣 𝑥 ∗ = 𝑞(𝑣), so 𝐴𝑣𝑦 = 𝑞 ′ (𝑣), and
hence 𝑣 is saturated in 𝑀. Furthermore, for every 𝑓𝑣 ∈ E such that 𝑣 ∈ 𝑓𝑣 and 𝑥 ∗ [𝑓𝑣 ] > 0, 𝑓𝑣 was
weakly better for 𝑣 than 𝑒 (which implies either 𝑓𝑣 ≻𝑣 𝑒 or 𝑓𝑣 = 𝑒). However, then by the definition
of 𝑞 ′ , and that 𝑦 [𝑓 ] = 0, whenever 𝑥 ∗ [𝑓 ] = 0, we get that 𝑣 is saturated in 𝑀 and prefers every 𝑓𝑣
with 𝑣 ∈ 𝑓𝑣 (as 𝑒 ∉ 𝑀 by the assumption it blocks), we get that 𝑒 cannot block 𝑀, contradiction
again. 
Let ℓ ≥ 2 be the size of the largest hyperedge in H . That is, |𝑒 | ≤ ℓ for all 𝑒 ∈ E.
Our iterative rounding algorithm is described in Algorithm 1. First, it computes a dominating
Í
solution 𝑥 ∗ by Scarf’s algorithm and sets 𝑧 = 𝑥 ∗ . To bound the change in the aggregate capacity,
Í add an aggregate capacity row to the incidence matrix
we 𝐴, that is a row 𝑒 𝑥 [𝑒] · |𝑒Í| = 𝑞e(𝑉 ) =
Í By Claim
𝑣 𝑞(𝑣). 1, we can assume that every row in 𝑥 ∗ is tight, so 𝑥 ∗ satisfies this as 𝑒 ∈ E 𝑥 ∗ [𝑒] ·
|𝑒 | = 𝑣 ∈𝑉 𝐴𝑣 𝑥 = 𝑞e(𝑉 ).

Then, until our vector is not integral, we check whether there is a row we can safely remove
without worrying about the capacities being violated too much in the future. For this, we delete a
row 𝐴𝑣 , if 𝐴𝑣 ( ⌈𝑧⌉ − ⌊𝑧⌋) ≤ ℓ and if there is no such row, but there is only one remaining fractional
component, then we delete the aggregate capacity row.
We will show that this algorithm is guaranteed to terminate.
Theorem 3.2. For any instance of shm, Í Algorithm
Í ′1 gives Í a vector 𝑞 ′ and a matching 𝑀 such that
|𝑞 ′ (𝑣)
− 𝑞(𝑣)| ≤ ℓ − 1 for all 𝑣 ∈ 𝑉 , 𝑞(𝑣) ≤ 𝑞 (𝑣) ≤ 𝑞(𝑣) + ℓ − 1, such that 𝑀 is a stable
matching with respect to capacities 𝑞 ′ . Furthermore, after finding the initial dominating point 𝑥 ∗ in
P with Scarf’s algorithm, the running time is polynomial.

Í Í
Proof. We start by showing the bounds on 𝑞 ′ . By the construction of the algorithm for 𝑞 ′ , we
Í
get that 𝑞 ′ (𝑣) = 𝐴𝑣 𝑧 for the final vector 𝑧Í ∈ Z+E and also that 𝑣 ∈𝑉 𝑞 ′ (𝑣) = 𝑒 ∈ E 𝑧 [𝑒] · |𝑒 |. By
Claim 1 it is also true for 𝑞 and 𝑥 ∗ , that is 𝑣 ∈𝑉 𝑞(𝑣) = 𝑒 ∈ E 𝑥 ∗ [𝑒] · |𝑒 |.
As we only delete row 𝐴𝑣 if it satisfies 𝐴𝑣 ( ⌈𝑧⌉ − ⌊𝑧⌋) ≤ ℓ and if 𝑧 has non-integer components
then 𝐴𝑣 ( ⌈𝑧⌉ − 𝑧) ≥ 1 and 𝐴𝑣 (𝑧 − ⌊𝑧⌋) ≥ 1 (using 𝐴𝑣 𝑧 = 𝑞(𝑣) ∈ Z+ ), it follows that 𝐴𝑣 𝑧 can only
increase or decrease by at most ℓ − 1 during the algorithm (since every component of 𝑧 can only
decrease until 0 or increase until 1), so the final 𝑞 ′ (𝑣) capacities will only change by at most ℓ − 1
Í
too.
Í Í
By the fact that in each iteration we always choose 𝑧, such that it maximizes 𝑒 ∈ E 𝑧 [𝑒] · |𝑒 |, we
have that 𝑣 ∈𝑉 𝑞(𝑣) ≤ 𝑣 ∈𝑉 𝑞 ′ (𝑣) by induction on the number of iterations. Furthermore, as it can
Í
only get strictly larger if we remove the aggregate capacity constraint. This happens only if there
is exactly one 𝑧 [𝑒] component that is fractional, let it be 𝑧 [𝑓 ]. This implies that 𝑒 ∈ E 𝑧 [𝑒] · |𝑒 | only
Í
change by strictly Í|𝑓 | after this, and since it integral in both the start and the end, this
less than
implies that 𝑣 ∈𝑉 𝑞 ′ (𝑣) ≤ 𝑣 ∈𝑉 𝑞(𝑣) + ℓ − 1.
Gergely Csáji (HUN-REN KRTK KTI) 9

ALGORITHM 1: Iterative Rounding for shm


Input: An instance of shm.
Output: A stable matching 𝑀 with respect to some capacities 𝑞 ′ satisfying |𝑞 ′ (𝑣) − 𝑞(𝑣)| ≤ ℓ − 1 and
Í
| 𝑣 ∈𝑉 𝑞 ′ (𝑣) − 𝑞(𝑣)| ≤ ℓ − 1.
Run Scarf’s algorithm on P = {0 ≤ 𝑥 ≤ 1, 𝐴𝑥 = 𝑞} and obtain a dominating solution 𝑥 ∗ .
Initialize 𝑧 = 𝑥 ∗ .
Í Í
Add an aggregate capacity row to the incidence matrix 𝐴, that is a row 𝑒 𝑥 [𝑒] · |𝑒 | = 𝑞e(𝑉 ) = 𝑣 𝑞(𝑣).
while 𝑧 is not integral do
if there is a row 𝑣 such that 𝐴𝑣 (⌈𝑧⌉ − ⌊𝑧⌋) ≤ ℓ then
Delete it.
end
else if there is no such row but there are at most one 𝑧 [𝑒] component that is fractional then
Delete the aggregate capacity constraint.
end
Í
Consider the polyhedron given by the remaining constraints of P along with the conditions
𝑥 [𝑒] = 𝑧 [𝑒] if 𝑧 [𝑒] is integer, and find the extreme point 𝑧 ∗ that maximizes 𝑒 ∈𝐸𝐸 𝑧 [𝑒] · |𝑒 |.
Update 𝑧 := 𝑧 . ∗
end
Output the obtained matching 𝑀 corresponding to 𝑧 and the 𝑞 ′ capacities as defined in Lemma 3.1.

The stability of the matching 𝑀 given by the output 𝑧 with respect to the 𝑞 ′ capacities defined
as in Lemma 3.1 is immediate, since the rounding procedure satisfies the requirements of Lemma
3.1.
Hence it only remains to show that the algorithm terminates, that is, if there was no row that
could be deleted in the while loop, then 𝑧 already had to be integral.
Let us suppose the contrary. If all 𝐴𝑣 rows and the aggregate capacity row have been eliminated,
then the remaining identity matrix is totally unimodular and the bounding vector is integral, so all
extreme points are integer valued (see e.g., [Schrijver, 1998]), which would mean that 𝑧 is integral,
contradiction. Hence, let us assume that there is such a remaining row. We have two cases:
Case a). The aggregate capacity row has been eliminated.
If the aggregate capacity row has been eliminated, then we know that there is at most 1 fractional
component of 𝑧 remaining. However, if there are no 𝐴𝑣 rows such that 𝐴𝑣 ( ⌈𝑧⌉ − ⌊𝑧⌋) ≤ ℓ, then
𝐴𝑣 ( ⌈𝑧⌉ − ⌊𝑧⌋) ≥ ℓ + 1 for any remaining row and from our assumption, we know that there is
at least one. This means that, since each element of 𝐴 is 0 or 1, there has to be at least ℓ + 1 > 1
fractional components, as ⌈𝑧 [𝑒]⌉ − ⌊𝑧 [𝑒]⌋ is only nonzero if 𝑧 [𝑒] is fractional, contradiction.
Case b): The aggregate capacity row has not been eliminated.
For simplicity, let us call 𝐵 the matrix consisting of 𝐴 and the aggregate capacity row at the
bottom and 𝑟 be the vector which is 𝑞 appended by 𝑞e(𝑉 ). Let 𝐵 = (𝐵 ′ , 𝐵 ′′ ) and 𝑧 = (𝑧 ′ , 𝑧 ′′ ), where
𝐵 ′′ consists of the columns of 𝐵, where 𝑧 [𝑒] is fractional and 𝐵 ′ consists columns of 𝐴 whose
𝑧 [𝑒] components are integral. Similarly, 𝑧 ′ corresponds to the fractional components and 𝑧 ′′ to the
integral components of 𝑧, respectively.
Since we can assume that 𝐵𝑥 = 𝑟 in the beginning by Claim 1, we get that 𝐵 ′𝑧 ′ = 𝑟 − 𝐵 ′′𝑧 ′′ ∈ Z𝑉 .
We will use the following well known result ([Schrijver, 1998]):

Lemma 3.3. Let 𝑦 be an everywhere strictly positive extreme point of {𝑄𝑥 ≤ 𝑑, 𝑥 ≥ 0}. Then the
number of variables equals the maximum number of linearly independent tight rows (𝑄 𝑖𝑦 = 𝑞[𝑖]) of
𝑄.
Gergely Csáji (HUN-REN KRTK KTI) 10

We use this lemma with


𝐵′ 𝑟 − 𝐵 ′′𝑧 ′′
© ′ª © ′′ ′′ ª
𝑄 = ­−𝐵 ® , 𝑑 = ­𝐵 𝑧 − 𝑟 ®
« 𝐼 ¬ « 1 ¬
and 𝑧 ′ . Since 𝑧 is an extreme point of {𝐵𝑥 = 𝑞, 0 ≤ 𝑥 ≤ 1}, 𝑧 ′ is an everywhere positive extreme
point of {𝐵 ′ 𝑥 = 𝑞 − 𝐵 ′′𝑧 ′′ , 0 ≤ 𝑥 ≤ 1} = {𝑄𝑥 ≤ 𝑑, 𝑥 ≥ 0}. Indeed, if 𝑧 ′ = 𝜆𝑧 1′ + (1 − 𝜆)𝑧 2′
for some 𝜆 ∈ [0, 1] and 𝑧 1′ , 𝑧 2′ ∈ {𝑄𝑥 ≤ 𝑑, 𝑥 ≥ 0}, then 𝑧 = 𝜆(𝑧 1′ , 𝑧 ′′ ) + (1 − 𝜆) (𝑧 2′ , 𝑧 ′′ ), with
(𝑧 1′ , 𝑧 ′′ ), (𝑧 2′ , 𝑧 ′′ ) ∈ {𝐵𝑥 = 𝑞, 0 ≤ 𝑥 ≤ 1}, contradicting that 𝑧 is extreme. Observe that because 𝑧 is
everywhere fractional, there cannot be any tight rows at the bottom identity matrix.
Now we show that the number of linearly independent rows of 𝑄 cannot be equal to the number
of variables, which is equal to the number of components of 𝑧 ′ . Note that the number of linearly
independent tight rows of 𝑄 is just the number of linearly independent rows of 𝐵 ′ .
Give each 𝑧 ′ [𝑒] component one credit. Then redistribute 𝑧 ′ [𝑒]’s credit to the rows of 𝑄 the
1 1
following way: if 𝑒 = {𝑣 1, .., 𝑣 𝑘 }, then give 𝑘+1 credit to 𝐴𝑣1 , .., 𝐴𝑣𝑘 and 𝑘+1 to 𝐼𝑒 . If there is no 𝐴𝑣
row left, then 𝐵 consists only of the aggregate capacity row, and we know there are at least 2
fractional variables, so two components of 𝑧 ′ , contradiction. Otherwise, there is an 𝐴𝑣 row with
𝐴𝑣 ( ⌈𝑧⌉ − ⌊𝑧⌋) ≥ ℓ + 1, so there are at least ℓ + 1 fractional components of 𝑧, so ℓ + 1 components
of 𝑧 ′ .
First, suppose there are only ℓ + 1. Then, by Lemma 3.3, there must be exactly ℓ + 1 independent
rows in 𝐵 ′ , and only one of them can be the aggregate capacity row, so there are at least ℓ ≥ 2
such rows of the form 𝐴𝑣 . Also, because we cannot eliminate any of them, 𝐴𝑣 ( ⌈𝑧⌉ − ⌊𝑧⌋) ≥ ℓ + 1
for each of them. This can only happen if there is a 1 in every column in every 𝐴𝑣 row meaning
they are not linearly independent, contradiction.
Hence, there are at least ℓ + 2 fractional components in 𝑧. This means, that the 𝐼𝑒 rows together
1 1
got at least ℓ + 2 · ℓ+1 > 1 credits. However, each 𝐴𝑣 row got at least ℓ+1 · (ℓ + 1) = 1 credit too
′ ′ ′
by 𝐴𝑣 ( ⌈𝑧⌉ − ⌊𝑧⌋) ≥ ℓ + 1 (and so 𝐴𝑣 ( ⌈𝑧 ⌉ − ⌊𝑧 ⌋) ≥ ℓ + 1), so together with the aggregate capacity
row they still got strictly more than 1 token on average. Therefore, the number of components of
𝑧 ′ has to be strictly more than the number of rows, contradiction.
Hence, we obtained that if we cannot eliminate any row, then that necessarily means that 𝑧 is
integral.
Finally, we show that the algorithm takes polynomial-time to terminate after the initial 𝑥 ∗ so-
lution has been computed. This is because in each iteration, at least one of the rows is deleted, so
there are at most |𝑉 | iterations. Also, each iteration consists of checking some properties of 𝑧 and
solving an LP, which can be done in polynomial time. 

Since in most practical applications of shm, hyperedges tend to be small, our result implies that
stability can be ensured by only slight modifications in the capacities.
In the case of the Stable Fixtures problem with ties, which is the restriction of shm to graphs,
we can replace Scarf’s algorithm by Tan’s algorithm [Tan, 1991] to obtain a fractional dominating
solution 𝑥 ∗ in polynomial time. Hence, we obtain the following.
Theorem 3.4. There is a polynomial-time algorithm that, for a given instance of the Stable Fixtures
Í Í ′ Í
problem with ties, returns a modified capacity vector 𝑞 ′ and a matching 𝑀 such that |𝑞 ′ (𝑣) −𝑞(𝑣)| ≤ 1
for all 𝑣 ∈ 𝑉 , 𝑞(𝑣) ≤ 𝑞 (𝑣) ≤ 𝑞(𝑣) + 1 and 𝑀 is stable with respect to the 𝑞 ′ capacities.
𝑣 ∈𝑉 𝑣 ∈𝑉 𝑣 ∈𝑉

We remark that in the Stable Fixtures case, it is a well-known result that there exists capacities
𝑞 ′ (𝑣), 𝑣 ∈ 𝑉 such that |𝑞 ′ (𝑣) − 𝑞(𝑣)| ≤ 1 such that there is a stable matching with respect to the
capacities 𝑞 ′ (see e.g., [Biró and Csáji, 2024]), but our algorithm has the additional benefit of only
Gergely Csáji (HUN-REN KRTK KTI) 11

changing the sum of the capacities by at most one too (there was no previous approach that could
also guarantee this).

4 Near-feasible solutions for College Admission with Common Quotas


In this section we proceed to the College Admission with Common Quotas (ca-cq) problem.
Again, by analogous arguments as in the previous section, by tie-breaking we can suppose that
the preferences are strict for our purposes.
Let us suppose that each college is in at most ℓ sets with a common quota, (recall that for each
college 𝑐 𝑖 , we assume that there exists a set {𝑐 𝑖 } only containing 𝑐 𝑖 , so ℓ ≥ 1).
Again, we start by showing how to find a stable fractional solution with Scarf’s algorithm. Let
the bipartite graph corresponding to the instance be 𝐺 = (S ∪ C, E), where the edges 𝑒 ∈ E
represent the acceptable student-college pairs {𝑠 𝑗 , 𝑐 𝑖 }.
We create a matrix 𝑄, by adding a row for each college set 𝐶 𝑗 , 𝑗 ∈ 𝑁 with a common quota 𝑞(𝐶 𝑗 )
and also for each student 𝑠 𝑗 ∈ S, and a column for each edge 𝑒 ∈ 𝐸. There is a 1 in row 𝐶 𝑗 , column
𝑒 = {𝑠𝑘 , 𝑐 𝑖 }, if and only if 𝑐 𝑖 ∈ 𝐶 𝑗 , otherwise the corresponding entry is 0. There is a 1 in row 𝑠𝑘 ,
column 𝑒 = {𝑠 𝑗 , 𝑐 𝑖 } if and only if 𝑠𝑘 = 𝑠 𝑗 , otherwise the entry is 0.
The strict rankings of the rows are inherited from the corresponding master list/preference list
with the addition that for a row 𝐶 𝑗 , if two columns have the same student 𝑠𝑘 , then 𝐶 𝑗 ranks these
two columns according to the student 𝑠𝑘 ’s preferences. That is, for 𝑐 𝑖 , 𝑐 𝑗 ∈ 𝐶𝑙 and 𝑠𝑘 , 𝑠𝑝 ∈ S, row
𝐶𝑙 prefers {𝑠𝑘 , 𝑐 𝑖 } to {𝑠𝑝 , 𝑐 𝑗 } if and only if 𝑠𝑘 ≻𝐶𝑙 𝑠𝑝 or 𝑠𝑘 = 𝑠𝑝 and 𝑐 𝑖 ≻𝑠𝑘 𝑐 𝑗 .
The bounding vector 𝑑 is defined by setting it to 𝑞(𝐶 𝑗 ) for a row 𝐶 𝑗 and 1 for a row 𝑠𝑘 . The
obtained polyhedron {𝑄𝑥 ≤ 𝑑, 𝑥 ≥ 0} with the created rankings satisfies the conditions of Scarf
Lemma.

Lemma 4.1. Let 𝑥 ∗ be the dominating solution found by running Scarf’s algorithm on {𝑄𝑥 ≤ 𝑑, 𝑥 ≥
0}. Let 𝑦 ≥ 0 be an integer vector such that:
(1) If 𝑥 ∗ [𝑒] = 0, then 𝑦 [𝑒] = 0,
(2) If 𝑄 𝑠𝑘 𝑥 ∗ = 1, then 𝑄 𝑠𝑘 𝑦 = 1, otherwise 𝑄 𝑠𝑘 𝑦 ≤ 1.
(
′ 𝑄𝐶 𝑗 𝑦 if 𝑄𝐶 𝑗 𝑥 ∗ = 𝑞(𝐶 𝑗 )
Furthermore let 𝑞 (𝐶 𝑗 ) = . Then, the matching 𝑀 given by
max{𝑞(𝐶 𝑗 ), 𝑄𝐶 𝑗 𝑦} otherwise
its characteristic vector 𝑦 is stable and feasible with respect to 𝑞 ′ .

Proof. First note that by 𝑄 𝑠𝑘 𝑥 ∗ ≤ 1, we also have that 𝑥 ∗ ≤ 1. Hence, the feasibility of 𝑀 follows
trivially from the definition of 𝑞 ′ .
Let us suppose that 𝑀 is not stable. Then there exists a blocking edge 𝑒 = {𝑠𝑘 , 𝑐 − 𝑖}. Since 𝑥 ∗
was a dominating solution, it must have dominated column 𝑒 at some row.
If 𝑥 ∗ dominated it in row 𝑠𝑘 , then 𝑄 𝑠𝑘 𝑥 ∗ = 1 and for each 𝑓 = {𝑠𝑘 , 𝑐 𝑖 ′ }, with 𝑥 ∗ [𝑓 ] > 0, it holds
that 𝑐 𝑖 ′ 𝑠𝑘 𝑐 𝑖 . By the two conditions on 𝑦, 𝑠𝑘 is assigned in 𝑀 and to a college with 𝑥 ∗ [{𝑠𝑘 , 𝑐 𝑗 }] > 0,
so 𝑒 does not block, contradiction.
If 𝑒 was dominated at some row 𝐶 𝑗 of 𝑄, then 𝑐 𝑖 ∈ 𝐶 𝑗 , and this means that 𝑄𝐶 𝑗 𝑥 ∗ = 𝑞(𝐶 𝑗 ) and
for each 𝑠𝑘 ′ and 𝑐 𝑖 ′ ∈ 𝐶 𝑗 with 𝑥 ∗ [{𝑠𝑘 ′ , 𝑐 𝑖 ′ }] > 0, we have that 𝑠𝑘 ′ 𝐶 𝑗 𝑠𝑘 . Hence, by the definition
of 𝑞 ′ and the first condition on 𝑦, 𝐶 𝑗 is saturated with weakly better students than 𝑠𝑘 (meaning 𝑠𝑘
can be at some other college in 𝐶 𝑗 than 𝑐 𝑖 ) and if 𝑠𝑘 is in 𝐶 𝑗 , then he is at a better college than 𝑐 𝑖
by the definition of the row rankings, so 𝑒 does not block, contradiction. 

We proceed to describe our iterative rounding algorithm, illustrated in Algorithm 2.


The idea is similar. We first find a dominating solution 𝑥 ∗ using Scarf’s algorithm and set 𝑧 = 𝑥 ∗ .
Gergely Csáji (HUN-REN KRTK KTI) 12

ALGORITHM 2: Iterative Rounding for ca-cq


Input: An instance of ca-cq.
Output: A stable matching 𝑀 with respect to some capacities 𝑞 ′ satisfying |𝑞(𝐶 𝑗 ) − 𝑞 ′ (𝐶 𝑗 )| ≤ 2ℓ − 1 for
all 𝐶 𝑗 ∈ {𝐶 1 . . . , 𝐶 𝑁 }.
Run Scarf’s algorithm on P = {𝑄𝑥 ≤ 𝑑, 𝑥 ≥ 0} and obtain a dominating solution 𝑥 ∗ .
Initialize 𝑧 = 𝑥 ∗ .
while 𝑧 is not integral do
if there is a non-tight row 𝐶 𝑗 , such that 𝑄𝐶 𝑗 (⌈𝑧⌉ − ⌊𝑧⌋) ≤ 2ℓ − 1 then
Delete it.
end
else if there is a tight row 𝐶 𝑗 , such that 𝑄𝐶 𝑗 (⌈𝑧⌉ − ⌊𝑧⌋) ≤ 2ℓ then
Delete it.
end
Consider the polyhedron given by the remaining constraints of P along with the conditions
𝑥 [𝑒] = 𝑧 [𝑒] if 𝑧 [𝑒] is integer, and 𝑄𝑠𝑘 𝑧 = 1, if 𝑄𝑠𝑘 𝑥 ∗ = 1. Then, find the extreme point 𝑧 ∗ .
Update 𝑧 := 𝑧 ∗ .
end
Output the obtained matching 𝑀 corresponding to 𝑧 and the 𝑞 ′ capacities as defined in Lemma 4.1.

Theorem 4.2. For any instance of ca-cq, Algorithm 2 finds 𝑞 ′ (𝐶 𝑗 ) capacities, such that |𝑞(𝐶 𝑗 ) −
𝑞 ′ (𝐶 𝑗 )| ≤ 2ℓ − 1 for all set of colleges 𝐶 𝑗 ∈ {𝐶 1 . . . , 𝐶 𝑁 }, and a stable and feasible matching 𝑀, with
respect to the 𝑞 ′ capacities. Furthermore, after finding the initial solution 𝑥 ∗ with Scarf’s algorithm,
the running time is polynomial.

Proof. By the definition of the quotas 𝑞 ′ , it is clear that 𝑀 gives a feasible matching.
We proceed to proving the bounds on 𝑞 ′ . Note that we only delete rows if they satisfy 𝑄𝐶 𝑗 ( ⌈𝑧⌉ −
⌊𝑧⌋) ≤ 2ℓ − 1 or 𝑄𝐶 𝑗 ( ⌈𝑧⌉ − ⌊𝑧⌋) ≤ 2ℓ, if 𝑄𝐶 𝑗 𝑧 = 𝑞(𝐶 𝑗 ). Also, in the latter case, if 𝑧 has non-integer
coordinates, where there is a 1 in row 𝑄𝐶 𝑗 , then both 𝑄𝐶 𝑗 ( ⌈𝑧⌉ − 𝑧) ≥ 1 and 𝑄𝐶 𝑗 (𝑧 − ⌊𝑧⌋) ≥ 1 as
they are both positive integers, we get that 𝑄𝐶 𝑗 𝑧 can only increase or decrease by at most 2ℓ − 1
during the algorithm. Therefore, the 𝑞 ′ (𝐶 𝑗 ) capacities only change by at most 2ℓ − 1.
The stability of the matching 𝑀 given by the output 𝑧 with respect to the capacities 𝑞 ′ defined
as in Lemma 4.1 is immediate, since the rounding procedure satisfies the requirements of Lemma
4.1.
Hence, it only remains to show that the algorithm terminates, that is, if there was no row that
could be deleted in the while loop, then 𝑧 already had to be integral.
Let us suppose the contrary. If no row 𝑄𝐶 𝑗 remains, then the remaining matrix satisfies that
there is only one nonzero element in each column 𝑒 = {𝑠𝑘 , 𝑐 𝑖 } (in the row 𝑄 𝑠𝑘 ), that is a 1, so the
remaining matrix is TU. Hence, the extreme point 𝑧 must already have been integral, contradiction.
Hence, assume that there are remaining still 𝑄𝐶 𝑗 rows in the remaining matrix.
Let 𝑄 = (𝑄 ′, 𝑄 ′′ ) and (𝑧 ′ , 𝑧 ′′ ), where 𝑄 ′′ and 𝑧 ′′ correspond to the fractional components of 𝑧,
while 𝑄 ′′ and 𝑧 ′′ correspond to the integral components of 𝑧. Furthermore, let 𝑑 ′ = 𝑑 − 𝑄 ′′𝑧 ′′ . It
follows that 𝑄 ′𝑧 ′ ≤ 𝑑 ′ . Also, if no nonzero element remains in a row of 𝑄 ′ , then we delete it from
𝑄 ′ and 𝑑 ′ , as it is redundant.
We use Lemma 3.3 with 𝑄 ′ and 𝑑 ′ and the polyhedron {𝑄 ′ 𝑥 ≤ 𝑑 ′, 𝑥 ≥ 0}. Since 𝑧 is an extreme
point of {𝑄𝑥 ≤ 𝑑, 𝑥 ≥ 0}, 𝑧 ′ is an everywhere positive extreme point of {𝑄 ′ 𝑥 ≤ 𝑑 ′, 𝑥 ≥ 0}.
Now, we show that the number of linearly independent tight rows of {𝑄 ′ 𝑥 ≤ 𝑏, 𝑥 ≥ 0} cannot
be equal to the number of variables, that is, the number of components of 𝑧 ′ . First of all, as 𝑧 ′ is
everywhere positive, only rows in 𝑄 ′ can be tight.
Gergely Csáji (HUN-REN KRTK KTI) 13

Give each 𝑧 ′ [𝑒] component one credit. Then redistribute 𝑧 ′ [𝑒]’s credit to the rows of 𝑄 ′ the
following way: if 𝑒 = {𝑠𝑘 , 𝑐 𝑖 }, and 𝑐 𝑖 is included in 𝑘 ≤ ℓ sets with a common quota, then give 21 + 𝜀
credit to 𝑄 𝑠𝑘 and 2𝑘1 − 𝑘𝜀 to each 𝑄𝐶 𝑗 with 𝑐 𝑖 ∈ 𝐶 𝑗 , where 𝜀 is a sufficiently small number, such that
(2ℓ + 1) ( 2ℓ1 − 𝜀ℓ ) > 1.
Then, each tight row 𝑄 𝑠′𝑘 𝑧 ′ = 1 must receive tokens from at least two columns, hence it gets
2( 21 + 𝜀) > 1 tokens. As we cannot eliminate the row 𝑄𝐶 𝑗 for any remaining 𝐶 𝑗 , we get that each
tight 𝑄𝐶 𝑗 row must have at least 2ℓ +1 corresponding fractional components by 𝑄𝐶 𝑗 ( ⌈𝑧⌉−⌊𝑧⌋) > 2ℓ,
so they get tokens from at least 2ℓ + 1 columns. By the choice of 𝜀, this implies that they get strictly
more than 1 token too. Therefore, we get that each binding row must receive strictly more than
one token, so the number of linearly independent binding rows cannot be equal to the number
of components of 𝑧 ′ , contradiction. Hence, if we cannot eliminate any row, then that necessarily
means that 𝑧 is integral.
Finally, we show that the algorithm takes polynomial time to terminate after the initial 𝑥 ∗ so-
lution has been computed. This is because in each iteration, at least one of the rows is deleted, so
there is at most ℓ𝑚 iterations. Also, each iteration consists of checking some properties of 𝑧 and
solving an LP, which can be done in polynomial time. 
We note that in most College Admission mechanisms, ℓ is quite small, i.e. at most 3 or 4. This
is because such quotas usually only arise from restricting the total number of students that can
be admitted to each department, each university and each specific major nationwide. Therefore,
in such cases, our results imply that with only a very slight modification in the quotas, a stable
solution can be guaranteed.

5 Near-feasible Stable Multicommodity Flow


Finally, we study the stable multicommodity flow framework. We give a simple algorithm that
finds new capacities, that are close to the original ones, such that we can find an integer stable
multicommodity flow with respect to the new capacities. Furthermore, this flow will be almost the
same size as the original one, it can only change by less than one. Similarly to the other problems,
as Király and Pap [2013] proved, an integer stable multicommodity flow need not exist, even if
every capacity is an integer.
Similarly, as in the previous cases, we claim that we can suppose that the preferences are strict.
Indeed, if they are not strict, then by breaking the ties an arbitrary way, we can find a stable
fractional solution and then round it to a near-feasible stable solution. Then, that same solution
will be stable in the original instance too. This is again because if a (fractionally) blocking walk 𝑊
blocks a flow 𝑓 in the original instance, then it still must (fractionally) block 𝑓 after the tie-breaking
too as strictly preferred relations remain strictly preferred.
First of all, as shown by Csáji [2022], the Stable Multicommodity Flow problem can be reduced
to an instance of Scarf’s lemma, and hence we can find a stable fractional multicommodity flow to
begin with by Scarf’s algorithm.
We start with a simple claim.
Claim 2. If a flow 𝑓 𝑗 contains a fractional component 𝑓 𝑗 (𝑎), then there exists a cycle or an 𝑠 𝑗 𝑡 𝑗
path (in the undirected sense) such that every arc in them has fractional 𝑓 𝑗 values.
Proof. Consider the undirected graph 𝐺 corresponding to our directed network 𝐷, which con-
tains an edge {𝑢, 𝑣 } for all arcs 𝑢𝑣 ∈ 𝐴.
Let us consider the following greedy approach: we start from an edge that has fractional 𝑓 𝑗 (𝑒 1 )
(by abuse of notation 𝑓 𝑗 (𝑒) refers to 𝑓 𝑗 (𝑎) for the corresponding arc 𝑎 in 𝐷) value in 𝐺 (and in
case 𝑠 𝑗 is adjacent to such an edge, we start from that), and then we always continue on a new
Gergely Csáji (HUN-REN KRTK KTI) 14

edge 𝑒𝑖+1 of 𝐺 with fractional 𝑓 𝑗 (𝑒𝑖+1 ) value, until we find a cycle or reach 𝑡 𝑗 . Suppose we cannot
continue from 𝑣 𝑖+1 after a fractional edge 𝑒𝑖 = {𝑣 𝑖 , 𝑣 𝑖+1 }, but we have not yet found a cycle or an 𝑠 𝑗 𝑡 𝑗
path. Then, this means that every edge incident to 𝑣 𝑖+1 ∉ {𝑠Í 𝑖 Í
𝑗 , 𝑡 𝑗 } other than 𝑒 has integer value in

𝑓 . Hence, in the flow 𝑓 of the network 𝐷, exactly one of 𝑎∈𝛿 (𝑣𝑖+1 ) 𝑓 𝑗 (𝑎) and 𝑎∈𝜌 (𝑣𝑖+1 ) 𝑓 𝑗 (𝑎) is
𝑗 𝑗

integral, which would contradict the Kirchoff law of flows. 

Next, we prove a key Lemma for the rounding procedure.


Lemma 5.1. Let 𝑓 = (𝑓 1, . . . , 𝑓 𝑘 ) be a fractional stable multicommodity flow. Let 𝑔 = (𝑔1, . . . , 𝑔𝑘 )
be an integer multicommodity flow, such that if 𝑓 𝑗 (𝑎) = 0, then 𝑔 𝑗 (𝑎) = 0.
 𝑗
Furthermore, let
′𝑗 𝑔 (𝑎) if 𝑓 𝑗 (𝑎) = 𝑐 𝑗 (𝑎)
𝑐 (𝑎) = 𝑗 𝑗
𝑚𝑎𝑥 {𝑔 (𝑎), ⌈𝑐 (𝑎)⌉} otherwise
 Í Í
,
𝑗 ∈ [𝑘Í
𝑗 if 𝑗 ∈ [𝑘 ] 𝑓 𝑗 (𝑎) = 𝑐 (𝑎)
] 𝑔 (𝑎)
𝑐 ′ (𝑎) =
𝑚𝑎𝑥 { 𝑗 ∈ [𝑘 ] 𝑔 𝑗 (𝑎), ⌈𝑐 (𝑎)⌉} otherwise
Then, 𝑔 is a stable multicommodity flow with respect to the capacities 𝑐 ′ and flow specific capacities
𝑐 ′𝑗 .
Proof. By the definition of the capacities, it is immediate that 𝑔 is feasible. Assume for the
contrary that 𝑔 is not stable and hence there exists a blocking walk 𝑊 = (𝑣 1 , 𝑎 1 , 𝑣 2 , . . . , 𝑒𝑘 −1 , 𝑣 𝑘 )
with respect to some commodity 𝑗 . Then, 𝑔 𝑗 (𝑎𝑖 ) ≤ 𝑐 ′𝑗 (𝑎𝑖 ) − 1 ∀𝑖, which means that 𝑓 𝑗 (𝑎𝑖 ) < 𝑐 𝑗 (𝑎𝑖 )
by the definition of 𝑐 ′𝑗 .
If 𝑣 1 ≠ 𝑠 𝑗 , then there is an arc 𝑎 ∈ 𝛿 (𝑣 1 ) such that 𝑔 𝑗 (𝑎) ≥ 1 and 𝑎 1 ≻𝑣𝑗 1 𝑎. By the condition on 𝑔,
𝑗
𝑓 (𝑎) > 0 too.
If 𝑣 𝑘 ≠ 𝑡 𝑗 , then there exists an arc 𝑎 ′ ∈ 𝜌 (𝑣 𝑘 ), such that 𝑔 𝑗 (𝑎 ′ ) ≥ 1 and 𝑎𝑘 −1 ≻𝑣𝑗𝑘 𝑎 ′ , and again
Í
by the condition on 𝑔, 𝑓 𝑗 (𝑎 ′ ) > 0 too.

Finally, if 𝑗 ∈ [𝑘 ] 𝑔 𝑗 (𝑎𝑖 ) = 𝑐 ′ (𝑎𝑖 ), then there exists some 𝑗 ′ ≠ 𝑗 , such that 𝑔 𝑗 (𝑎𝑖 ) ≥ 1 and 𝑗 ′ ≺𝑎𝑖 𝑗 .

Hence, 𝑓 𝑗 (𝑎𝑖 ) > 0 too.
Putting this together, we get that 𝑊 is a (fractionally) blocking walk for 𝑓 too, which contradicts
the stability of 𝑓 . 

We continue by describing the rounding algorithm for smf. Given a directed graph 𝐷 = (𝑉 , E),
and a path or cycle 𝑋 in the undirected sense and a fixed orientation 𝑋® of 𝑋 , we say that an arc
𝑒 ∈ 𝑋 is a forward arc with respect to 𝑋® , if its direction is consistent with the orientation and a
backward arc otherwise.
The algorithm starts by finding a stable multicommodity flow 𝑓 and setting 𝑔 = 𝑓 .
Then, we go through each flow 𝑔 𝑗 one-by-one and round them as follows. If we still have frac-
tional values, then we find an 𝑠 𝑗 𝑡 𝑗 path or cycle 𝑋 of fractional edges. Then, we augment the flow
with a sufficiently small 𝜀 and iterate this until 𝑔 𝑗 becomes integral. See Algorithm 1 for more
details.
Theorem 5.2. For any instance of smf, Algorithm 1 finds capacities 𝑐 ′ , 𝑐 ′𝑗 , 𝑗 ∈ [𝑘] such that
max |𝑐 (𝑎) − 𝑐 ′ (𝑎)| ≤ 𝑘 − 1 and 𝑐 𝑗 (𝑎) = 𝑐 ′𝑗 (𝑎) for all 𝑎 ∈ E, such that 𝑔 is a stable integral multicom-
modity flow with respect to the capacities 𝑐 ′ and commodity specific capacities 𝑐 ′𝑗 .
Í Í Í
Furthermore, we can suppose that each flow 𝑔 𝑗 has almost the same size as 𝑓 𝑗 , meaning that
| 𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 𝑗 (𝑎) − 𝑔 𝑗 (𝑎)| < 1 for all 𝑗 and for the aggregate flow, | 𝑗 ∈ [𝑘 ] 𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 𝑗 (𝑎) − 𝑔 𝑗 (𝑎)| <
𝑘 − 1.
Gergely Csáji (HUN-REN KRTK KTI) 15

ALGORITHM 3: Iterative Rounding for smf


Input: An instance of smf.
Output: An integer stable multicommodity flow 𝑓 with respect to some capacities 𝑐 ′ satisfying
|𝑐 ′ (𝑎) − 𝑐 (𝑎)| ≤ 𝑘 − 1 for 𝑎 ∈ E.
Find a stable fractional flow 𝑓 = (𝑓 1 , ..., 𝑓 𝑘 ) and set 𝑔 = 𝑓 .
for 𝑗 = 1, ..., 𝑘 do
while there is a fractional valued arc in 𝑔 𝑗 do
Find a cycle or an 𝑠 𝑗 𝑡 𝑗 path 𝑋 (in the undirected sense) as in Claim 2.
Fix an orientation 𝑋® of 𝑋 . We choose this in a way such that if 𝑋 is an 𝑠 𝑗 𝑡 𝑗 path, then 𝑋® starts
in 𝑠 𝑗 .
Let 𝜀 1 be the smallest number, such that increasing 𝑔 𝑗 (𝑎) on the forward arcs of 𝑋® and
decreasing 𝑔 𝑗 (𝑎) on the backward arcs of 𝑋® with 𝜀 1 , at least one value becomes integral.
Let 𝜀 2 be the smallest number, such that increasing 𝑔 𝑗 (𝑎) on the backward arcs of 𝑋® and
decreasing 𝑔 𝑗 (𝑎) on the forward arcs of 𝑋® with 𝜀 1 , at least one value becomes integral.
if 𝑋 is a cycle then
if 𝜀 1 < 𝜀 2 then
Let 𝑔 𝑗 (𝑎) := 𝑔 𝑗 (𝑎) + 𝜀 1 for forward arcs and 𝑔 𝑗 (𝑎) := 𝑔 𝑗 (𝑎) − 𝜀 1 for backward arcs with
respect to 𝑋® .
end
else
Let 𝑔 𝑗 (𝑎) := 𝑔 𝑗 (𝑎) − 𝜀 2 for forward arcs and 𝑔 𝑗 (𝑎) := 𝑔 𝑗 (𝑎) + 𝜀 2 for backward arcs with
respect to 𝑋® .
end
Í Í
end
else if 𝑎∈𝛿 (𝑠 𝑗 ) 𝑔 𝑗 (𝑎) > 𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 𝑗 (𝑎) then
Decrease the flow with 𝜀 2 , that is, let 𝑔 𝑗 (𝑎) := 𝑔 𝑗 (𝑎) − 𝜀 2 for forward arcs and
𝑔 𝑗 (𝑎) := 𝑔 𝑗 (𝑎) + 𝜀 2 for backward arcs with respect to 𝑋® .
end
else
Increase the flow with 𝜀 1 , that is, let 𝑔 𝑗 (𝑎) := 𝑔 𝑗 (𝑎) + 𝜀 1 for forward arcs and
𝑔 𝑗 (𝑎) := 𝑔 𝑗 (𝑎) − 𝜀 1 for backward arcs with respect to 𝑋® .
end
end
end
Output the obtained flow 𝑔, and capacities 𝑐 ′ as defined in lemma 5.1

Í 𝑔 is an integral stable multicommodity


Similarly, we can find capacities 𝑐 ′ and a flow 𝑔, such that
flow with respect to 𝑐 and the capacities 𝑐 𝑗 , 𝑗 ∈ [𝑘] and | 𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 𝑗 (𝑎) − 𝑔 𝑗 (𝑎)| < 2 for all 𝑗 ∈ [𝑘],
Í Í
and | 𝑗 ∈ [𝑘 ] 𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 𝑗 (𝑎) − 𝑔 𝑗 (𝑎)| < 1.

Proof. First of all, as the algorithm sets the capacities according to Lemma 5.1, it is clear that 𝑔
is feasible with respect to the capacities. Since 𝑔 𝑗 (𝑎) remains 0, if 𝑓 𝑗 (𝑎) was 0, stability also follows
by Lemma 5.1.
To see the bounds on the capacity changes, observe that for each 𝑎 ∈ E and commodity 𝑗 ∈ [𝑘],
we never modify the value 𝑔 𝑗 (𝑎) if it was integral, and otherwise it can only change to one of the
two closest integer values, by the choices of 𝜀 1 and 𝜀 2 . This means also that 𝑔 𝑗 (𝑎) ≤ ⌈𝑐 𝑗 (𝑎)⌉ = 𝑐 𝑗 (𝑎).
Hence, if 𝑐 ′𝑗 (𝑎) is would be updated to 𝑔 𝑗 (𝑎) ≠ 𝑐 𝑗 (𝑎) for an arc 𝑎 ∈ E by the algorithm, then either
𝑓 𝑗 (𝑎) = 𝑐 𝑗 (𝑎), so 𝑐 ′𝑗 (𝑎) = 𝑐 𝑗 (𝑎) or 𝑔 𝑗 (𝑎) > ⌈𝑐 𝑗 (𝑎)⌉, a contradiction.
Gergely Csáji (HUN-REN KRTK KTI) 16

Í
Furthermore, because 𝑐 (𝑎) is integer and 𝑐 ′ (𝑎) ≤ 𝑔(𝑎) = 𝑗 ∈ [𝑘 ] 𝑔 𝑗 (𝑎) < 𝑓 (𝑎) + 𝑘 is integer for
any 𝑎 ∈ E, this means that the sum increases with 𝑘 − 1 at maximum. Also, if it decreases, then
Í by at most 𝑘 − 1 too.
𝑐 (𝑎) = 𝑓 (𝑎), so 𝑐 ′ (𝑎) = 𝑔(𝑎) > 𝑓 (𝑎) − 𝑘, so it decreases
Observe that in the rounding procedure, the size 𝑎∈𝛿 (𝑠 𝑗 ) 𝑔 𝑗 (𝑎) of the flow 𝑔 𝑗 only changes when
𝑋 is an 𝑠 𝑗 𝑡 𝑗 path. In every such step, it changes with less than one. Also, because we only decrease
Í Í
the size of the flow 𝑔 𝑗 , if its size is at least the size of 𝑓 𝑗 , and only increase if its size is less than the
size of 𝑓 𝑗 , it cannot change with more than one, implying | 𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 𝑗 (𝑎) − 𝑎∈𝛿 (𝑠 𝑗 ) 𝑔 𝑗 (𝑎)| < 1
for any 𝑗 ∈ [𝑘], as desired. The bound on the change of the aggregate flow 𝑔 immediately follows.
Í Í
For the last statement, we modify the algorithm, such that when rounding the flow 𝑔 𝑗 for
an 𝑠 𝑗 𝑡 𝑗 path 𝑋 , it keeps track of whether |𝑔| := 𝑗 ∈ [𝑘 ] 𝑎∈𝛿 (𝑠 𝑗 ) 𝑔 𝑗 (𝑎) is greater or less than
Í Í Í
|𝑓 | := 𝑗 ∈ [𝑘 ] 𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 𝑗 (𝑎). Then, it increases the flow on it if |𝑔| < |𝑓 |, unless 𝑎∈𝛿 (𝑠 𝑗 ) 𝑔 𝑗 (𝑎) >
Í 𝑗 Í 𝑗 Í 𝑗
𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 (𝑎) + 1 and otherwise it decreases it, unless 𝑎∈𝛿 (𝑠 𝑗 ) 𝑔 (𝑎) < 𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 (𝑎) − 1.
Since in each rounding, the flow values change by strictly less than 1, this means that if we
start to round a flow 𝑔 𝑗 such that |𝑔| < |𝑓 | holds, then the size of 𝑔 𝑗 cannot increase by the end
of iteration 𝑗 , so at the end of that iteration, |𝑔| cannot Í get Ísmaller. Similarly, if |𝑔| > |𝑓 | by the
start of the iteration, it cannot get larger. Hence, | 𝑗 ∈ [𝑘 ] 𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 𝑗 (𝑎) − 𝑔 𝑗 (𝑎)| < 1 as desired.
Í
Furthermore, it is also easy to see that | 𝑎∈𝛿 (𝑠 𝑗 ) 𝑓 𝑗 (𝑎) − 𝑔 𝑗 (𝑎)| < 2 for all 𝑗 ∈ [𝑘].
The algorithm starts with finding a fractional stable flow, which of course may not have poly-
nomial running time. The rest of the algorithm running is easily seen to be polynomial, as the
number of iterations is bounded by 𝑘 · |E | and each iteration can be done in polynomial time. 

6 Conclusions
In this paper, we have demonstrated that near-feasible stable solutions can always be found for a
variety of NP-hard stable matching problems, including the Stable Hypergraph Matching problem,
the College Admission problem with Common Quotas, and the Stable Multicommodity Flow prob-
lem. Our results establish that by allowing minimal modifications to capacity constraints, we can
ensure stability in these settings without violating the fundamental properties of the underlying
models.
We used an iterative rounding algorithm that systematically adjusts capacities while preserving
stability. Our approach leverages Scarf’s theorem to compute an initial fractional stable solution
and iteratively rounds it to obtain an integral stable solution with bounded capacity adjustments.
Moreover, in the case of Stable Fixtures, our method provides a polynomial-time guarantee for
achieving a stable matching with minimal capacity modifications.
Our findings have significant implications for real-world applications in market design, resource
allocation, and network flow optimization. In particular, they offer constructive solutions for pol-
icymakers and system designers, ensuring that slight adjustments to institutional constraints can
lead to stable and implementable outcomes. Future research directions include refining our bounds
for specific problem instances, exploring alternative rounding techniques, and extending our meth-
ods to additional constrained matching and flow problems.
Our work highlights the practical viability of near-feasible stable solutions, reinforcing the idea
that stability can be preserved even in highly constrained and complex settings with only minimal
systemic changes.

References
Kolos Csaba Ágoston, Péter Biró, Endre Kováts, and Zsuzsanna Jankó. 2022. College admissions with ties and common
quotas: Integer programming approach. European Journal of Operational Research 299, 2 (2022), 722–734.
Ron Aharoni and Tamás Fleiner. 2003. On a lemma of Scarf. Journal of Combinatorial Theory, Series B 87, 1 (2003), 72–80.
https://doi.org/10.1016/S0095-8956(02)00028-X
Gergely Csáji (HUN-REN KRTK KTI) 17

Péter Biró and Gergely Csáji. 2024. Strong core and Pareto-optimality in the multiple partners matching problem under
lexicographic preference domains. Games and Economic Behavior 145 (2024), 217–238.
Péter Biró and Tamás Fleiner. 2016. Fractional solutions for capacitated NTU-games, with applications to stable matchings.
Discrete Optimization 22 (2016), 241–254.
Péter Biró, Tamás Fleiner, Robert W Irving, and David F Manlove. 2010. The college admissions problem with lower and
common quotas. Theoretical Computer Science 411, 34-36 (2010), 3136–3153.
P. Biró, D. Manlove, and Iain McBride. 2014. The Hospitals / Residents Problem with Couples: Complexity and Integer
Programming Models. ArXiv abs/1308.4534 (2014).
Jiehua Chen and Gergely Csáji. 2023. Optimal Capacity Modification for Many-To-One Matching Problems. In Proceedings
of the 2023 International Conference on Autonomous Agents and Multiagent Systems (London, United Kingdom) (AAMAS
’23). 2880–2882.
Gergely Csáji. 2022. On the complexity of stable hypergraph matching, stable multicommodity flow and related problems.
Theoretical Computer Science 931 (2022), 1–16.
Ágnes Cseh and Jannik Matuschke. 2019. New and Simple Algorithms for Stable Flow Problems. Algorithmica 81 (01 2019).
https://doi.org/10.1007/s00453-018-00544-7
Brian C. Dean, Michel X. Goemans, and Nicole Immorlica. 2006. The Unsplittable Stable Marriage Problem. In Fourth IFIP
International Conference on Theoretical Computer Science- TCS 2006, Gonzalo Navarro, Leopoldo Bertossi, and Yoshiharu
Kohayakawa (Eds.). Springer US, Boston, MA, 65–75.
Tamás Fleiner. 2010. On Stable Matchings and Flows. Algorithms 7, 51–62. https://doi.org/10.1007/978-3-642-16926-7_7
David Gale and Lloyd S Shapley. 1962. College admissions and the stability of marriage. The American Mathematical
Monthly 69, 1 (1962), 9–15.
Chien-Chung Huang. 2007. Two’s company, three’sa crowd: Stable family and threesome roommates problems. In European
Symposium on Algorithms. Springer, 558–569.
Robert W Irving. 1985. An efficient algorithm for the “stable roommates” problem. Journal of Algorithms 6, 4 (1985),
577–595.
Robert W Irving and Sandy Scott. 2007. The stable fixtures problem—a many-to-many extension of stable roommates.
Discrete Applied Mathematics 155, 16 (2007), 2118–2129.
Tamás Király and Julia Pap. 2013. Stable Multicommodity Flows. Algorithms 6 (03 2013), 161–168.
https://doi.org/10.3390/a6010161
DE Knuth. 1997. Mariages stables et leurs relations avec d’autres problemes combinatoires, Les Presses de l’Universite de
Montreal (1976), English translation by M. Goldstein: Stable Marriage and its Relation to other Combinatorial Problems.
In CRM Proceedings and Lecture Notes, Vol. 10.
Cheng Ng and Daniel S. Hirschberg. 1991. Three-Dimensional Stabl Matching Problems. SIAM Journal on Discrete Mathe-
matics 4, 2 (1991), 245–252. https://doi.org/10.1137/0404023
Thanh Nguyen and Rakesh Vohra. 2018. Near-feasible stable matchings with couples. American Economic Review 108, 11
(2018), 3154–69.
Thành Nguyen and Rakesh Vohra. 2019. Stable matching with proportionality constraints. Operations Research 67, 6 (2019),
1503–1519.
Herbert E Scarf. 1967. The core of an N person game. Econometrica: Journal of the Econometric Society (1967), 50–69.
A Schrijver. 1998. Theory of linear and integer programming. John Wiley & Sons.
Jimmy JM Tan. 1991. A necessary and sufficient condition for the existence of a complete stable matching. Journal of
Algorithms 12, 1 (1991), 154–178.

You might also like