This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Congestion and Penalization in Optimal Transport

Marcelo Gallardo
[email protected]
Department of Mathematics, Pontificia Universidad Católica del Perú (PUCP). Gallardo acknowledges insightful discussions with Professor Federico Echenique (UC Berkeley), and former Minister of Health of Peru, Aníbal Velásquez. Dr. Velásquez provided key information with respect to the Peruvian health system.
   Manuel Loaiza
[email protected]
Autodesk, Inc.
   Jorge Chávez
[email protected]
Chávez acknowledges support from the Pontificia Universidad Católica del Perú.
(April 2, 2025)
Abstract

We introduce a novel model based on the discrete optimal transport problem that incorporates congestion costs and replaces traditional constraints with weighted penalization terms. This approach better captures real-world scenarios characterized by demand-supply imbalances and heterogeneous congestion costs. We develop an analytical method for computing interior solutions, which proves particularly useful under specific conditions. Additionally, we propose an O((N+L)N2L2)O((N+L)N^{2}L^{2}) algorithm to compute the optimal interior solution. For certain cases, we derive a closed-form solution and conduct a comparative statics analysis. Finally, we present examples demonstrating how our model yields solutions distinct from classical approaches, leading to more accurate outcomes in specific contexts, such as Peru’s health and education sectors.

Keywords: Optimal transport, Congestion costs, Quadratic regularization, Matching, Penalization, Neumann series, Health economics.
JEL classifications: C61, C62, C78, D04, R41.

1 Introduction

Optimal Transport (OT) (Villani,, 2009; Galichon,, 2016) is a mathematical technique that, in recent years, has been integrated into economic theory, particularly in the study of matching markets (Chiappori et al.,, 2010; Galichon,, 2021; Dupuy et al.,, 2019; Carlier et al.,, 2023; Echenique, Federico, Joseph Root and Feddor Sandomirskiy,, 2024). Unlike classical matching models (Gale and Shapley,, 1962; Hylland and Zeckhauser,, 1979; Kelso and Crawford,, 1982; Roth and Sotomayor,, 1990; Abdulkadiroğlu and Sönmez,, 2003; Hatfield and Milgrom,, 2005; Echenique, Federico and M. Bumin, Yenmez,, 2015), OT optimizes over distributions, providing a more flexible and general framework. Starting from the classical model, in which matching costs are represented by a linear function, various extensions have incorporated a regularization term in the objective function to obtain solutions with desirable properties such as sparsity. Notable examples include entropic regularization (Dupuy and Galichon,, 2014; Dupuy et al.,, 2019; Merigot and Thibert,, 2020; Galichon,, 2021) and quadratic regularization (Lorenz et al.,, 2019; González-Sanz and Nutz,, 2024; Wiesel and Xu,, 2024; Nutz,, 2024). Both classical OT and its regularized variants have been widely applied in analyzing matching markets, including marriage markets (Dupuy and Galichon,, 2014), migration dynamics (Carlier et al.,, 2023), labor markets (Dupuy and Galichon,, 2022), and school choice (Echenique, Federico, Joseph Root and Feddor Sandomirskiy,, 2024).

This paper introduces a new model built upon the quadratic regularization framework, similar to Nutz, (2024), but adopting the approach of Izmailov and Solodov, (2023) while introducing heterogeneity in the quadratic term. Our model captures elements absent in classical formulations and better aligns with real-world scenarios. Specifically, by replacing equality constraints with weighted penalization terms, the solution accommodates supply and demand imbalances, a feature particularly relevant in developing countries when modeling matching in education and healthcare markets.

Countries with developing economies often experience significant inefficiencies in education and healthcare due to excess demand, insufficient supply, mismatching, and systemic congestion. These structural issues have contributed to high mortality rates and service deficiencies, as demonstrated during the COVID-19 pandemic. For instance, Johns Hopkins University Coronavirus Resource Center, (2023) indicates that Peru recorded the highest per capita COVID-19 mortality rate globally, exceeding 6,400 deaths per million inhabitants. Similar inefficiencies have been observed across Latin America, where restricted healthcare access exacerbates disparities.

A key factor behind these inefficiencies is that individuals are not properly matched due to physical barriers, bureaucratic issues, and congestion (Anaya-Montes and Gravelle,, 2024; Velásquez,, 2020), compounded by excess demand. In countries such as Peru, India, and Brazil (Kikuchi and Hayashi,, 2020), congestion is particularly severe. For instance, World Bank, (2024) estimates that traffic congestion alone costs Peru 1.8% of its GDP annually. Given these conditions, accounting for congestion and excess demand is crucial when modeling these dynamics.

The model presented in this paper provides a framework for congestion costs while also capturing excess of demand across different institutional contexts. As such, it reflects the realities of many developing countries, contrasting with developed nations such as France or Switzerland, where robust transportation infrastructure, efficient bureaucratic systems, and policies ensure universal access to education and healthcare.

The remainder of this paper is structured as follows. Section 2 defines the fundamental concepts and notation. Section 3 introduces the proposed model and examines its theoretical properties. Section 4 presents illustrative examples that demonstrate the advantages of our approach. Due to data availability constraints, our empirical analysis focuses on the Peruvian health and education sectors. All proofs are provided in the Appendix.

2 Preliminaries

We consider two sets, X={x1,,xN}X=\{x_{1},\ldots,x_{N}\} and Y={y1,,yL}Y=\{y_{1},\ldots,y_{L}\}. Each element xix_{i} (yj)(y_{j}) represents an individual or a group of individuals/entities that share certain properties and are grouped into the same cluster. For example, in the marriage market (where usually N=LN=L), XX is the set of men and YY is the set of women. In the case of school matching, XX consists of groups of students, grouped, for instance, according to their district, and YY is the set of schools. We denote by μi\mu_{i} the mass of xix_{i} and by νj\nu_{j} the mass of yjy_{j}. For instance, in the marriage market, μi=νj=1\mu_{i}=\nu_{j}=1, while in the case of schools, νj\nu_{j} would represent the capacity of school jj. Analogously, if XX were patients and YY medical care centers, then parameters νj\nu_{j} would represent the capacity of the medical care center. When referring to an element of XX, instead of denoting it by xix_{i}, we usually, to simplify the notation, refer to it by ii. Analogously, the elements of YY are referred to by the index jj, instead of yjy_{j}. Moreover, we denote the set of indices {1,,N}\{1,\ldots,N\} by II and the set of indices {1,,L}\{1,\ldots,L\} by JJ. Lastly, we denote by πij\pi_{ij} the number of individuals of type ii matched with jj.

The problem addressed in the classic literature, from the perspective of a central planner, is to decide how many individuals from group ii should be matched with jJj\in J and so forth for each ii, minimizing the matching cost111Matching individuals incurs a cost that is not limited solely to ¡¡physical¿¿ transportation costs, which certainly accounts for both ways (round trip), but also encompasses implicit costs linked to specific characteristics of ii and jj such as tuition fee, entrance exam, languages, sex, age, etc. This is why we refer to them as matching costs instead of transportation costs., which is given by means of a function C:+N,L×PC:\mathbb{R}_{+}^{N,L}\times\mathbb{R}^{P}\to\mathbb{R} depending on the matching π=[πij]+N,L\pi=[\pi_{ij}]\in\mathbb{R}_{+}^{N,L}222In this work, we will mostly assume that the number of individuals matched can take values in the real positive line and not only in the positive integers. Note that this is the same issue that arises when one solves the utility maximization problem in the classical framework assuming divisible goods. Later on, we will address again this issue and explain why considering πij+\pi_{ij}\in\mathbb{R}_{+} allows drawing solid conclusions from an economic perspective., and a vector of parameters θP\theta\in\mathbb{R}^{P}. Moreover, the central planner must ensure that there are neither excesses of demand nor supply. Hence, the central planner solves

minπΠ(μ,ν)C(π;θ),\min_{\pi\in\Pi(\mu,\nu)}\ C(\pi;\theta), (1)

where

Π(μ,ν)={πij0:j=1Lπij=μi,iIi=1Nπij=νj,jJ}.\Pi(\mu,\nu)=\left\{\pi_{ij}\geq 0:\sum_{j=1}^{L}\pi_{ij}=\mu_{i},\ \forall\ i\in I\ \wedge\ \sum_{i=1}^{N}\pi_{ij}=\nu_{j},\ \forall\ j\in J\right\}. (2)

A solution to (1) will be from now referred to as an optimal matching or optimal (transport) plan, and will be denoted by π\pi^{*}. In the standard optimal transport model, separable linear costs are assumed (Galichon,, 2016). This is, C(π,θ)=i,jcijπijC(\pi,\theta)=\sum_{i,j}c_{ij}\pi_{ij}. It is therefore assumed that the marginal cost of matching one more individual from ii with jj is always the same, regardless of how many people are already matched and independent of any other variable. Hence, the central planner seeks to solve

𝒫O:minπΠ(μ,ν)i=1Nj=1Lcijπij.\mathcal{P}_{O}:\ \min_{\pi\in\Pi(\mu,\nu)}\ \sum_{i=1}^{N}\sum_{j=1}^{L}c_{ij}\pi_{ij}.

To solve 𝒫O\mathcal{P}_{O}, one typically employs linear programming techniques, such as the simplex method. As discussed in the classical literature, the most general form of the OT problem allows for the existence of infinite types, and in such a case, the optimization is done over continuous distributions. In this paper, however, we are not going to study continuous distributions. What we do focus on, in line with the entropic regularization problem (see, for example, Carlier et al., (2023) and Peyré and Cuturi, (2019)), is working with a variation of the optimization problem in the discrete setting. In the case of entropic regularization (3), the problem addressed is

minπΠ(μ,ν)i=1Nj=1Lcijπij+σπijln(πij),\min_{\pi\in\Pi(\mu,\nu)}\ \sum_{i=1}^{N}\sum_{j=1}^{L}c_{ij}\pi_{ij}+\sigma\pi_{ij}\ln(\pi_{ij}), (3)

with σ>0\sigma>0. Given the strict convexity of f(x)=xlnxf(x)=x\ln x, f(0)=0f(0)=0 and limx0+f(x)=\lim_{x\downarrow 0^{+}}f^{\prime}(x)=-\infty, the solution is interior, i.e. πij>0\pi_{ij}^{*}>0. Another variation is the quadratic regularization, where the problem becomes

minπΠ(μ,ν)i=1Nj=1Lcijπij+ε2π22.\min_{\pi\in\Pi(\mu,\nu)}\ \sum_{i=1}^{N}\sum_{j=1}^{L}c_{ij}\pi_{ij}+\frac{\varepsilon}{2}||\pi||_{2}^{2}. (4)

Unlike the problem (3), in the case of (4), interior solutions cannot be guaranteed333This is a common feature with our model, it is not straightforward to determine if the solution is interior.. In the model we present in the following section, we build upon the problem (4), making a considerable number of modifications that allow us to adapt to specific economic contexts of countries with structural problems. Before concluding this section, let us briefly note that, by a combinatorial argument, it is possible to conclude that the number of matchings is bounded by LML^{M} in the case where πij+\pi_{ij}\in\mathbb{Z}_{+}. However, for the case πij+\pi_{ij}\in\mathbb{R}_{+}, considering μi,νj>0\mu_{i},\nu_{j}>0 for all (i,j)I×J(i,j)\in I\times J, the compactness of Π(μ,ν)\Pi(\mu,\nu) and continuity of the objective functions, ensure the existence of a solution to 𝒫O\mathcal{P}_{O} and its variants by Weierstrass Theorem.

3 The model

In this section, we present the model that we propose, inspired by the optimal transport problem with quadratic regularization, but following the approach of Izmailov and Solodov, (2023). The model is derived from the very characteristics of the observed reality in certain locations. This will be explored in more detail in Section 4.

