Congestion and Penalization in Optimal Transport
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 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, and . Each element 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 ), is the set of men and is the set of women. In the case of school matching, consists of groups of students, grouped, for instance, according to their district, and is the set of schools. We denote by the mass of and by the mass of . For instance, in the marriage market, , while in the case of schools, would represent the capacity of school . Analogously, if were patients and medical care centers, then parameters would represent the capacity of the medical care center. When referring to an element of , instead of denoting it by , we usually, to simplify the notation, refer to it by . Analogously, the elements of are referred to by the index , instead of . Moreover, we denote the set of indices by and the set of indices by . Lastly, we denote by the number of individuals of type matched with .
The problem addressed in the classic literature, from the perspective of a central planner, is to decide how many individuals from group should be matched with and so forth for each , 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 and 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 depending on the matching 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 allows drawing solid conclusions from an economic perspective., and a vector of parameters . Moreover, the central planner must ensure that there are neither excesses of demand nor supply. Hence, the central planner solves
(1) |
where
(2) |
A solution to (1) will be from now referred to as an optimal matching or optimal (transport) plan, and will be denoted by . In the standard optimal transport model, separable linear costs are assumed (Galichon,, 2016). This is, . It is therefore assumed that the marginal cost of matching one more individual from with 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
To solve , 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
(3) |
with . Given the strict convexity of , and , the solution is interior, i.e. . Another variation is the quadratic regularization, where the problem becomes
(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 in the case where . However, for the case , considering for all , the compactness of and continuity of the objective functions, ensure the existence of a solution to 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 who belong to and are matched with , to not necessarily be 444We anticipate that will no longer be the mass of individuals of group but rather a targeted quota for individuals of group .. Similarly, it may be the case that not all those matched with sum up to . 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 with penalties in the objective function. Moreover, we introduce weights for each penalty. That is, the constraint is replaced by the penalty term , with , and the constraint is replaced by , with . The parameters are weights. We could use any 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 with the same becomes increasingly costly. For example, from the perspective of physical transportation costs, in countries with high vehicular traffic congestion, the effect of increasing from cars to passing through a certain avenue is less or equal to increasing from to with . Therefore, clustering groups based on geographic location means that matching many individuals from the same group to a single congests the access route (which is the same). Hence, we introduce the term in the cost structure. The coefficient 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 , we could consider a general strictly increasing and convex function , such as or . 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 to patients may not significantly affect the system, but increasing from to with might (e.g., leading to system freezes, delays, etc.).
Finally, we certainly have , for all . 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 . This phenomenon also explains the penalties: we no longer assume a fixed number of individuals of type , and represents now a target that the central planner aims to achieve (how many individuals of type should ideally be matched). Similarly, the parameters 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 and . The tradeoff is controlled through a parameter . According to what has been specified, the problem is:
(5) |
where , and , are all non negative, and
(6) |
In Equation 6, despite its practical relevance, the term , representing fixed costs, does not influence the resolution of the problem. For this reason, when considering the parameter vector , we think of it as . 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 for all . 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 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 , 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 , where
In fact, it is clear from the cost function that it is strictly lower in the interior of or in the axes than when evaluated in (without considering the axes) or outside . 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, , with convex functions of the form , with .
Optimization carried over : As we mentioned previously, similarly to the case of the classical demand theory, we are assuming that . However, just as it does not make sense to consume cars, it can be also unreasonable to consider that is not restricted to taking values in , 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 to the integer lattice , 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 , where is the condition number.. Solving the problem in 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 . Karush Kuhn Tucker (KKT) first order conditions applied to (5) yield
(7) |
Here, is the associated multiplier to the inequality constraint . Determining whether or not the solution is interior, is not trivial. For corner solutions, we have to iterate all possible combinations of equal or not to zero. Formally, 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 for all . Hence, from (7), we have . This set of equations can be written in the compact form , where
(8) |
and The following lemma states that is an invertible matrix.
Lemma 3.1.
The determinant of is strictly positive, whenever all parameters are strictly positive.
Therefore, the linear system has a unique solution. What we still don’t know is whether or not this solution belongs to . If so, given the strict convexity of , we would have determined, through an ex-post analysis, the unique solution to . However, it may not always be the case that , 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 . 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 , with others for solving linear systems.
3.1 Neumann’s series approach
Assumption 1.
Let for all . Assume that
Assumption 1 implies that convex transport costs are large. Moreover, the fact that are small follows from their interpretation as normalized weights, i.e., .
Lemma 3.2.
Under Assumption 1, the following holds
Theorem 3.3.
Under Assumption 1, , where
3.2 Special cases
For the aim to explicitly compute , we need to impose some additional mild assumptions.
3.2.1 No interest in overcrowding or no quotas.
Assumption 2.
Assume that for all and for some .
Assumption 2 illustrates the case where the central planner does not care if in over or underfilling schools or hospitals (), and convex costs are the same across the pairs : . For instance, the latter applies when distances, routes, or bureaucratic systems are almost the same for all .
Assumption 3.
Assume that for all .
A similar result can be obtained by setting , 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.
Proof.
This result follows directly from the computation of by using (9). ∎
3.2.2 Equal weighting and identical convex costs.
Assumption 4.
Let and be real numbers such that , with and for all .
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 and , where the entries of are given by
This allows us to write
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 . Lemmas 3.6, 3.7 and 3.8 are used to establish Theorem 3.9.
Lemma 3.6.
Let be a positive integer. Then
Lemma 3.7.
Let be a positive integer.Then
Lemma 3.8.
Theorem 3.9 is of particular interest as it allows us to determine, without computing the inverse of , the maximum number of individuals that would be matched between two points . In practice, this enables, for example, the establishment of capacity constraints on routes or spaces.
3.3 Algorithm for computing
We now provide an efficient algorithm to compute . This is established in Theorem 3.10. First, let us rewrite matrix given in (8) as follows:
Theorem 3.10.
For interior solutions , Algorithm 1 computes in time.
Time | Sparse | Galactic | Authors |
---|---|---|---|
No | No | Gaussian Elimination | |
No | No | Strassen, (1969) | |
Yes | Yes | Peng and Vempala, (2024) | |
No | Yes | Alman et al., (2025) | |
No | No | This paper |
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 , 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 through Neumann’s series or Algorithm 1, obtaining a closed-form expression for using these techniques is not straightforward. Therefore, to facilitate comparative statics, one possible approach is to approximate the matrix using Neumann’s series. First, assume that . This simplification allows us to derive a closed-form expression for , providing initial insights. Under the assumption , we obtain:
From this expression, it follows that and , . These results align with standard economic intuition. However, under this rough approximation, we obtain for , which is unrealistic since we expect a substitution effect. To improve upon this, consider a refined approximation:
From smooth comparative statics, if is an interior solution to associated with the parameter vector , then:
(12) |
Thus, under the approximation , we obtain:
(13) |
where consists of multiplying column of by . From (13), if , then: for all , for and or and , if and . Then, we conclude from (13) that:
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 with increases ceteris-paribus, then the number of individuals of type matched with (where ) 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
The case 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 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 was covered by EPS, see Table 2.
Insurance | Covered people |
---|---|
EPS | 8% |
EsSalud | 30% |
SIS | 53% |
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 . |
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 . 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 and . 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 . 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 or , with respect to the other rows and columns (proportionally to the target mass).
In Example B.4, we set , 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% |
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% |
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 , 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 () and three schools (). The groups represent: wealthy high-achieving students (), poor high-achieving students (), wealthy low-achieving students (), and poor low-achieving students (). School is top-ranked and expensive, has an average ranking and a mid-range price, and 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: 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 individuals from group being matched to . However, once again, they do not provide the flexibility for , 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 could be very small. Removing restrictions enables a better approximation of the reality in developing countries, where equilibrium equations 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, , . On the other hand, the eigenvalues of are non-negative since the eigenvalues of are and the eigenvalues of belong to . Hence, the products of eigenvalues and are non-negative, and so, is positive semi-definite. Similarly, is positive semi-definite. Thus, 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).
Proof of Lemma 3.2.
Let , where . Then,
Then, for all , , where and Thus, 141414 denotes the spectral norm.,
Then, by multiplying the series on the right hand side by , the claim follows. ∎
Proof of Theorem 3.3.
Define
On one hand . On the other hand,
Given , let
For , we have . ∎
Proof of Theorem 3.4.
By using classical properties of Kronecker product, we have
Proof of Lemma 3.6.
The claim certainly holds for . Now, assuming it holds for , it follows by induction that
Proof Lemma 3.7.
We have two distinct possibilities.
Case with . We now proceed by induction. We will manually verify that each satisfies the inequality. On the diagonal we have
For , set
Then and so . On the other hand,
implies . So, . It follows that
Assuming holds for , we obtain
Case with . We prove this by induction on starting with the base case :
Assume the statement holds for , then
This completes the proof. ∎
Proof of Lemma 3.8.
Proof of Theorem 3.9.
By triangle inequality,
Proof of Theorem 3.10.
Consider Algorithm 1. It is easy to see that each prefix sum of 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 . First, the number of iterations for the for-loops on Lines 4-7 and 8-11 is . We then show that each time we enter any for-loop, the time spent is . Computing takes , so the only possible optimization is finding the optimal parenthesization for the product . Since there are only five possible ways to parenthesize the expression, we determine by brute force that computing also takes . This implies the desired time complexity of . ∎
Appendix B Numerical examples
We define as the following optimization problem:
It is a generalization of the quadratic regularization problem.
Example B.1.
The parameters used for solving with and are
The optimal solution obtained using Algorithm 1 in Mathematica 14.1 151515We also ran QuadraticOptimization and verified that the optimal plans coincide. is
Example B.2.
Using the same parameters as in but enforcing the marginal constraints and removing penalization, the optimal solutions to and are
Example B.3.
Using the same parameters as in but changing weighting to and leads to
Example B.4.
Example B.5.
Consider the following parameters for with and :
The solution to the optimization problems are161616In this example, is not an interior solution. Therefore, it is not possible to use Algorithm 1 to solve the problem. Instead, we use QuadraticOptimization.
and
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).