MAGNOLIA: Matching Algorithms via GNNs for Online Value-to-go Approximation

Alexandre Hayderi, Amin Saberi, Ellen Vitercik, Anders Wikum

Introduction

In the high-stakes world of digital marketplaces—ranging from Uber matching riders to drivers to Google matching advertisements to search queries—decisions must be made in milliseconds. These scenarios are formally modeled as Online Bayesian Bipartite Matching (OBBM) problems. In this framework, a set of "offline" resources (e.g., drivers) is matched with "online" requests (e.g., riders) that arrive sequentially. Every time a new request arrives, the system faces a critical trade-off: match the request now to secure an immediate reward, or wait for a potentially more valuable match in the future.

The research paper "MAGNOLIA: Matching Algorithms via GNNs for Online Value-to-go Approximation" introduces a deep learning framework designed to bridge the gap between theoretically optimal (but computationally impossible) algorithms and the fast, heuristic-driven systems used in production today.

The Computational Bottleneck of Optimal Matching

The theoretical "Gold Standard" for solving online matching problems is an algorithm known as $OPT_{on}$. This approach utilizes dynamic programming to calculate the Value-to-go (VTG): the expected total weight of the final matching if a specific action is taken now and the system acts optimally for all subsequent arrivals.

However, computing $OPT_{on}$ is PSPACE-hard. For any graph of practical size, the state space explodes exponentially, rendering the optimal solution computationally intractable. Consequently, industry applications typically rely on simpler heuristics. These include "Greedy" approaches, which prioritize the best immediate match, or "LP-rounding" techniques, which offer better theoretical guarantees but often underperform in average-case real-world scenarios. The challenge lies in emulating the "wisdom" of $OPT_{on}$ without incurring its prohibitive computational costs.

The MAGNOLIA Framework

The authors propose MAGNOLIA, a framework that replaces the expensive dynamic programming routine with a Graph Neural Network (GNN). The core idea is to use supervised learning to train a GNN to predict the VTG for every possible action—whether that is matching an online request to a specific offline node or choosing to skip the match entirely.

The MAGNOLIA framework: an input matching state is processed through a GNN in the latent space to predict values for node selection.

Architecture and Training

MAGNOLIA utilizes a Message-Passing GNN architecture, specifically GENConv. This choice is grounded in the inherent "locality" of GNNs, where a node’s representation is updated based on its immediate neighborhood. To overcome the PSPACE-hardness of the training targets, the researchers employed a "Teacher Forcing" strategy. They trained the GNN on thousands of tiny 16-node graph instances where the exact $OPT_{on}$ values could be computed as the "teacher" targets. Remarkably, the model learns the underlying logic of matching on these small scales and generalizes to much larger systems.

Theoretical Justification

A significant contribution of the paper is the theoretical proof that for Bipartite Random Geometric Graphs (b-RGGs)—which accurately model spatial tasks like ridesharing—the VTG function is "locally approximable." This means that an optimal decision for a rider in a specific neighborhood is primarily influenced by local supply and demand rather than the state of the entire city. This proof provides a rigorous justification for using GNNs, which are architecturally designed to capture such local structures.

Experimental Evaluation

MAGNOLIA was evaluated across a diverse set of synthetic and real-world datasets:

  • Synthetic Graphs: Including Erdős-Rényi (random), Barabási-Albert (scale-free), and Bipartite Random Geometric Graphs (spatial).
  • Semi-Synthetic Rideshare Data: Simulated using the OSMnx library to model rider/driver locations and travel times in Fremont and Piedmont, California.
  • Real-World Crowdsourcing: The gMission dataset, containing data from a spatial crowdsourcing platform matching workers to tasks.

Key Results and Insights

Across nearly all configurations, MAGNOLIA outperformed state-of-the-art baselines. As shown in the performance metrics for the Fremont rideshare dataset, MAGNOLIA achieved a competitive ratio (performance relative to the offline optimal) that was consistently 2-5% higher than Greedy-t and LP-rounding.

Performance comparison on the Rideshare (Fremont) dataset, showing MAGNOLIA outperforming standard heuristics as the number of nodes increases.

Beyond raw performance, the researchers identified two critical strengths:

  1. Size Generalization: MAGNOLIA exhibits incredible zero-shot scaling. A model trained on 16 nodes successfully applied its logic to graphs with hundreds of nodes, maintaining a stable competitive ratio even as the problem size increased 18-fold.
  2. Regime Awareness: The ratio of online to offline nodes (the "regime") significantly impacts matching logic. To handle varying market conditions (e.g., a driver-heavy vs. rider-heavy market), the authors implemented a Meta-GNN that selects the best-specialized model for the current environment.

Conclusion and Future Directions

MAGNOLIA demonstrates that GNNs can effectively approximate complex, high-dimensional decision functions in online matching. By proving the locality of the VTG function, the authors provide a bridge between graph theory and deep learning.

Future work may involve moving away from the supervised "teacher" bottleneck. By using Reinforcement Learning (RL), it may be possible to train MAGNOLIA on even larger graphs without requiring exact $OPT_{on}$ labels. Additionally, extending the framework to fully dynamic environments—where offline nodes also enter and leave the system—would bring the model even closer to the complexities of real-world logistics.

Summary updated

BibTeX
@inproceedings{hayderi2024magnolia,
  author = {Alexandre Hayderi and Amin Saberi and Ellen Vitercik and Anders Wikum},
  title = {{MAGNOLIA: Matching Algorithms via GNNs for Online Value-to-go Approximation}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=XlgeQ47Ra9},
}
Figure