First, we need to allow the number of individuals of XX who belong to ii and are matched with j=1,,Lj=1,...,L, to not necessarily be μi\mu_{i}444We anticipate that μi\mu_{i} will no longer be the mass of individuals of group ii but rather a targeted quota for individuals of group ii.. Similarly, it may be the case that not all those matched with jj sum up to νj\nu_{j}. This model allows for the possibility of excess supply or demand, which is reasonable in some contexts, as we will see. Indeed, underdeveloped countries may not be able to ensure full coverage in education and health, making it more realistic for them to face a trade-off. However, it is natural for the central planner to seek to minimize these excesses: ensuring that children attend school, that schools or hospitals do not become overcrowded, etc.

Mathematically, we model this by replacing the equality constraints defined by Π(μ,ν)\Pi(\mu,\nu) with penalties in the objective function. Moreover, we introduce weights for each penalty. That is, the constraint i=1Nπij=νj\sum_{i=1}^{N}\pi_{ij}=\nu_{j} is replaced by the penalty term δj[i=1Nπijνj]2\delta_{j}\left[\sum_{i=1}^{N}\pi_{ij}-\nu_{j}\right]^{2}, with δj>0\delta_{j}>0, and the constraint j=1Lπij=μi\sum_{j=1}^{L}\pi_{ij}=\mu_{i} is replaced by ϵi[j=1Lπijμi]2\epsilon_{i}\left[\sum_{j=1}^{L}\pi_{ij}-\mu_{i}\right]^{2}, with ϵi>0\epsilon_{i}>0. The parameters ϵi,δj\epsilon_{i},\delta_{j} are weights. We could use any p1p\geq 1 norm for the penalization. However, the quadratic structure yields mathematical simplifications and fulfills the desired role. Then, by allowing deviations, as we will see in the examples, we better approximate the reality of developing countries that cannot fully ensure that demand perfectly matches supply.

Secondly, as is natural in some environments (see the next section), congestion costs are present. These costs reflect the fact that matching more individuals from ii with the same jj becomes increasingly costly. For example, from the perspective of physical transportation costs, in countries with high vehicular traffic congestion, the effect of increasing from xx cars to x+1x+1 passing through a certain avenue is less or equal to increasing from x+nx+n to x+n+1x+n+1 with n1n\geq 1. Therefore, clustering groups based on geographic location means that matching many individuals from the same group to a single jj congests the access route (which is the same). Hence, we introduce the term i,jaijπij2\sum_{i,j}a_{ij}\pi_{ij}^{2} in the cost structure. The coefficient aija_{ij} captures heterogeneity555In some situations, the coefficient might be large, but in others—such as cases where there are few schools or hospitals, lightly congested streets, good traffic lights, etc.—the coefficient is small. Moreover, one could question whether adding a car still marginally increases costs when a route is already saturated. However, this effect would only arise when the number of travelers is excessively high relative to the route’s capacity. For simplicity, we omit this case, as modeling a function that is initially quadratic and later constant would overly complicate the analysis when applying first order conditions., while the quadratic term represents the previously described phenomenon666Instead of using πij2\pi_{ij}^{2}, we could consider a general strictly increasing and convex function ψ\psi, such as ψ(πij)=eπij\psi(\pi_{ij})=e^{\pi_{ij}} or πij3\pi_{ij}^{3}. However, the quadratic structure facilitates quantitative analysis and preserves the consistency of the results and modeling.. Note that quadratic costs are not limited to physical transportation costs but can also represent bureaucratic costs. A hospital receives patients of the same type. As more patients of this type arrive, the system must process a greater number of cases. Since they share the same characteristics, it is assumed that the same computer or system will handle their processing. Given the precarious conditions in developing countries, increasing from xx to x+1x+1 patients may not significantly affect the system, but increasing from x+nx+n to x+n+1x+n+1 with n>1n>1 might (e.g., leading to system freezes, delays, etc.).

Finally, we certainly have πij0\pi_{ij}\geq 0, for all (i,j)I×J(i,j)\in I\times J. However, we do not impose upper bounds since we consider a population or universe that is arbitrarily large (a subpopulation of a sufficiently large country)777This considerably simplify our analysis and does not affect the logic of the model.. Hence, the optimization is carried out over the entire space +NL\mathbb{R}_{+}^{NL}. This phenomenon also explains the penalties: we no longer assume a fixed number of individuals of type ii, and μi\mu_{i} represents now a target that the central planner aims to achieve (how many individuals of type ii should ideally be matched). Similarly, the parameters νj\nu_{j} are also targets of the central planner.

Therefore, following the described scenario, the central planner seeks to minimize costs while taking into account the objective of reaching the targets μi\mu_{i} and νj\nu_{j}. The tradeoff is controlled through a parameter α[0,1]\alpha\in[0,1]. According to what has been specified, the problem is:

𝒫CP:minπij0{αi=1Nj=1Lφ(πij;θij)Matching direct cost.+(1α)[i=1Nϵi(j=1Lπijμi)2+j=1Lδj(i=1Nπijνj)2]Costs of social objectives.}F(π;θ,α,ϵ,δ,μ,ν).\mathcal{P}_{CP}:\ \min_{\pi_{ij}\geq 0}\underbrace{\left\{\underbrace{\alpha\sum_{i=1}^{N}\sum_{j=1}^{L}\varphi(\pi_{ij};\theta_{ij})}_{\text{Matching direct cost.}}+\underbrace{(1-\alpha)\left[\sum_{i=1}^{N}\epsilon_{i}\left(\sum_{j=1}^{L}\pi_{ij}-\mu_{i}\right)^{2}+\sum_{j=1}^{L}\delta_{j}\left(\sum_{i=1}^{N}\pi_{ij}-\nu_{j}\right)^{2}\right]}_{\text{Costs of social objectives.}}\right\}}_{F(\pi;\theta,\alpha,\epsilon,\delta,\mu,\nu).} (5)

where ϵ1,,ϵN\epsilon_{1},...,\epsilon_{N}, δ1,,δL\delta_{1},...,\delta_{L} and μ1,,μN\mu_{1},\cdots,\mu_{N}, ν1,,νL\nu_{1},\cdots,\nu_{L} are all non negative, and

φ(πij;θij)=dij+cijπij+aijπij2.\varphi(\pi_{ij};\theta_{ij})=d_{ij}+c_{ij}\pi_{ij}+a_{ij}\pi_{ij}^{2}. (6)

In Equation 6, despite its practical relevance, the term dijd_{ij}, representing fixed costs, does not influence the resolution of the problem. For this reason, when considering the parameter vector θij2\theta_{ij}\in\mathbb{R}^{2}, we think of it as (cij,aij)(c_{ij},a_{ij}). Unlike more recent models in the quadratic regularization literature, we allow heterogeneity in the quadratic structure.

Having now established the model, which, to the best of our knowledge, is new in the literature888Quadratic regularization does not involve penalization terms and assumes aij=εa_{ij}=\varepsilon for all (i,j)I×J(i,j)\in I\times J. With respect to the classical optimal transport problem, linear costs are considered. On the other hand, entropic regularization involves Inada’s conditions, which do not appear in our model. Finally, in Izmailov and Solodov, (2023), only general results concerning penalization are given and this particular problem is not studied at all., we focus in this section on the following theoretical problems: (i) ensuring the existence of a solution, (ii) analyzing uniqueness, (iii) addressing why optimization in +NL\mathbb{R}_{+}^{NL} is reasonable and why we do not resort to integer optimization, (iv) studying how to compute interior solutions, and (v) analyzing particular cases both from the analytical and numerical perspective. In the next section, we compare our model with previous ones from the literature and highlight its advantages and the new insights it provides.

Existence and uniqueness: Regarding the existence of a solution to 𝒫CP\mathcal{P}_{CP}, in order to apply Weierstrass theorem to overcome the potential issue that the optimization is carried over an unbounded set, we can actually restrict the optimization to +NLΩ\mathbb{R}_{+}^{NL}\cap\Omega, where

Ω=[0,R]NL,withR=Nmax1iN{μi}+Lmax1jL{νj}.\Omega=[0,R]^{NL},\ \text{with}\ R=N\max_{1\leq i\leq N}\{\mu_{i}\}+L\max_{1\leq j\leq L}\{\nu_{j}\}.

In fact, it is clear from the cost function FF that it is strictly lower in the interior of Ω\Omega or in the axes than when evaluated in Ω\partial\Omega (without considering the axes) or outside Ω\Omega. This is a consequence of the coercivity of the objective function (Rockafellar,, 1970). With respect to uniqueness, it is a consequence of the strict convexity of the objective function. Indeed, the objective function is the sum of a strictly convex function, i,jφ(πij,θij)\sum_{i,j}\varphi(\pi_{ij},\theta_{ij}), with N+LN+L convex functions of the form ϱ(m=1MηmΘ)2\varrho\left(\sum_{m=1}^{M}\eta_{m}-\Theta\right)^{2}, with ϱ,Θ,ηm+\varrho,\Theta,\eta_{m}\in\mathbb{R}_{+}.

Optimization carried over +NL\mathbb{R}_{+}^{NL}: As we mentioned previously, similarly to the case of the classical demand theory, we are assuming that πij+\pi_{ij}\in\mathbb{R}_{+}. However, just as it does not make sense to consume 2\sqrt{2} cars, it can be also unreasonable to consider that πij\pi_{ij} is not restricted to taking values in +\mathbb{Z}_{+}, since it ultimately represents the number of individuals. However, given the structure of the optimization problem—a convex quadratic optimization problem—following the classical literature on rounding methods (Beck and Fiala,, 1981) and, in particular, the discrepancy between integer (Park and Boyd,, 2018; Pia and Ma,, 2022) and continuous solutions in the case of separable quadratic functions with linear constraints (Hochbaum and Shanthikumar,, 1990), it is possible to establish bounds on the deviation of the optimal solution when transitioning from the continuous domain +NL\mathbb{R}_{+}^{NL} to the integer lattice +NL\mathbb{Z}_{+}^{NL}, and ensure that it is sufficiently close. The bound depends on the eigenvalues of the Hessian matrix of the objective function999Specifically, the deviation is bounded by πintπO(ϑ(H))||\pi_{\text{int}}-\pi^{*}||_{\infty}\leq O(\vartheta(H)), where ϑ(H)=λmax(H)/λmin(H)\vartheta(H)=\lambda_{\max}(H)/\lambda_{\min}(H) is the condition number.. Solving the problem in +NL\mathbb{R}_{+}^{NL} allows the use of nonlinear convex optimization techniques, yielding not only computational advantages but also analytical insights. In this work, we do not delve deeply into this aspect, but we emphasize that by adjusting the parameters, it is possible to control the bound on the norm of the difference between the solutions in the lattice and the Euclidean space.

Interior solutions: For the sake of simplicity, we take α=1/2\alpha=1/2. Karush Kuhn Tucker (KKT) first order conditions applied to (5) yield

Fπij=12(φ(πij;θij)+2ϵi(=1Lπiμi)+2δj(k=1Nπkjνj)γij)=0,(i,j)I×J.\frac{\partial F}{\partial\pi_{ij}}=\frac{1}{2}\left(\varphi^{\prime}(\pi_{ij}^{*};\theta_{ij})+2\epsilon_{i}\left(\sum_{\ell=1}^{L}\pi_{i\ell}^{*}-\mu_{i}\right)+2\delta_{j}\left(\sum_{k=1}^{N}\pi_{kj}^{*}-\nu_{j}\right)-\gamma_{ij}^{*}\right)=0,\ \forall\ (i,j)\in I\times J. (7)

Here, γij\gamma_{ij} is the associated multiplier to the inequality constraint πij0\pi_{ij}\geq 0. Determining whether or not the solution is interior, is not trivial. For corner solutions, we have to iterate all possible combinations of γij\gamma_{ij}^{*} equal or not to zero. Formally, 2NL2^{NL} possibilities. In general, the problem can numerically be solved. In what follows, unless the contrary is stated, we will address the case where the solution is interior. In this case, from KKT, we know that γij=0\gamma_{ij}^{*}=0 for all (i,j)I×J(i,j)\in I\times J. Hence, from (7), we have F(π)=0\nabla F(\pi^{*})=0. This set of equations can be written in the compact form A[π11π12πNL]T=bA\begin{bmatrix}\pi_{11}^{*}&\pi_{12}^{*}&\cdots&\pi_{NL}^{*}\end{bmatrix}^{T}=b, where

