Matrix encoding networks for neural combinatorial optimization

Yeong-Dae Kwon, Jinho Choo, Iljoo Yoon, Minah Park, Duwon Park, Youngjune Gwon

Combinatorial optimization (CO) is the backbone of industrial efficiency, governing everything from logistics routing to complex factory scheduling. While deep learning has made significant strides in solving classic CO problems like the Traveling Salesman Problem (TSP), most successful models rely on Euclidean coordinates (e.g., points on a 2D map).

However, many real-world problems are defined by matrices, not coordinates. For instance, the time required to move a part between machines in a factory is a specific value in a relationship table, not a simple physical distance. Existing neural models often struggle to process these dense, non-Euclidean relationship matrices while maintaining "permutation invariance"—the principle that a solution shouldn't change simply because the rows or columns of the input data were reordered.

To bridge this gap, researchers have introduced MatNet (Matrix Encoding Network), a novel neural architecture specifically designed to solve CO problems defined by relationship matrices.

Reframing the Problem: Matrix as a Bipartite Graph

The core insight behind MatNet is viewing a CO problem's parameter matrix as a complete bipartite graph. If a matrix represents the relationships between $M$ items in group A and $N$ items in group B, MatNet treats these as two distinct sets of nodes. The matrix values serve as the weighted edges connecting them.

Bipartite graph representation of a matrix

By reframing a matrix as a bipartite graph, MatNet successfully applies Graph Neural Network (GNN) logic to dense data tables without losing critical structural information.

The MatNet Architecture

MatNet introduces several key technical innovations to process these bipartite graphs effectively:

  • Dual Graph Attentional Layer: Unlike standard Transformers that use a single update rule for all elements, MatNet employs two separate, independent update functions for the two different classes of items (e.g., jobs versus machines).
  • Mixed-Score Attention: This is MatNet's flagship innovation. In typical attention mechanisms, the attention "score" is calculated solely from learned, abstract representations. MatNet’s "Mixed-Score" attention uses a small, trainable Multi-Layer Perceptron (MLP) to combine these internal scores with the actual values from the raw data matrix (the edge weights). This allows the network to learn the optimal balance between raw problem data and abstract features for each specific problem type.
  • POMO Training: The model is trained using Reinforcement Learning via the POMO (Policy Optimization with Multiple Optima) algorithm, encouraging the network to explore multiple high-quality solutions simultaneously.
MatNet architecture and Mixed-Score Attention

Performance and Key Results

The researchers evaluated MatNet on two primary benchmarks: the Asymmetric Traveling Salesman Problem (ATSP) and the Flexible Flow Shop Problem (FFSP). The model was compared against CPLEX (a gold-standard commercial MIP solver), LKH3 (a state-of-the-art heuristic), and meta-heuristics like Genetic Algorithms (GA) and Particle Swarm Optimization (PSO).

ATSP Performance: Unlike standard TSP, ATSP features asymmetric distances (the cost from A to B differs from B to A). On 100-city ATSP instances, MatNet achieved an optimality gap of less than 1% compared to exact solutions from CPLEX, while operating significantly faster for large batches.

FFSP Dominance: MatNet's performance on scheduling tasks was its standout achievement. FFSP is a highly complex scheduling problem involving multiple stages and machines. For 100-job FFSP instances, CPLEX failed to find any valid solution within a reasonable time limit. In contrast, MatNet not only found solutions in seconds but produced schedules with significantly shorter makespans than those generated by GA or PSO.

Remarkably, MatNet can solve a batch of 1,000 FFSP problems in roughly 27 seconds on a single GPU—a task that takes traditional meta-heuristics hours to complete with lower-quality results.

Limitations and Future Directions

While MatNet represents a major leap forward for matrix-based CO problems, the authors note a few areas for future improvement:

  • Scalability Limits: The current use of one-hot vectors for initial embeddings requires a pre-defined maximum number of items. Transitioning to random vectors could offer a workaround for infinite scalability.
  • Real-World Constraints: Factory environments often feature "messy" constraints (e.g., maintenance windows, varying machine speeds) not fully captured in standard FFSP benchmarks.
  • Hybrid Approaches: The authors propose that the most powerful future tools might be "ML + OR" hybrids, where neural networks like MatNet provide high-quality global information to guide and accelerate traditional mathematical solvers.

Summary updated

BibTeX
@inproceedings{kwon2021matrix,
  author = {Yeong-Dae Kwon and Jinho Choo and Iljoo Yoon and Minah Park and Duwon Park and Youngjune Gwon},
  title = {{Matrix encoding networks for neural combinatorial optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=C__ChZs8WjU},
}
Figure