Abstract
Finding fair and stable solutions to two-sided matching problems is a fundamental challenge in economics and computer science, often categorized as strongly NP-hard. Traditional algorithms like Gale-Shapley provide stability but often at the cost of fairness to one side. This paper introduces WeaveNet, a novel Graph Neural Network (GNN) architecture specifically designed for dense bipartite graphs. By employing a unique "Feature Weaving" mechanism, WeaveNet preserves critical edge-wise preference information that standard GNNs typically lose through over-smoothing. Our results demonstrate that WeaveNet significantly outperforms existing deep learning baselines and achieves performance comparable to state-of-the-art handcrafted fairness-oriented algorithms, even as the problem scale increases.
Introduction
Matching problems are ubiquitous in modern society, ranging from school admissions and organ transplants to job placements and online dating. In a two-sided matching scenario, agents in two distinct groups (e.g., Group A and Group B) possess individual preferences over members of the opposite group. The primary objective is to establish a stable matching—a state where no pair of agents exists who would both prefer each other over their assigned partners. Such pairs, known as "blocking pairs," represent instability in the system.
While the classic Gale-Shapley algorithm efficiently finds stable matchings, it is inherently biased toward the proposing side. Achieving a fair stable matching—one that balances the satisfaction of both groups—is a significantly more complex task. Specifically, finding matchings that optimize for metrics like Sex Equality or Balance is known to be "strongly NP-hard," making it computationally prohibitive for large-scale applications using traditional exact methods.
The Challenge for Neural Networks
Previous attempts to apply deep learning, particularly Graph Neural Networks (GNNs), to matching problems have met with limited success. Standard GNN architectures rely on node-wise aggregation, which tends to "over-smooth" information in the dense bipartite graphs characteristic of matching problems. This process effectively washes out the granular, edge-level preference data required to identify stable and fair pairings.
WeaveNet: Architecture and Methodology
To overcome these limitations, we propose WeaveNet, a GNN architecture centered around the Feature Weaving (FW) Layer. Unlike traditional layers, the FW layer is designed to maintain the identity and importance of every potential edge in the bipartite graph.
Feature Weaving Layers
The core innovation of WeaveNet is its two-stream architecture that processes preferences from both groups in parallel. The "weaving" process involves cross-concatenation, where agent-wise ("weftwise") and candidate-wise ("warpwise") features are orthogonally combined. This ensures that the network retains a high-fidelity representation of the relationship between any two potential partners.
To ensure the model remains invariant to the ordering of agents (permutation invariance) and can handle varying group sizes ($N \times M$), WeaveNet utilizes set encoders inspired by PointNet. These encoders allow the model to learn global structures from the local preference data without being tied to a specific input sequence.
Unsupervised Learning via Continuous Relaxation
A key strength of WeaveNet is its training regime. The model is trained in an unsupervised manner, requiring no ground-truth labels. Instead, we employ relaxed, continuous loss functions that act as proxies for discrete combinatorial constraints. These functions penalize the model for:
- Instability: The presence of potential blocking pairs.
- Unfairness: Disparities in satisfaction between the two groups, measured through metrics such as Sex Equality and Balance.
Experimental Evaluation
We evaluated WeaveNet against several synthetic datasets representing diverse preference distributions:
- Uniform (U): Randomly generated preferences.
- Discrete (D): Preferences clustered around specific "popular" agents.
- Gauss (G): Preferences following a Gaussian distribution.
- LibimSeTi (Lib): Real-world rating data from an online dating platform.
Performance and Scalability
WeaveNet demonstrated a clear superiority over existing deep learning baselines, such as Multi-Layer Perceptrons (MLP) and Deep Bipartite Matching (DBM). As shown in the performance analysis, while baselines like MLP fail to find stable matchings as the number of agents grows beyond a trivial size, WeaveNet maintains a high success rate.
In terms of fairness, WeaveNet achieved Sex Equality and Balance scores comparable to, and occasionally exceeding, those of specialized handcrafted algorithms like PowerBalance. Furthermore, the model successfully scaled to $100 \times 100$ agent problems. At this scale, WeaveNet's continuous edge assignments can be refined using the Hungarian algorithm to ensure perfect one-to-one matchings while maintaining high stability ($>80\%$).
Conclusion and Future Work
WeaveNet represents a significant step forward in applying deep learning to complex combinatorial optimization problems. By prioritizing edge-wise feature preservation through its weaving architecture, it avoids the pitfalls of standard GNNs in dense graphs. While future work is needed to improve binarization reliability at extreme scales and optimize the $O(N^2)$ computational cost of the set encoders, WeaveNet proves that neural networks can effectively approximate "strongly NP-hard" fair matching problems.
Summary updated