A=Diag(a11,a12,,aNL)D+Diag(ϵ1,,ϵN)𝟏L×LE+𝟏N×NDiag(δ1,,δL)F,A=\underbrace{\text{Diag}(a_{11},a_{12},\dots,a_{NL})}_{D}+\underbrace{\text{Diag}(\epsilon_{1},\dots,\epsilon_{N})\otimes\mathbf{1}_{L\times L}}_{E}+\underbrace{\mathbf{1}_{N\times N}\otimes\text{Diag}(\delta_{1},\dots,\delta_{L})}_{F}, (8)

and b=[ϵ1μ1+δ1ν1c11/2,ϵ1μ1+δ2ν2c12/2,,ϵNμN+δLνLcNL/2]T.b=\left[\epsilon_{1}\mu_{1}+\delta_{1}\nu_{1}-c_{11}/2,\epsilon_{1}\mu_{1}+\delta_{2}\nu_{2}-c_{12}/2,\cdots,\epsilon_{N}\mu_{N}+\delta_{L}\nu_{L}-c_{NL}/2\right]^{T}. The following lemma states that AA is an invertible matrix.

Lemma 3.1.

The determinant of AA is strictly positive, whenever all parameters are strictly positive.

Therefore, the linear system Aπ=bA\pi=b has a unique solution. What we still don’t know is whether or not this solution belongs to ++NL\mathbb{R}_{++}^{NL}. If so, given the strict convexity of FF, we would have determined, through an ex-post analysis, the unique solution to 𝒫CP\mathcal{P}_{CP}. However, it may not always be the case that A1b++NLA^{-1}b\in\mathbb{R}_{++}^{NL}, and it is not a trivial matter to determine. Under specific cases, we will be able to do this. We propose both an analytical and a computational method to solve Aπ=bA\pi=b. The analytical method allows us, in special cases, to derive important theoretical conclusions, such as closed-form solutions, bounds, and perform comparative statics. From a computational perspective, we compare our algorithm, which exploits the structure of the matrix AA, with others for solving linear systems.

3.1 Neumann’s series approach

Assumption 1.

Let aij>0a_{ij}>0 for all (i,j)I×J(i,j)\in I\times J. Assume that

max1iN{ϵi}L+max1jL{δj}N<min(i,j)I×J{aij}.\displaystyle\max_{1\leq i\leq N}\{\epsilon_{i}\}\cdot L+\max_{1\leq j\leq L}\{\delta_{j}\}\cdot N<\min_{(i,j)\in I\times J}\left\{a_{ij}\right\}.

Assumption 1 implies that convex transport costs are large. Moreover, the fact that ϵi,δj\epsilon_{i},\delta_{j} are small follows from their interpretation as normalized weights, i.e., ϵi,δj[0,1]\epsilon_{i},\delta_{j}\in[0,1].

Lemma 3.2.

Under Assumption 1, the following holds

A1=(k=0(1)k(D1X)k)D1.A^{-1}=\left(\sum_{k=0}^{\infty}(-1)^{k}(D^{-1}X)^{k}\right)D^{-1}.
Theorem 3.3.

Under Assumption 1, limnπn=π=A1b\lim_{n\to\infty}\pi_{n}=\pi^{*}=A^{-1}b, where

πn=SnD1b=(k=0n(1)k(D1X)k)D1b.\displaystyle\pi_{n}=S_{n}D^{-1}b=\left(\sum_{k=0}^{n}(-1)^{k}(D^{-1}X)^{k}\right)D^{-1}b.

3.2 Special cases

For the aim to explicitly compute A1A^{-1}, we need to impose some additional mild assumptions.

3.2.1 No interest in overcrowding or no quotas.

Assumption 2.

Assume that δj=0\delta_{j}=0 for all jJj\in J and D=βID=\beta I for some β>0\beta>0.

Assumption 2 illustrates the case where the central planner does not care if in over or underfilling schools or hospitals (F=0F=0), and convex costs are the same across the pairs (i,j)(i,j): aij=βa_{ij}=\beta. For instance, the latter applies when distances, routes, or bureaucratic systems are almost the same for all (i,j)I×J(i,j)\in I\times J.

Assumption 3.

Assume that Lϵi<min{1,β}L\epsilon_{i}<\min\{1,\beta\} for all 1iN1\leq i\leq N.

In line with Assumption 1, Assumption 3 applies when convex transport costs are large.

Theorem 3.4.

Under Assumptions 2 and 3, A1A^{-1} is given as follows

A1=Iβ+1βDiag(ϵ1β+Lϵ1,,ϵNβ+LϵN)𝟏L×L.A^{-1}=\frac{I}{\beta}+\frac{1}{\beta}\text{Diag}\left(-\frac{\epsilon_{1}}{\beta+L\epsilon_{1}},\dots,-\frac{\epsilon_{N}}{\beta+L\epsilon_{N}}\right)\otimes\mathbf{1}_{L\times L}. (9)

A similar result can be obtained by setting E=0E=0, i.e., when the central planner is only concerned with overcrowding or underutilization of facilities and does not care about population quotas.

Corollary 3.5.

Under Assumptions 2 and 3, the solution of 𝒫CP\mathcal{P}_{CP} is given by

πij=bijβ=1Lbiϵiβ2+Lϵiβ,\pi_{ij}^{*}=\frac{b_{ij}}{\beta}-\sum_{\ell=1}^{L}\frac{b_{i\ell}\epsilon_{i}}{\beta^{2}+L\epsilon_{i}\beta}, (10)

provided that the right-hand side of (10) is positive.

Proof.

This result follows directly from the computation of A1bA^{-1}b by using (9). ∎

3.2.2 Equal weighting and identical convex costs.

Assumption 4.

Let ρ\rho and ζ\zeta be real numbers such that ρ>2NLζ>0\rho>2NL\zeta>0, with aij=ρa_{ij}=\rho and ϵi=δj=ζ\epsilon_{i}=\delta_{j}=\zeta for all (i,j)I×J(i,j)\in I\times J.

Assumption 4 implies that the central planner assigns equal weight to each social objective and where congestion and bureaucratic costs are the same for each pair. Under this assumption, we have D=ρID=\rho I and X=ζYX=\zeta Y, where the entries of YY are given by

