On Representing Linear Programs by Graph Neural Networks

Ziang Chen, Jialin Liu, Xinshang Wang, Wotao Yin

While Graph Neural Networks (GNNs) are increasingly popular for solving optimization problems, their theoretical limits in this domain have remained somewhat fuzzy. This paper establishes a rigorous mathematical foundation, proving that GNNs possess the necessary "separation power" and "expressive power" to distinguish and approximate the fundamental properties of Linear Programs (LPs)—specifically their feasibility, boundedness, and optimal solutions.

The Challenge of Learning to Optimize

The emerging field of "Learning to Optimize" (L2O) seeks to replace or augment traditional mathematical solvers with machine learning models. GNNs are a natural choice for Linear Programming because LPs are inherently permutation-invariant: swapping the order of two variables or two constraints does not change the underlying optimization problem. A GNN's message-passing architecture naturally respects this symmetry.

However, a major theoretical gap has persisted: Can a GNN actually "see" the difference between two fundamentally different LPs? In graph theory, the gold standard for measuring a network's "separation power" is the Weisfeiler-Lehman (WL) isomorphism test. If the WL test cannot tell two graphs apart, a standard GNN cannot either. The authors tackle the fundamental question of whether the known limitations of the WL test prevent GNNs from reliably representing and solving LPs.

Representing LPs as Graphs

To bridge the gap between algebraic LPs and graph neural networks, the authors represent an LP as a weighted bipartite graph.

Bipartite graph representation of LPs

In this formulation:

  • Nodes: One set of nodes represents the constraints ($Ax \circ b$), while the other set represents the variables ($x_j$).
  • Edges: An edge connects a constraint node to a variable node if that variable appears in that specific constraint. The weight of the edge corresponds to the coefficient $A_{i,j}$.
  • Features: Node features encode the objective coefficients ($c_j$), variable bounds ($l_j, u_j$), and constraint types ($\le, =, \ge$).

Using this representation, the researchers apply graph theory and measure theory to evaluate the 1-WL test (a local message-passing algorithm). They demonstrate that while there are "puzzling" pairs of LPs that the 1-WL test cannot distinguish, these specific pairs actually share the exact same feasibility status and optimal solutions. Therefore, the GNN’s inability to distinguish them is harmless for the purpose of solving the LP.

Key Insights and Theoretical Breakthroughs

  • Perfect Alignment on Separation: The most significant insight is that the limitations of GNNs (inherited from the WL test) are perfectly aligned with the mathematical structure of LPs. Even if a GNN is "blind" to certain structural differences in the bipartite graph, those differences do not alter the LP's solution. This proves GNNs are not just an empirically good choice, but a theoretically sound one.
  • Handling Discontinuity: LP properties, such as feasibility, are discrete and discontinuous. Because standard neural network theory often assumes continuous functions, the authors utilized Lusin’s Theorem from measure theory to prove that GNNs can approximate these "jumpy" functions arbitrarily well across almost the entire domain.
  • The Minimum-Norm Solution: Because an LP can have multiple optimal solutions (e.g., when the objective function is "flat" relative to the constraints), the mapping from problem to solution can be ambiguous. To resolve this, the authors focused on predicting the unique minimum $\ell_2$-norm solution, making the mapping a well-defined function that a GNN can reliably learn.

Validation and Future Directions

The authors validated their theoretical findings using synthetic datasets of LPs (e.g., $m=10$ constraints and $n=50$ variables), generating ground truth labels for feasibility and optimal solutions using standard solvers. In their experiments, the training error for feasibility, objective value, and optimal solutions dropped to near zero as the number of GNN parameters increased. This confirms the theoretical claim: GNNs have the universal capacity to "memorize" or represent the complex mappings of LPs. Furthermore, as the number of training samples increased, the error on unseen testing sets decreased significantly, indicating practical generalization.

While the paper successfully proves that a GNN can represent an LP (expressive power), it notes that future work is needed to establish theoretical guarantees on how many samples are required to learn these representations (generalization bounds). Additionally, extending this theoretical framework to Mixed-Integer Linear Programming (MILP)—a significantly harder, NP-hard problem space where GNNs are already showing empirical promise—remains an exciting frontier.

Summary updated

BibTeX
@inproceedings{chen2023representing,
  author = {Ziang Chen and Jialin Liu and Xinshang Wang and Wotao Yin},
  title = {{On Representing Linear Programs by Graph Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=cP2QVK-uygd},
}
Figure