Yij={2i=j,1ij(i/N=j/Nij(modN)),0otherwise.Y_{ij}=\begin{cases}2&i=j,\\ 1&i\neq j\land(\left\lceil i/N\right\rceil=\left\lceil j/N\right\rceil\lor i\equiv j\pmod{N}),\\ 0&\text{otherwise}.\end{cases}

This allows us to write

A1=1ρ(k=0(ζρ)kYk).A^{-1}=\frac{1}{\rho}\left(\sum_{k=0}^{\infty}\left(-\frac{\zeta}{\rho}\right)^{k}Y^{k}\right).

Under Assumption 4, we will be able to establish bounds on the optimal matching, i.e., to bound the number of individuals matched across the pairs (i,j)(i,j). Lemmas 3.6, 3.7 and 3.8 are used to establish Theorem 3.9.

Lemma 3.6.

Let k1k\geq 1 be a positive integer. Then

max1i,jNL{(Yk)ij}(2NL)kNL.\max_{1\leq i,\ j\leq NL}\left\{\left(Y^{k}\right)_{ij}\right\}\leq\frac{\left(2NL\right)^{k}}{NL}.
Lemma 3.7.

Let k2k\geq 2 be a positive integer.Then

(NL)k/2NLmin1i,jNL{(Yk)ij}.\frac{(NL)^{\left\lfloor k/2\right\rfloor}}{NL}\leq\min_{1\leq i,\ j\leq NL}\left\{\left(Y^{k}\right)_{ij}\right\}.
Lemma 3.8.

Under Assumptions 1 and 4, the lower and the upper bounds of (A1)ij\left(A^{-1}\right)_{ij} can be expressed in terms of N,L,ζN,L,\zeta and ρ\rho,

C1(N,L,ζ,ρ)(A1)ijC2(N,L,ζ,ρ),C_{1}(N,L,\zeta,\rho)\leq(A^{-1})_{ij}\leq C_{2}(N,L,\zeta,\rho), (11)

where

C1\displaystyle C_{1} =ζ(4ζN3L3(2ζ32ζρ2ρ3)+8N2L2ρ2(ρ2ζ2)+ζNLρ2(2ζ+ρ)2ρ4)ρ4(ζ2NLρ2)(2NL1)(2NL+1)\displaystyle=\frac{\zeta\left(4\zeta N^{3}L^{3}\left(2\zeta^{3}-2\zeta\rho^{2}-\rho^{3}\right)+8N^{2}L^{2}\rho^{2}\left(\rho^{2}-\zeta^{2}\right)+\zeta NL\rho^{2}(2\zeta+\rho)-2\rho^{4}\right)}{\rho^{4}\left(\zeta^{2}NL-\rho^{2}\right)\left(2NL-1\right)\left(2NL+1\right)}
C2\displaystyle C_{2} =ζ2NLρ(4NL1)(ρ2ζ2NL)(ρ2NLζ)(ρ+2NLζ).\displaystyle=\frac{\zeta^{2}NL\rho(4NL-1)}{\left(\rho^{2}-\zeta^{2}NL\right)\left(\rho-2NL\zeta\right)\left(\rho+2NL\zeta\right)}.
Theorem 3.9.

Under Assumptions 1 and 4, it follows that πijNLC~\pi_{ij}^{*}\leq NL\tilde{C}, for all (i,j)I×J\ (i,j)\in I\times J, where

C~=max{|C1|,C2}max1iN1jL{|(ϵiμi+δjνj)cij2|}.\tilde{C}=\max\{|C_{1}|,C_{2}\}\cdot\max_{\begin{subarray}{c}1\leq i\leq N\\ 1\leq j\leq L\end{subarray}}\left\{\left|(\epsilon_{i}\mu_{i}+\delta_{j}\nu_{j})-\frac{c_{ij}}{2}\right|\right\}.

Theorem 3.9 is of particular interest as it allows us to determine, without computing the inverse of AA, the maximum number of individuals that would be matched between two points i,ji,j. In practice, this enables, for example, the establishment of capacity constraints on routes or spaces.

3.3 Algorithm for computing π\pi^{*}

We now provide an efficient algorithm to compute π++NL\pi^{*}\in\mathbb{R}_{++}^{NL}. This is established in Theorem 3.10. First, let us rewrite matrix AA given in (8) as follows:

A\displaystyle A =Diag(a11,,aNL)+i=1N(ϵi1/2𝐞i𝟏L×1)(ϵi1/2𝐞iT𝟏1×L)+j=1L(δj1/2𝐞j𝟏N×1)(δj1/2𝐞jT𝟏1×N).\displaystyle=\text{Diag}(a_{11},\dots,a_{NL})+\sum_{i=1}^{N}\left(\epsilon_{i}^{1/2}\mathbf{e}_{i}\otimes\mathbf{1}_{L\times 1}\right)\left(\epsilon_{i}^{1/2}\mathbf{e}_{i}^{T}\otimes\mathbf{1}_{1\times L}\right)+\sum_{j=1}^{L}\left(\delta_{j}^{1/2}\mathbf{e}_{j}\otimes\mathbf{1}_{N\times 1}\right)\left(\delta_{j}^{1/2}\mathbf{e}_{j}^{T}\otimes\mathbf{1}_{1\times N}\right).
Theorem 3.10.

For interior solutions π\pi^{*}, Algorithm 1 computes π\pi^{*} in O((N+L)N2L2)O((N+L)N^{2}L^{2}) time.

Algorithm 1 Optimize (a,b,ϵ1,,ϵN,δ1,,δL)(a,b,\epsilon_{1},\dots,\epsilon_{N},\delta_{1},\dots,\delta_{L})
1:Input: Matrices a++NLa\in\mathbb{R}_{++}^{NL}, bNLb\in\mathbb{R}^{NL} and parameters ϵ1,,ϵN,δ1,,δL++\epsilon_{1},\dots,\epsilon_{N},\delta_{1},\dots,\delta_{L}\in\mathbb{R}_{++}
2:Output: πNL\pi^{*}\in\mathbb{R}^{NL}
3:Initialize A1Diag(1/a11,,1/aNL)NL,NLA^{-1}\leftarrow\text{Diag}(1/a_{11},\dots,1/a_{NL})\in\mathbb{R}^{NL,NL}
4:for i1,,Ni\leftarrow 1,\dots,N do
5:     Define u(i)NLu^{(i)}\in\mathbb{R}^{NL} by u(i)ϵi1/2𝐞i𝟏L×1u^{(i)}\coloneqq\epsilon_{i}^{1/2}\mathbf{e}_{i}\otimes\mathbf{1}_{L\times 1}
6:     A1A1A1u(i)u(i)TA11+u(i)TA1u(i)A^{-1}\leftarrow A^{-1}-\dfrac{A^{-1}u^{(i)}u^{(i)T}A^{-1}}{1+u^{(i)T}A^{-1}u^{(i)}} via Sherman-Morrison formula
7:end for
8:for j1,,Lj\leftarrow 1,\dots,L do
9:     Define v(j)NLv^{(j)}\in\mathbb{R}^{NL} by v(j)δj1/2𝐞j𝟏N×1v^{(j)}\coloneqq\delta_{j}^{1/2}\mathbf{e}_{j}\otimes\mathbf{1}_{N\times 1}
10:     A1A1A1v(j)v(j)TA11+v(j)TA1v(j)A^{-1}\leftarrow A^{-1}-\dfrac{A^{-1}v^{(j)}v^{(j)T}A^{-1}}{1+v^{(j)T}A^{-1}v^{(j)}} via Sherman-Morrison formula
11:end for
12:return A1bA^{-1}b
Time Sparse AA Galactic Authors
O(N3L3)O(N^{3}L^{3}) No No Gaussian Elimination
O((NL)2.81)O((NL)^{2.81}) No No Strassen, (1969)
O((NL)2.331645)O((NL)^{2.331645}) Yes Yes Peng and Vempala, (2024)
O((NL)2.371339)O((NL)^{2.371339}) No Yes Alman et al., (2025)
O((N+L)N2L2)O((N+L)N^{2}L^{2}) No No This paper
Table 1: Algorithms for solving our linear system. Assume AA is sparse if it has O~(NL)\widetilde{O}(NL) nonzero entries. “Galactic” refers to an algorithm wonderful in its asymptotic behavior, but is never used to actual compute anything (Lipton, (2010)).

It was observed by Vassilevska, (2015) that inversion can be reduced to multiplication with an equivalent runtime for Strassen, (1969) and Alman et al., (2025). Even though Peng and Vempala, (2024) and Alman et al., (2025) provide the best bounds, they are impractical due to large constants, leaving us with the remaining three algorithms for practical purposes. Among these, when L=Θ(N)L=\Theta(N), our algorithm has the tightest upper bound compared to classical Gaussian elimination and an inversion derived from Strassen multiplication.

3.4 Comparative statics

Although we know how to compute π\pi^{*} through Neumann’s series or Algorithm 1, obtaining a closed-form expression for πij\pi_{ij}^{*} using these techniques is not straightforward. Therefore, to facilitate comparative statics, one possible approach is to approximate the matrix A1A^{-1} using Neumann’s series. First, assume that A1D1A^{-1}\simeq D^{-1}. This simplification allows us to derive a closed-form expression for πij\pi_{ij}^{*}, providing initial insights. Under the assumption A1D1A^{-1}\simeq D^{-1}, we obtain:

πij2(ϵiμi+δjνj)cij2aij.\pi_{ij}^{*}\simeq\frac{2(\epsilon_{i}\mu_{i}+\delta_{j}\nu_{j})-c_{ij}}{2a_{ij}}.

From this expression, it follows that πij/aij,πij/cij<0\partial\pi_{ij}^{*}/\partial a_{ij},\partial\pi_{ij}^{*}/\partial c_{ij}<0 and πij/ϵi,πij/δj\partial\pi_{ij}^{*}/\partial\epsilon_{i},\partial\pi_{ij}^{*}/\partial\delta_{j}, πij/μi,πij/νj>0\partial\pi_{ij}^{*}/\partial\mu_{i},\partial\pi_{ij}^{*}/\partial\nu_{j}>0. These results align with standard economic intuition. However, under this rough approximation, we obtain πij/θk=0\partial\pi_{ij}^{*}/\partial\theta_{k\ell}=0 for (k,)(i,j)(k,\ell)\neq(i,j), which is unrealistic since we expect a substitution effect. To improve upon this, consider a refined approximation:

A1D1D1XD1=D1(D1)2X.A^{-1}\sim D^{-1}-D^{-1}XD^{-1}=D^{-1}-(D^{-1})^{2}X.

From smooth comparative statics, if π++NL\pi^{*}\in\mathbb{R}_{++}^{NL} is an interior solution to 𝒫CP\mathcal{P}_{CP} associated with the parameter vector (θ¯,ϵ,δ,μ,ν)++2NL×++N×++L×++N×++L(\overline{\theta},\epsilon,\delta,\mu,\nu)\in\mathbb{R}_{++}^{2NL}\times\mathbb{R}_{++}^{N}\times\mathbb{R}_{++}^{L}\times\mathbb{R}_{++}^{N}\times\mathbb{R}_{++}^{L}, then:

[πijθk]=A(θ¯,ϵ,δ,μ,ν)1[INL×NL| 2Diag(π11,,πNL)].\left[\frac{\partial\pi_{ij}^{*}}{\partial\theta_{k\ell}}\right]=-A_{(\overline{\theta},\epsilon,\delta,\mu,\nu)}^{-1}[I_{NL\times NL}\,|\,2\text{Diag}(\pi_{11}^{*},\cdots,\pi_{NL}^{*})]. (12)

Thus, under the approximation A1D1(D1)2XA^{-1}\sim D^{-1}-(D^{-1})^{2}X, we obtain:

[πijθk]=[πijck|πijak][D1(D1)2X|AΠ,21],\left[\frac{\partial\pi_{ij}^{*}}{\partial\theta_{k\ell}}\right]=\left[\frac{\partial\pi_{ij}^{*}}{\partial c_{k\ell}}\,\bigg{|}\,\frac{\partial\pi_{ij}^{*}}{\partial a_{k\ell}}\right]\simeq-\left[D^{-1}-(D^{-1})^{2}X\,|\,A_{\Pi,2}^{-1}\right], (13)

where AΠ,21A_{\Pi,2}^{-1} consists of multiplying column ijij of D1(D1)2XD^{-1}-(D^{-1})^{2}X by πij\pi_{ij}^{*}. From (13), if maxi,j{ϵi+δj}<1\max_{i,j}\{\epsilon_{i}+\delta_{j}\}<1, then: πij/θij<0\partial\pi_{ij}^{*}/\partial\theta_{ij}<0 for all (i,j)I×J(i,j)\in I\times J, πij/θk>0\partial\pi_{ij}^{*}/\partial\theta_{k\ell}>0 for iki\neq k and j=j=\ell or i=ki=k and jj\neq\ell, πij/θk=0\partial\pi_{ij}^{*}/\partial\theta_{k\ell}=0 if iki\neq k and jj\neq\ell. Then, we conclude from (13) that:

πij/cij=(1(ϵi+δj))/aij2<0,\partial\pi_{ij}^{*}/\partial c_{ij}=-(1-(\epsilon_{i}+\delta_{j}))/a_{ij}^{2}<0,
πij/ci=ϵi/aij2>0,πij/ckj=δj/aij2>0,πij/ck=0 if ik,j.\partial\pi_{ij}^{*}/\partial c_{i\ell}=\epsilon_{i}/a_{ij}^{2}>0,\quad\partial\pi_{ij}^{*}/\partial c_{kj}=\delta_{j}/a_{ij}^{2}>0,\quad\partial\pi_{ij}^{*}/\partial c_{k\ell}=0\text{ if }i\neq k,j\neq\ell.
πij/aij=2πij(1(ϵi+δj))/aij2<0,πij/ai=2πiϵi/aij2>0,\partial\pi_{ij}^{*}/\partial a_{ij}=-2\pi_{ij}^{*}(1-(\epsilon_{i}+\delta_{j}))/a_{ij}^{2}<0,\quad\partial\pi_{ij}^{*}/\partial a_{i\ell}=2\pi_{i\ell}^{*}\epsilon_{i}/a_{ij}^{2}>0,
πij/akj=2πkjδj/aij2>0,πij/ak=0 if ik,j.\partial\pi_{ij}^{*}/\partial a_{kj}=2\pi_{kj}^{*}\delta_{j}/a_{ij}^{2}>0,\quad\partial\pi_{ij}^{*}/\partial a_{k\ell}=0\text{ if }i\neq k,j\neq\ell.

These results are much closer to what we would expect. Indeed, we now observe a substitution effect: if the cost of matching individuals of type ii with jj increases ceteris-paribus, then the number of individuals of type ii matched with \ell (where j\ell\neq j) increases. However, it is important to note that these results are obtained under a truncated Neumann series approximation, and should be interpreted accordingly—as an approximation. Nevertheless, note that under Assumptions 1, 2, and 3, it is possible to compute the effects of the parameters directly using (10). In such case, similar conclusions can be derived.

3.5 Case N=LN=L

The case N=L>1N=L>1 is particularly important in the classical literature on the marriage market (Roth and Sotomayor,, 1990). Similarly, as we will see in Section 4, it is of particular interest when analyzing the healthcare sector in Peru. If the solution in our model is interior, the problem reduces to solving a system of linear equations, and the condition N=LN=L improves the upper bound on the number of operations required by Algorithm 1 compared to folklore linear system solvers. On the other hand, classical transportation problems and their variants require approximation algorithms for solving convex optimization problems in finite dimensions (Merigot and Thibert, (2020)).

4 Examples and applications

4.1 Health care

The Peruvian healthcare system is characterized by being a fragmented system with three main types of medical care centers: SIS (Seguro Integral de Salud), EsSalud, and EPS (Entidades Prestadoras de Salud) (Anaya-Montes and Gravelle,, 2024). EPS corresponds to private health insurance offered by companies such as Rimac, Mapfre, Pacífico, La Positiva, among others. These insurances are aimed at formal workers seeking additional coverage beyond mandatory insurance. On the other hand, EsSalud is the public health insurance financed by contributions from formal workers and employers, both from the private and public sectors. Finally, SIS is a universal public insurance targeting people in poverty, informals, or without the ability to pay EPS. For the year of the pandemic (2020), SIS and EsSalud together covered more than 80% of the population, while less than 10%10\% was covered by EPS, see Table 2.

Insurance Covered people
EPS 8%
EsSalud 30%
SIS 53%
Table 2: Percentage of enrollees in Peru’s healthcare system by type of medical care center in 2020, before COVID-19. At that time, Peru’s population was 32,838,579 (Data Commons,, 2025).

Under normal circumstances, an individual insured by SIS cannot be simultaneously enrolled in EsSalud or an EPS, and vice versa. The only permitted association is between EsSalud and EPS, where private insurance acts as a complementary coverage to the public system (Anaya-Montes and Gravelle,, 2024; Velásquez,, 2020). Ideally, an optimal allocation would ensure that informal workers are covered by SIS, while formal workers are appropriately distributed between EsSalud and EPS. However, in practice, overlapping affiliations occur, and individuals often seek medical care outside their designated system. Furthermore, a similar issue arises when categorizing healthcare utilization by type of illness: specialized medical centers create unintended overlaps in patient distribution across insurance networks. Additional issues related to congestion and deficiencies are detailed in Table 3.

Identified Problem Quantifiable Indicator Source
Shortage of medical personnel in primary healthcare. 12 doctors per 10,000 inhabitants, far from the WHO-recommended standard of 43. Bendezu-Quispe et al., (2020).
Lack of hospital beds in Peru’s healthcare system. 1.6 beds per 1,000 inhabitants, below the regional average. World Bank, (2020).
Congestion in neonatal intensive care units in public hospitals 50% of units experience inefficiency due to patient overcrowding. Arrieta and Guillén, (2017).
Inefficiencies in patient referral system. High percentage of patients treated in facilities not equipped for their conditions.101010In 2016, the MINSA (Ministry of Health) reported a shortage of over 47,000 healthcare professionals. Additionally, 36% of medium and high-complexity facilities lacked sufficient personnel, 44% did not have adequate equipment, and 25% had infrastructure deficiencies. Soto, (2019).
Coverage noncompliance, high waiting times, and some values of medical performance per hour out of range. Coverage of up to 86% for certain complex treatments. EsSalud, 2025a .
Deferrals in certain cities are very high. More than 23% of appointments were postponed (Jan-Mar 2025). EsSalud, 2025b .
Table 3: Issues in patient allocation within Peru’s healthcare system.

Given Table 3, it is evident that Peru’s healthcare system faces significant issues, including service inefficiencies, congestion costs, and saturation. Our model effectively captures these elements, unlike traditional matching models. Our approach can help identify critical areas for improvement, optimizing healthcare demand coverage and reducing congestion costs by analyzing the effect of parameters over π\pi^{*}. It allows for the prioritization of interventions to address the most severe inefficiencies. To achieve this, estimating parameters is essential. This aligns with empirical research such as Doval et al., (2024) and the methodologies outlined in Agarwal, Nikhil and Somaini, Paulo, (2023), which provide a structured framework to evaluate these inefficiencies.

In Example B.1, we simulate three groups of patients in three healthcare networks (SIS, EsSalud, EPS). Group 3 consists of individuals who can afford an EPS for high-complexity care. High-complexity care refers to a set of less frequent and more complex health interventions, such as advanced surgical procedures and oncological treatments. Group 2 consists of formal workers who can only use EsSalud for high-complexity care. Note that they are not excluded from affording an EPS, but if they have one, it will be used exclusively for low-complexity care. Group 1 consists of the remaining individuals, including informal workers.

A particular edge case in Group 1 includes wealthy individuals engaged in illegal activities (e.g., drug traffickers or businessman avoiding taxes). These individuals are informal workers but may still afford an EPS. The central planner reasonably operates under the assumption that such cases do not exist. Moreover, it operates assuming no overlaps.111111It is important to emphasize that our model is designed to be executed at a specific point in time. Thus, the planner does not seek overlaps, and therefore, they are not enabled in the model.

Groups 1 and 3 exhibit significant differences in characteristics, such as socioeconomic status, which increases the cost of mismatching between them. The cost is even higher when there are bureaucratic or legal frictions, as seen in the case of groups 1 and 2, where an EsSalud insured individual cannot be covered simultaneously by SIS, and vice versa (Anaya-Montes and Gravelle,, 2024). Our model accounts for this heterogeneity in costs, recognizing that legal constraints impose significantly higher penalties than other sources of mismatching. For instance, while receiving treatment for a simple illness at a high-complexity facility incurs some inefficiency, the cost associated with legal barriers preventing access to appropriate healthcare is substantially greater. Moreover, incorporating penalties and weighted constraints allows the model to capture excess demand effectively. Unlike the solutions in traditional models (see Example B.2), our model (Example B.1) assigns almot zero or one to the match between groups 1 and 2.

Example B.3 highlights the flexibility of our model by introducing ε1,,εN\varepsilon_{1},\dots,\varepsilon_{N} and δ1,,δL\delta_{1},\dots,\delta_{L}. In the Peruvian context, the government may prioritize patients from EsSalud due to its connection to formal employment, resulting in higher weights assigned to the constraint related to μ2\mu_{2}. On the other hand, the goal is to prevent SIS from becoming overcrowded while maximizing facilities utilization. This objective is achieved, as the example shows that row 2 and column 1 bear the highest load without exceeding μi\mu_{i} or δj\delta_{j}, with respect to the other rows and columns (proportionally to the target mass).

In Example B.4, we set i=1Nμi>j=1Lνj\sum_{i=1}^{N}\mu_{i}>\sum_{j=1}^{L}\nu_{j}, which is crucial for an appropriate representation of excess demand, but additionally. Quadratic costs exacerbate the excess demand. The observed effect, due to the intentionally chosen parameters, reflects that almost no one from group 2 is matched. The parameters can certainly be adjusted to obtain more realistic values. The example illustrates how our model effectively captures excess demand, a present phenomenon in the Peruvian reality, see Table 3.

4.2 Education

The education system in Peru is highly complex due to its high degree of decentralization at both the primary and higher education levels. While this decentralization aims to improve educational management, it has generated significant disparities between urban and rural regions (Laveriano,, 2010). Only a few subsystems, such as the High-Performance Schools (COAR), maintain a centralized management model, ensuring homogeneous standards (Alcázar and Balarin,, 2021). However, despite not being a centralized system - which would make our model better suited - the level of congestion in Lima and its impact on education justify the introduction of a strictly convex structure. Moreover, since not everyone enrolls in school, partly due to geographic and access limitations, the penalties are well-founded, instead of restrictions.

Specifically, in Peru, infrastructure disparities and access constraints have affected educational equity (Alcázar and Balarin,, 2021). Geographic barriers, particularly the Andes and the Amazon rainforest, exacerbate these inequalities by severely limiting accessibility. These mobility constraints directly impact school attendance, contributing to persistent enrollment gaps, especially in secondary education (Alba-Vivar,, 2025). Tables 4 and 5 illustrate the evolution of enrollment rates in primary and secondary education, showing gradual improvement but persistent urban-rural disparities.

Area 2021 2022 2023 2024 Variation 2024/2023
National 87.1 91.3 91.3 96.0 4.7%
Urban 87.1 91.2 91.7 96.7 5%
Rural 87.1 91.7 89.8 93.6 3.8%
Table 4: Net enrollment rate in primary education in Peru (2021-2024) (INEI,, 2024).
Area 2021 2022 2023 2024 Variation 2024/2023
National 80.1 81.5 86.0 88.7 2.7%
Urban 80.7 81.4 86.7 88.2 1.5%
Rural 78.1 81.8 83.6 90.0 6.4%
Table 5: Net enrollment rate in secondary education in Peru (2021-2024) (INEI,, 2024).

A comprehensive study on the impact of congestion on enrollment is provided by Alba-Vivar, (2025)121212Alba found that the 17% reduction in travel time (equivalent to 30 minutes per day) increased the enrollment rate by 6.3%., highlighting its significance, in line with the findings of Agarwal and Somaini, (2019), thus, justifying the relevance of our model. Indeed, congestion is a major issue in Peru’s education system, particularly in urban areas. According to World Bank, (2024), Lima is one of the most congested cities in Latin America. It suffers from severe traffic bottlenecks that disproportionately affect students from lower-income districts (Alba-Vivar,, 2025). When large numbers of students travel from the same location to the same school, the primary roads connecting them become saturated, increasing commuting times.

Thus, the Peruvian education system is characterized by lack of access, excessive demand, and limited supply, combined with sensitivity to physical traffic congestion, in contrast to certain education systems, such as the French one (Eurydice - European Commission,, 2024; Ministère de l’Éducation Nationale et de la Jeunesse,, 2024), which is centralized, homogeneous, ensures universal education, and benefits from a much more modern transportation system. Therefore, the model we propose is well-suited to represent this situation (other cities with congestion such as Mumbai, Jakarta or São Paulo (Kikuchi and Hayashi,, 2020) could also be studied). Traditional OT models, by imposing the condition iμi=jνj\sum_{i}\mu_{i}=\sum_{j}\nu_{j}, do not apply as effectively. Our model is crucial because, in countries or cities with constraints, allowing for supply or demand imbalances—i.e., schools not reaching full capacity or not all students being enrolled—is a more realistic assumption.

Example B.5 is key to understanding the education case. We consider four student groups (N=4N=4) and three schools (L=3L=3). The groups represent: wealthy high-achieving students (i=1i=1), poor high-achieving students (i=2i=2), wealthy low-achieving students (i=3i=3), and poor low-achieving students (i=4i=4). School j=1j=1 is top-ranked and expensive, j=2j=2 has an average ranking and a mid-range price, and j=3j=3 is lower-ranked but more affordable. Transportation costs reflect the greater commuting difficulties faced by poor students, who usually use public transportation that runs along the most congested main avenues (Alba-Vivar,, 2025), while linear costs capture preferences, ensuring that better students prefer better schools while weaker students do not, controlling also by monetary cost. The solutions highlight key differences: 𝒫CP\mathcal{P}_{CP} introduces quadratic penalties, leading to assignments where students with fewer resources, for whom matching is more costly due to their location and the assigned mode of transportation (as transportation in their area is precarious), are not matched. In contrast, those who have better facilities (positive correlation between socioeconomic status and the quality of transportation) are matched more easily. Moreover, high-achieving wealthy students are never matched with low-cost, low-quality institutions, and low-achieving poor students are never matched with the top, expensive school. Hence, our model captures the complications arising from transportation costs and the unfortunate reality that education cannot be guaranteed for everyone. For example, Peru’s geography excludes certain populations in the highlands and jungle, making it very costly for the central planner to complete the match. In Example B.5, 70% of the top wealthy students are matched, but only almost 3 out of 10 of the poorer, less top-performing students are matched. In this case, both the linear and quadratic models capture the fact that preferences result in 0 individuals from group i=1i=1 being matched to j=3j=3. However, once again, they do not provide the flexibility for jπijμi\sum_{j}\pi_{ij}^{*}\neq\mu_{i}, required in some contexts.

5 Conclusions

This paper introduces a novel framework for analyzing mismatching, congestion effects, and supply-demand imbalances in developing economies matching markets. Our model extends the classical optimal transport framework by incorporating heterogeneous quadratic regularization and penalty terms for deviations from target allocations. Unlike traditional approaches that impose strict equality constraints, our formulation allows for more realistic depictions of inefficiencies, capturing excess demand, underutilization, and the role of heterogenous congestion costs. We have also analyzed the resulting optimization problem in detail, establishing conditions for the existence and uniqueness of solutions. Furthermore, we propose both analytical and computational methods to effectively compute interior solutions. Our approach provides not only theoretical insights but also practical tools for addressing real-world mismatching and congestion issues.

In summary, our model provides considerable flexibility, allowing for heterogeneity in congestion costs, i.e., some aija_{ij} could be very small. Removing restrictions enables a better approximation of the reality in developing countries, where equilibrium equations Π(μ,ν)\Pi(\mu,\nu) do not hold uniformly.

Applying our model to Peru’s healthcare sector highlights its ability to explain observed inefficiencies, and provide more flexibility to the central planner when they cannot ensure matching the entire population adequately, which is common in developing or poor countries. The fragmented nature of the public insurance system exacerbates mismatching, leading to suboptimal patient distribution and increased congestion in specific medical centers. Our framework captures these distortions by introducing quadratic congestion costs and penalizing deviations from optimal allocations. Although we have focused on the Peruvian case due to the aforementioned data availability constraints, the model can be applied to centralized matching situations with heterogeneous congestion costs and excess supply and demand.

Future research could extend this framework to dynamic settings, stochastic environments where parameters evolve over time (e.g., Markov Jump Linear Systems, since at different times of the day, traffic is less sensitive to new cars), and empirical validation using real-world matching data. Determining whether the solution is interior in terms of the parameters is not a trivial matter and remains to be explored. Furthermore, exploring policy implications, such as optimal subsidy structures or decentralized decision-making mechanisms, could provide valuable information to address inefficiencies in public service delivery.

Our model aims to provide central planners with a mathematically flexible tool to approximate allocation problems (without restricting solutions to the integer domain), while allowing for imbalances between supply and demand and incorporating congestion costs. This is particularly relevant in contexts where congestion costs are significant and where, unlike in highly developed countries, ensuring universal access to healthcare and education, as well as preventing the saturation of these services, remains a major challenge.

Appendix A Proofs

Proof of Lemma 3.1.

First, det(D)=(i,j)I×Jaij>0\text{det}(D)=\prod_{(i,j)\in I\times J}a_{ij}>0, det(E)=det(F)=0\text{det}(E)=\text{det}(F)=0. On the other hand, the eigenvalues of EE are non-negative since the eigenvalues of Diag(ϵ1,,ϵN)\text{Diag}(\epsilon_{1},...,\epsilon_{N}) are ϵi>0\epsilon_{i}>0 and the eigenvalues of 𝟏L×L\mathbf{1}_{L\times L} belong to {0,L}\{0,L\}. Hence, the products of eigenvalues ϵi0\epsilon_{i}\cdot 0 and ϵiL\epsilon_{i}\cdot L are non-negative, and so, EE is positive semi-definite. Similarly, FF is positive semi-definite. Thus, AA is the sum of a diagonal and positive definite matrix and two other symmetric and semi-positive definite matrices. According to Zhan, (2005)131313For Minkowski’s determinant inequality and its generalizations, see Marcus and Gordon, (1970), Artstein-Avidan, Shiri and Giannopoulos, Apostolos and Milman, Vitali D., (2015).

det(A)=det(D+E+F)det(D+E)+det(F)det(D)+det(E)+det(F)>0.\text{det}(A)=\text{det}(D+E+F)\geq\text{det}(D+E)+\text{det}(F)\geq\text{det}(D)+\text{det}(E)+\text{det}(F)>0.\qed
Proof of Lemma 3.2.

Let A=D+XA=D+X, where X=E+FX=E+F. Then,

A1=(D+X)1=(I(1)D1X)1D1.A^{-1}=(D+X)^{-1}=(I-(-1)D^{-1}X)^{-1}D^{-1}.

Then, for all λσ(D1X)\lambda\in\sigma(D^{-1}X), λmaxi,j{1/aij}(λmaxE+λmaxF)\lambda\leq\max_{i,j}\left\{1/a_{ij}\right\}\cdot(\lambda_{\max}^{E}+\lambda_{\max}^{F}), where λmaxE=maxi{ϵi}L\lambda_{\max}^{E}=\max_{i}\{\epsilon_{i}\}\cdot L and λmaxF=maxj{δj}N.\lambda_{\max}^{F}=\max_{j}\{\delta_{j}\}\cdot N. Thus, D1Xσ<1\left\lVert D^{-1}X\right\rVert_{\sigma}<1 141414σ\left\lVert\cdot\right\rVert_{\sigma} denotes the spectral norm.,

(I(1)D1X)1=k=0(1)k(D1X)k.(I-(-1)D^{-1}X)^{-1}=\sum_{k=0}^{\infty}(-1)^{k}(D^{-1}X)^{k}.

Then, by multiplying the series on the right hand side by D1D^{-1}, the claim follows. ∎

Proof of Theorem 3.3.

Define

n=A1Sn=(k=n+1(1)k(D1X)k)D1.\mathcal{E}_{n}=A^{-1}-S_{n}=\left(\sum_{k=n+1}^{\infty}(-1)^{k}(D^{-1}X)^{k}\right)D^{-1}.

On one hand πnπ=nbnb2\left\lVert\pi_{n}-\pi^{*}\right\rVert_{\infty}=\left\lVert\mathcal{E}_{n}b\right\rVert_{\infty}\leq\left\lVert\mathcal{E}_{n}b\right\rVert_{2}. On the other hand,

nb2NLk=n+1(1)k(D1X)kσD1bNLD1Xσn+1D1b1D1Xσ.\left\lVert\mathcal{E}_{n}b\right\rVert_{2}\leq\sqrt{NL}\left\lVert\sum_{k=n+1}^{\infty}(-1)^{k}(D^{-1}X)^{k}\right\rVert_{\sigma}\left\lVert D^{-1}b\right\rVert_{\infty}\leq\frac{\sqrt{NL}\left\lVert D^{-1}X\right\rVert_{\sigma}^{n+1}\left\lVert D^{-1}b\right\rVert_{\infty}}{1-\left\lVert D^{-1}X\right\rVert_{\sigma}}.

Given ε>0\varepsilon>0, let

Nε=max{1,|logD1Xσ(ε(1D1Xσ)NLD1b)|}.N_{\varepsilon}=\max\left\{1,\left\lceil\left|\log_{\left\lVert D^{-1}X\right\rVert_{\sigma}}\left(\frac{\varepsilon\left(1-\left\lVert D^{-1}X\right\rVert_{\sigma}\right)}{\sqrt{NL}\left\lVert D^{-1}b\right\rVert_{\infty}}\right)\right|\right\rceil\right\}.

For nNεn\geq N_{\varepsilon}, we have πnπ<ϵ\left\lVert\pi_{n}-\pi^{*}\right\rVert_{\infty}<\epsilon. ∎

Proof of Theorem 3.4.

By using classical properties of Kronecker product, we have

A1\displaystyle A^{-1} =Iβ+[k=1(1)k(1β)k(Diag(ϵ1,,ϵN)𝟏L×L)k]D1\displaystyle=\frac{I}{\beta}+\left[\sum_{k=1}^{\infty}(-1)^{k}\left(\frac{1}{\beta}\right)^{k}(\text{Diag}(\epsilon_{1},\dots,\epsilon_{N})\otimes\mathbf{1}_{L\times L})^{k}\right]D^{-1}
=Iβ+1βLk=1(1)k(Lβ)k(Diag(ϵ1k,,ϵNk)𝟏L×L)\displaystyle=\frac{I}{\beta}+\frac{1}{\beta L}\sum_{k=1}^{\infty}(-1)^{k}\left(\frac{L}{\beta}\right)^{k}(\text{Diag}(\epsilon_{1}^{k},\dots,\epsilon_{N}^{k})\otimes\mathbf{1}_{L\times L})
=Iβ+1βLDiag(k=1(1)k(Lϵ1β)k,,k=1(1)k(LϵNβ)k)𝟏L×L\displaystyle=\frac{I}{\beta}+\frac{1}{\beta L}\text{Diag}\left(\sum_{k=1}^{\infty}(-1)^{k}\left(\frac{L\epsilon_{1}}{\beta}\right)^{k},\dots,\sum_{k=1}^{\infty}(-1)^{k}\left(\frac{L\epsilon_{N}}{\beta}\right)^{k}\right)\otimes\mathbf{1}_{L\times L}
=Iβ+1βDiag(ϵ1β+Lϵ1,,ϵNβ+LϵN)𝟏L×L.\displaystyle=\frac{I}{\beta}+\frac{1}{\beta}\text{Diag}\left(-\frac{\epsilon_{1}}{\beta+L\epsilon_{1}},\dots,-\frac{\epsilon_{N}}{\beta+L\epsilon_{N}}\right)\otimes\mathbf{1}_{L\times L}.\qed
Proof of Lemma 3.6.

The claim certainly holds for k=1k=1. Now, assuming it holds for k1k\geq 1, it follows by induction that

max1i,jNL{(Yk+1)ij}=max1i,jNL{=1NL(Yk)iYj}=1NL(2NL)kNL2=(2NL)k+1NL.\max_{1\leq i,j\leq NL}\left\{\left(Y^{k+1}\right)_{ij}\right\}=\max_{1\leq i,j\leq NL}\left\{\sum_{\ell=1}^{NL}\left(Y^{k}\right)_{i\ell}Y_{\ell j}\right\}\leq\sum_{\ell=1}^{NL}\frac{(2NL)^{k}}{NL}\cdot 2=\frac{(2NL)^{k+1}}{NL}.\qed
Proof Lemma 3.7.

We have two distinct possibilities.

Case k=2mk=2m with m1m\geq 1 . We now proceed by induction. We will manually verify that each (Y2)ij==1NLYiYj\left(Y^{2}\right)_{ij}=\displaystyle\sum_{\ell=1}^{NL}Y_{i\ell}\cdot Y_{\ell j} satisfies the inequality. On the diagonal we have

(Y2)ii==1iNLYiYi+YiiYii4.\left(Y^{2}\right)_{ii}=\sum_{\begin{subarray}{c}\ell=1\\ \ell\neq i\end{subarray}}^{NL}Y_{i\ell}\cdot Y_{\ell i}+Y_{ii}\cdot Y_{ii}\geq 4.

For iji\neq j, set

0=N(jNi1N1)+i.\ell_{0}=N\left(\left\lceil\frac{j}{N}\right\rceil-\left\lfloor\frac{i-1}{N}\right\rfloor-1\right)+i.

Then 0i(modN)\ell_{0}\equiv i\pmod{N} and so Yi01Y_{i\ell_{0}}\geq 1. On the other hand,

0[N(jN1)+1,NjN]\ell_{0}\in\left[N\left(\left\lceil\frac{j}{N}\right\rceil-1\right)+1,N\left\lceil\frac{j}{N}\right\rceil\right]

implies 0/N=j/N\left\lceil\ell_{0}/N\right\rceil=\left\lceil j/N\right\rceil. So, Y0j1Y_{\ell_{0}j}\geq 1. It follows that

(Y2)ij==10NLYiYj+Yi0Y0j1.\left(Y^{2}\right)_{ij}=\sum_{\begin{subarray}{c}\ell=1\\ \ell\neq\ell_{0}\end{subarray}}^{NL}Y_{i\ell}\cdot Y_{\ell j}+Y_{i\ell_{0}}\cdot Y_{\ell_{0}j}\geq 1.

Assuming min1i,jNL{(Y2m)ij}(NL)m/NL\min_{1\leq i,j\leq NL}\left\{\left(Y^{2m}\right)_{ij}\right\}\geq(NL)^{m}/NL holds for m1m\geq 1, we obtain

min1i,jNL{(Y2m+2)ij}=min1i,jNL{=1NL(Y2m)i(Y2)j}=1NL(NL)mNL=(NL)m+1NL.\min_{1\leq i,j\leq NL}\left\{\left(Y^{2m+2}\right)_{ij}\right\}=\min_{1\leq i,j\leq NL}\left\{\sum_{\ell=1}^{NL}\left(Y^{2m}\right)_{i\ell}\cdot\left(Y^{2}\right)_{\ell j}\right\}\geq\sum_{\ell=1}^{NL}\frac{(NL)^{m}}{NL}=\frac{(NL)^{m+1}}{NL}.

Case k=2m+1k=2m+1 with m1m\geq 1 . We prove this by induction on mm starting with the base case Y3Y^{3}:

(Y3)ij==1NL(Y2)iYj==1jNL(Y2)iYj+(Y2)ijYjj2.\left(Y^{3}\right)_{ij}=\sum_{\ell=1}^{NL}\left(Y^{2}\right)_{i\ell}\cdot Y_{\ell j}=\sum_{\begin{subarray}{c}\ell=1\\ \ell\neq j\end{subarray}}^{NL}\left(Y^{2}\right)_{i\ell}\cdot Y_{\ell j}+\left(Y^{2}\right)_{ij}\cdot\,Y_{jj}\geq 2.

Assume the statement holds for m1m\geq 1, then

min1i,jNL{(Y2m+3)ij}=min1i,jNL{=1NL(Y2m+1)i(Y2)j}=1NL(NL)mNL=(NL)m+1NL.\min_{1\leq i,j\leq NL}\left\{\left(Y^{2m+3}\right)_{ij}\right\}=\min_{1\leq i,j\leq NL}\left\{\sum_{\ell=1}^{NL}\left(Y^{2m+1}\right)_{i\ell}\cdot\left(Y^{2}\right)_{\ell j}\right\}\geq\sum_{\ell=1}^{NL}\frac{(NL)^{m}}{NL}=\frac{(NL)^{m+1}}{NL}.

This completes the proof. ∎

Proof of Lemma 3.8.

We write A1A^{-1} in terms of YY

A1=1ρ(I(ζρ)Y+m1(ζρ)2mY2mm1(ζρ)2m+1Y2m+1)A^{-1}=\frac{1}{\rho}\left(I-\left(\frac{\zeta}{\rho}\right)Y+\sum_{m\geq 1}\left(\frac{\zeta}{\rho}\right)^{2m}Y^{2m}-\sum_{m\geq 1}\left(\frac{\zeta}{\rho}\right)^{2m+1}Y^{2m+1}\right)

and apply Lemmas 3.6 and 3.7 to bound the series as follows,

ζ2NLρ2ζ2NLm1(ζρ)2m(Y2m)ij4ζ2N2L2ρ24ζ2N2L2\frac{\zeta^{2}NL}{\rho^{2}-\zeta^{2}NL}\leq\sum_{m\geq 1}\left(\frac{\zeta}{\rho}\right)^{2m}\left(Y^{2m}\right)_{ij}\leq\frac{4\zeta^{2}N^{2}L^{2}}{\rho^{2}-4\zeta^{2}N^{2}L^{2}}
ρ3ρ(ρ2ζ2NL)m1(ζρ)2m+1(Y2m+1)ij8ζ3N2L2ρ(ρ24ρ2N2L2).\frac{\rho^{3}}{\rho(\rho^{2}-\zeta^{2}NL)}\leq\sum_{m\geq 1}\left(\frac{\zeta}{\rho}\right)^{2m+1}\left(Y^{2m+1}\right)_{ij}\leq\frac{8\zeta^{3}N^{2}L^{2}}{\rho(\rho^{2}-4\rho^{2}N^{2}L^{2})}.

Therefore, (Aij)1(A_{ij})^{-1} is bounded from above by

1ρ(1+4ζ2N2L2ρ24ζ2N2L2ρ3ρ(ρ2ζ2NL)),\frac{1}{\rho}\left(1+\frac{4\zeta^{2}N^{2}L^{2}}{\rho^{2}-4\zeta^{2}N^{2}L^{2}}-\frac{\rho^{3}}{\rho(\rho^{2}-\zeta^{2}NL)}\right),

and from below by

1ρ(2(ζρ)+ζ2NLρ2ζ2NL8ζ3N2L2ρ(ρ24ρ2N2L2)).\frac{1}{\rho}\left(-2\left(\frac{\zeta}{\rho}\right)+\frac{\zeta^{2}NL}{\rho^{2}-\zeta^{2}NL}-\frac{8\zeta^{3}N^{2}L^{2}}{\rho(\rho^{2}-4\rho^{2}N^{2}L^{2})}\right).

From here, (11) follows. ∎

Proof of Theorem 3.9.

By triangle inequality,

πij\displaystyle\pi^{*}_{ij} π\displaystyle\leq||\pi^{*}||_{\infty}
=max1iN1jL{|k=1NL(A1)(i1)L+jkbk/LkL(k1)/L|}\displaystyle=\max_{\begin{subarray}{c}1\leq i\leq N\\ 1\leq j\leq L\end{subarray}}\left\{\left|\sum_{k=1}^{NL}\left(A^{-1}\right)_{(i-1)L+j\quad k}\cdot b_{\left\lceil k/L\right\rceil\quad k-L\left\lfloor(k-1)/L\right\rfloor}\right|\right\}
k=1NLmax1iN1jL|(A1)ij|max1iN1jL|bij|\displaystyle\leq\sum_{k=1}^{NL}\max_{\begin{subarray}{c}1\leq i\leq N\\ 1\leq j\leq L\end{subarray}}\left|\left(A^{-1}\right)_{ij}\right|\cdot\max_{\begin{subarray}{c}1\leq i\leq N\\ 1\leq j\leq L\end{subarray}}\left|b_{ij}\right|
=NLC~.\displaystyle=NL\tilde{C}.\qed
Proof of Theorem 3.10.

Consider Algorithm 1. It is easy to see that each prefix sum of AA is invertible. Hence, we can iteratively apply the Sherman-Morrison formula with a rank-1 update at each step. Then, it is clear that Lines 3 and 12 take O(N2L2)O\left(N^{2}L^{2}\right). First, the number of iterations for the for-loops on Lines 4-7 and 8-11 is N+LN+L. We then show that each time we enter any for-loop, the time spent is O(N2L2)O\left(N^{2}L^{2}\right). Computing 1+wTA1w1+w^{T}A^{-1}w takes O(N2L2)O\left(N^{2}L^{2}\right), so the only possible optimization is finding the optimal parenthesization for the product A1wwTA1A^{-1}ww^{T}A^{-1}. Since there are only five possible ways to parenthesize the expression, we determine by brute force that computing (A1w)(wTA1)(A^{-1}w)(w^{T}A^{-1}) also takes O(N2L2)O\left(N^{2}L^{2}\right). This implies the desired time complexity of O((N+L)N2L2)O\left((N+L)N^{2}L^{2}\right). ∎

Appendix B Numerical examples

We define 𝒫Q\mathcal{P}_{Q} as the following optimization problem:

𝒫Q:minπΠ(μ,ν)i=1Nj=1Lφ(πij,θij).\mathcal{P}_{Q}:\ \min_{\pi\in\Pi(\mu,\nu)}\ \sum_{i=1}^{N}\sum_{j=1}^{L}\varphi(\pi_{ij},\theta_{ij}).

It is a generalization of the quadratic regularization problem.

Example B.1.

The parameters used for solving 𝒫CP\mathcal{P}_{CP} with d=5I3×3d=5I_{3\times 3} and α=0.5\alpha=0.5 are

c=[150205012020101],a=[15105121051],ϵ=δ=[0.30.30.3],μ=[1005020]andν=[904040].c=\begin{bmatrix}1&50&20\\ 50&1&20\\ 20&10&1\end{bmatrix},\ a=\begin{bmatrix}1&5&10\\ 5&1&2\\ 10&5&1\end{bmatrix},\ \epsilon=\delta=\begin{bmatrix}0.3\\ 0.3\\ 0.3\end{bmatrix},\ \mu=\begin{bmatrix}100\\ 50\\ 20\end{bmatrix}\ \text{and}\ \nu=\begin{bmatrix}90\\ 40\\ 40\end{bmatrix}.

The optimal solution π\pi^{*} obtained using Algorithm 1 in Mathematica 14.1 151515We also ran QuadraticOptimization and verified that the optimal plans coincide. is

π=[34.78020.194121.659350.1014815.69783.410380.8838070.9056899.65139].\pi^{*}=\begin{bmatrix}34.7802&0.19412&1.65935\\ 0.10148&15.6978&3.41038\\ 0.883807&0.905689&9.65139\end{bmatrix}.
Example B.2.

Using the same parameters as in 𝒫CP\mathcal{P}_{CP} but enforcing the marginal constraints Π(μ,ν)\Pi(\mu,\nu) and removing penalization, the optimal solutions to 𝒫Q\mathcal{P}_{Q} and 𝒫O\mathcal{P}_{O} are

π𝒫Q=[84.2758.840626.884424.298530.420615.28091.426550.7387317.8347],π𝒫O=[90010040100020].\pi^{*}_{\mathcal{P}_{Q}}=\begin{bmatrix}84.275&8.84062&6.88442\\ 4.2985&30.4206&15.2809\\ 1.42655&0.73873&17.8347\end{bmatrix},\ \pi^{*}_{\mathcal{P}_{O}}=\begin{bmatrix}90&0&10\\ 0&40&10\\ 0&0&20\\ \end{bmatrix}.
Example B.3.

Using the same parameters as in 𝒫CP\mathcal{P}_{CP} but changing weighting to ϵ=[0.410.2]T\epsilon=\begin{bmatrix}0.4&1&0.2\end{bmatrix}^{T} and δ=[10.50.4]T\delta=\begin{bmatrix}1&0.5&0.4\end{bmatrix}^{T} leads to

π=[50.71420.3601771.751424.5635222.90447.058842.377860.8730579.57857].\pi^{*}=\begin{bmatrix}50.7142&0.360177&1.75142\\ 4.56352&22.9044&7.05884\\ 2.37786&0.873057&9.57857\end{bmatrix}.
Example B.4.

Modifying the parameters with respect to Example B.3 as follows

a=[12022052520.5],μ=[2005010]andν=[1002050]a=\begin{bmatrix}1&20&2\\ 20&5&2\\ 5&2&0.5\\ \end{bmatrix},\ \mu=\begin{bmatrix}200\\ 50\\ 10\end{bmatrix}\ \text{and}\ \nu=\begin{bmatrix}100\\ 20\\ 50\end{bmatrix}

yields

π=[69.43351.2395319.25271.521326.9567111.99923.141460.2821747.55862].\pi^{*}=\begin{bmatrix}69.4335&1.23953&19.2527\\ 1.52132&6.95671&11.9992\\ 3.14146&0.282174&7.55862\end{bmatrix}.
Example B.5.

Consider the following parameters for 𝒫CP\mathcal{P}_{CP} with d=14×3d=\textbf{1}_{4\times 3} and α=0.5\alpha=0.5:

c=[0.1160.214410.2810.1],a=[0.50.50.52210.50.50.5221],ϵ=[0.20.20.20.2],δ=[0.20.20.2],μ=[10101010],ν=[102010].c=\begin{bmatrix}0.1&1&6\\ 0.2&1&4\\ 4&1&0.2\\ 8&1&0.1\end{bmatrix},\ a=\begin{bmatrix}0.5&0.5&0.5\\ 2&2&1\\ 0.5&0.5&0.5\\ 2&2&1\end{bmatrix},\ \epsilon=\begin{bmatrix}0.2\\ 0.2\\ 0.2\\ 0.2\end{bmatrix},\ \delta=\begin{bmatrix}0.2\\ 0.2\\ 0.2\end{bmatrix},\ \mu=\begin{bmatrix}10\\ 10\\ 10\\ 10\end{bmatrix},\ \nu=\begin{bmatrix}10\\ 20\\ 10\end{bmatrix}.

The solution to the optimization problems are161616In this example, π𝒫CP\pi^{*}_{\mathcal{P}_{CP}} is not an interior solution. Therefore, it is not possible to use Algorithm 1 to solve the problem. Instead, we use QuadraticOptimization.

π𝒫CP=[3.255053.8925401.209741.394120.33392603.997232.8886201.337172.17004],π𝒫Q=[4.185.8203.255713.690713.053571.258576.798571.942861.305713.690715.00357]\pi^{*}_{\mathcal{P}_{CP}}=\begin{bmatrix}3.25505&3.89254&0\\ 1.20974&1.39412&0.333926\\ 0&3.99723&2.88862\\ 0&1.33717&2.17004\end{bmatrix},\ \pi^{*}_{\mathcal{P}_{Q}}=\begin{bmatrix}4.18&5.82&0\\ 3.25571&3.69071&3.05357\\ 1.25857&6.79857&1.94286\\ 1.30571&3.69071&5.00357\end{bmatrix}

and

π𝒫O=[1000010001000010].\pi^{*}_{\mathcal{P}_{O}}=\begin{bmatrix}10&0&0\\ 0&10&0\\ 0&10&0\\ 0&0&10\end{bmatrix}.

References

  • Abdulkadiroğlu and Sönmez, (2003) Abdulkadiroğlu, A. and Sönmez, T. (2003). School Choice: A Mechanism Design Approach. The American Economic Review, 93(3):729–747.
  • Agarwal and Somaini, (2019) Agarwal, N. and Somaini, P. (2019). Revealed Preference Analysis of School Choice Models. NBER Working Paper.
  • Agarwal, Nikhil and Somaini, Paulo, (2023) Agarwal, Nikhil and Somaini, Paulo (2023). Empirical Models of Non-Transferable Utility Matching. In Echenique, F., Immorlica, N., and Vazirani, V. V., editors, Online and Matching-Based Market Design, pages 530–551. Cambridge University Press.
  • Alba-Vivar, (2025) Alba-Vivar, F. M. (2025). Opportunity Bound: Transport and Access to College in a Megacity. https://drive.google.com/file/d/1-zQu__07sloiK2z7CAvQJ8cp3olDAU60/view?usp=drive_link (accessed on March 16).
  • Alcázar and Balarin, (2021) Alcázar, L. and Balarin, M. (2021). Evaluación del diseño e implementación de los colegios de alto rendimiento – COAR. MINEDU and GRADE, Lima.
  • Alman et al., (2025) Alman, J., Duan, R., Vassilevska Williams, V., Xu, Y., Xu, Z., and Zhou, R. (2025). More asymmetry yields faster matrix multiplication. In Proceedings of the 2025 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2005–2039. Society for Industrial and Applied Mathematics.
  • Anaya-Montes and Gravelle, (2024) Anaya-Montes, M. and Gravelle, H. (2024). Health Insurance System Fragmentation and COVID-19 Mortality: Evidence from Peru. PLOS ONE, 19(8):e0309531.
  • Arrieta and Guillén, (2017) Arrieta, A. and Guillén, J. (2017). Output congestion leads to compromised care in Peruvian public hospital neonatal units. Health Care Management Science, 20(2):209–221. https://pubmed.ncbi.nlm.nih.gov/26452716/ (accessed on March 15, 2025).
  • Artstein-Avidan, Shiri and Giannopoulos, Apostolos and Milman, Vitali D., (2015) Artstein-Avidan, Shiri and Giannopoulos, Apostolos and Milman, Vitali D. (2015). Asymptotic Geometric Analysis, Part I, volume 202 of Mathematical Surveys and Monographs. American Mathematical Society.
  • Beck and Fiala, (1981) Beck, J. and Fiala, T. (1981). Integer-making theorems. Discrete Applied Mathematics, 3(1):1–8.
  • Bendezu-Quispe et al., (2020) Bendezu-Quispe, G., Mari-Huarache, L. F., Álvaro Taype-Rondan, Mejia, C. R., and Inga-Berrospi, F. (2020). Effect of Rural and Marginal Urban Health Service on the Physicians’ Perception of Primary Health Care in Peru. Revista Peruana de Medicina Experimental y Salud Pública, 37(4):636–644.
  • Carlier et al., (2023) Carlier, G., Dupuy, A., Galichon, A., and Sun, Y. (2023). SISTA: Learning Optimal Transport Costs under Sparsity Constraints. Communications on Pure and Applied Mathematics, 76(9):1659–1677.
  • Chiappori et al., (2010) Chiappori, P.-A., McCann, R. J., and Nesheim, L. P. (2010). Hedonic Price Equilibria, Stable Matching, and Optimal Transport: Equivalence, Topology, and Uniqueness. Economic Theory, 42(2):317–354.
  • Data Commons, (2025) Data Commons (2025). Population statistics for peru. https://datacommons.org/place/country/PER?utm_medium=explore&mprop=count&popt=Person&hl=es (accessed 18 March 2025).
  • Doval et al., (2024) Doval, L., Echenique, F., Huang, W., and Xin, Y. (2024). Social Learning in Lung Transplant Decision. Accessed on February 21, 2025. Available at arXiv:2411.10584.
  • Dupuy and Galichon, (2014) Dupuy, A. and Galichon, A. (2014). Personality Traits and the Marriage Market. Journal of Political Economy, 122(6):1271–1319.
  • Dupuy and Galichon, (2022) Dupuy, A. and Galichon, A. (2022). A Note on the Estimation of Job Amenities and Labor Productivity. Quantitative Economics, 13:153–177.
  • Dupuy et al., (2019) Dupuy, A., Galichon, A., and Sun, Y. (2019). Estimating Matching Affinity Matrices under Low-Rank Constraints. Information and Inference: A Journal of the IMA, 8(4):677–689.
  • Echenique, Federico and M. Bumin, Yenmez, (2015) Echenique, Federico and M. Bumin, Yenmez (2015). How to Control Controlled School Choice. The American Economic Review, 105(8):2679–2694.
  • Echenique, Federico, Joseph Root and Feddor Sandomirskiy, (2024) Echenique, Federico, Joseph Root and Feddor Sandomirskiy (2024). Stable Matching as Transportation. Accessed on February 21, 2025. Available at arXiv:2402.13378.
  • (21) EsSalud (2025a). Dashboard de indicadores fonafe y tablero estratégico. https://app.powerbi.com/view?r=eyJrIjoiMDQwMDVlOGItNGY5Zi00ZjFjLWEyZDMtYjY1Zjk0MWVjMjcxIiwidCI6IjM0ZjMyNDE5LTFjMDUtNDc1Ni04OTZlLTQ1ZDYzMzcyNjU5YiIsImMiOjR9 (accessed 18 March 2025).
  • (22) EsSalud (2025b). Tablero de diferimento de citas. https://app.powerbi.com/view?r=eyJrIjoiN2NlMTNmNWEtODA3MS00M2UyLWE3NDAtNjcyYjZjYTQ0MmJmIiwidCI6IjM0ZjMyNDE5LTFjMDUtNDc1Ni04OTZlLTQ1ZDYzMzcyNjU5YiIsImMiOjR9 (accessed 18 March 2025).
  • Eurydice - European Commission, (2024) Eurydice - European Commission (2024). National education systems: France overview. https://eurydice.eacea.ec.europa.eu/national-education-systems/france/overview (accessed 18 March 2025).
  • Gale and Shapley, (1962) Gale, D. and Shapley, L. S. (1962). College Admissions and the Stability of Marriage. The American Mathematical Monthly, 69(1):9–15.
  • Galichon, (2016) Galichon, A. (2016). Optimal Transport Methods in Economics. Princeton University Press.
  • Galichon, (2021) Galichon, A. (2021). The Unreasonable Effectiveness of Optimal Transport in Economics. Accessed on February 21, 2025. Available at arXiv:2107.04700.
  • González-Sanz and Nutz, (2024) González-Sanz, A. and Nutz, M. (2024). Sparsity of Quadratically Regularized Optimal Transport: Scalar Case. Accessed on February 21, 2025. Available at arXiv:2410.03353.
  • Hatfield and Milgrom, (2005) Hatfield, J. W. and Milgrom, P. R. (2005). Matching with Contracts. The American Economic Review, 95(4):913–935.
  • Hochbaum and Shanthikumar, (1990) Hochbaum, D. S. and Shanthikumar, J. G. (1990). Convex Separable Optimization Is Not Much Harder than Linear Optimization. Journal of the ACM, 37(4):843–862.
  • Hylland and Zeckhauser, (1979) Hylland, A. and Zeckhauser, R. (1979). The Efficient Allocation of Individuals to Positions. The Journal of Political Economy, 87(2):293–314.
  • INEI, (2024) INEI (2024). Condiciones de Vida en el Perú - Informe Técnico 2024.
  • Izmailov and Solodov, (2023) Izmailov, A. F. and Solodov, M. V. (2023). Convergence rate estimates for penalty methods revisited. Computational Optimization and Applications, 85(3):973–992.
  • Johns Hopkins University Coronavirus Resource Center, (2023) Johns Hopkins University Coronavirus Resource Center (2023). Covid-19 mortality data. https://coronavirus.jhu.edu/data/mortality (accessed 18 March 2025).
  • Kelso and Crawford, (1982) Kelso, A. S. and Crawford, V. P. (1982). Job Matching, Coalition Formation, and Gross Substitutes. Econometrica, 50(6):1483.
  • Kikuchi and Hayashi, (2020) Kikuchi, T. and Hayashi, S. (2020). Traffic congestion in Jakarta and the Japanese experience of transit-oriented development. S. Rajaratnam School of International Studies.
  • Laveriano, (2010) Laveriano, N. A. (2010). The Decentralization of Education in Peru. Educación: PUCP, 19(37):7–26.
  • Lipton, (2010) Lipton, R. J. (2010). Galactic Algorithms. Gödel’s Lost Letter and P=NP, Blog post. https://rjlipton.com/2010/10/23/galactic-algorithms (accessed 16 March 2025).
  • Lorenz et al., (2019) Lorenz, D. A., Manns, P., and Meyer, C. (2019). Quadratically Regularized Optimal Transport. Applied Mathematics & Optimization.
  • Marcus and Gordon, (1970) Marcus, M. and Gordon, W. R. (1970). An extension of the Minkowski Determinant Theorem. Cambridge University Press.
  • Merigot and Thibert, (2020) Merigot, Q. and Thibert, B. (2020). Optimal transport: discretization and algorithms. Accessed on February 21, 2025. Available at arXiv:2003.00855.
  • Ministère de l’Éducation Nationale et de la Jeunesse, (2024) Ministère de l’Éducation Nationale et de la Jeunesse (2024). Les chiffres clés du système éducatif. https://www.education.gouv.fr/les-chiffres-cles-du-systeme-educatif-6515 (accessed 18 March 2025).
  • Nutz, (2024) Nutz, M. (2024). Quadratically Regularized Optimal Transport: Existence and Multiplicity of Potentials. Accessed on February 21, 2025. Available at arXiv:2404.06847.
  • Park and Boyd, (2018) Park, J. and Boyd, S. (2018). A semidefinite programming method for integer convex quadratic minimization. Optimization Letters, 12:449–518.
  • Peng and Vempala, (2024) Peng, R. and Vempala, S. S. (2024). Solving Sparse Linear Systems Faster than Matrix Multiplication. Commun. ACM, 67(7):79–86.
  • Peyré and Cuturi, (2019) Peyré, G. and Cuturi, M. (2019). Computational Optimal Transport: With Applications to Data Science. New Foundations and Trends, 11(5-6):355–607.
  • Pia and Ma, (2022) Pia, A. D. and Ma, M. (2022). Proximity in Concave Integer Quadratic Programming. Mathematical Programming, 194:871–900.
  • Rockafellar, (1970) Rockafellar, R. T. (1970). Convex Analysis. Princeton Mathematical Series. Princeton University Press, Princeton, NJ.
  • Roth and Sotomayor, (1990) Roth, A. E. and Sotomayor, M. A. O. (1990). Two-Sided Matching: A Study in Game-Theoretic Modeling and Analysis, volume 18 of Econometric Society Monographs. Cambridge University Press.
  • Soto, (2019) Soto, A. (2019). Barreras para una atención eficaz en los hospitales de referencia del Ministerio de Salud del Perú: atendiendo pacientes en el siglo XXI con recursos del siglo XX. Revista Peruana de Medicina Experimental y Salud Pública, 36(2):304.
  • Strassen, (1969) Strassen, V. (1969). Gaussian elimination is not optimal. Numerische Mathematik, 13(4):354–356.
  • Vassilevska, (2015) Vassilevska, V. (2015). CS367 Algebraic Graph Algorithms - Lectures 1 and 2 on Matrix Multiplication and Matrix Inversion. Scribed by Jessica Su. https://theory.stanford.edu/~virgi/cs367/lecture1.pdf (accessed 16 March 2025).
  • Velásquez, (2020) Velásquez, A. (2020). Consideraciones éticas del aseguramiento universal de salud en el Peru. Antonio Ruiz de Montoya University.
  • Villani, (2009) Villani, C. (2009). Optimal Transport: Old and New, volume 338 of Grundlehren der mathematischen Wissenschaften. Springer.
  • Wiesel and Xu, (2024) Wiesel, J. and Xu, X. (2024). Sparsity of Quadratically Regularized Optimal Transport: Bounds on Concentration and Bias. Accessed on February 21, 2025. Available at arXiv:2410.03425 .
  • World Bank, (2020) World Bank (2020). Health at a glance: Latin america and the caribbean 2020. https://documents1.worldbank.org/curated/en/383471608633276440/pdf/Health-at-a-Glance-Latin-America-and-the-Caribbean-2020.pdf (accessed 18 March 2025).
  • World Bank, (2024) World Bank (2024). Modernizing traffic management in lima with world bank support. https://www.bancomundial.org/es/news/press-release/2024/10/15/modernizing-traffic-management-in-lima-with-world-bank-support (accessed 18 March 2025).
  • Zhan, (2005) Zhan, S. (2005). On the determinantal inequalities. Journal of Inequalities in Pure and Applied Mathematics, 6(4).