Let the Flows Tell: Solving Graph Combinatorial Problems with GFlowNets

Dinghuai Zhang, Hanjun Dai, Nikolay Malkin, Aaron Courville, Yoshua Bengio, Ling Pan

TL;DR

This paper introduces a novel framework for solving NP-hard graph combinatorial optimization (CO) problems using Generative Flow Networks (GFlowNets). By framing CO as a sequential decision-making process that samples solutions proportional to their quality, the authors achieve state-of-the-art results among learning-based methods while maintaining solution diversity and handling the long-range credit assignment challenges typical of large-scale graphs.

The Challenge of Combinatorial Optimization

Combinatorial optimization (CO)—finding the best item from a finite set of objects—is the backbone of everything from logistics to drug discovery. However, most interesting CO problems (like finding the largest clique in a graph) are NP-hard, meaning exact solvers like Gurobi become prohibitively slow as problem size grows.

Machine learning, particularly Reinforcement Learning (RL), has been proposed as a faster alternative. But RL has two major "hang-ups" in this domain:

  1. Mode Collapse: RL typically tries to find the single best solution. In complex landscapes, it often gets stuck in one local optimum and fails to find other, potentially better, diverse candidates.
  2. Credit Assignment: In graph problems, an agent might make hundreds of decisions (e.g., adding vertices) before receiving a single reward at the end. Standard RL struggles to figure out which of those hundreds of steps were actually the "good" ones.

Enter GFlowNets

To overcome these limitations, the authors propose using GFlowNets, a generative framework designed to sample objects with a probability proportional to a reward function. Unlike RL, which maximizes cumulative reward, GFlowNets focus on "solution-level" diversity, naturally exploring the solution space more effectively.

Sequential generation of diverse graph solutions using GFlowNets.

Key Innovations

  • Problem-Specific MDPs: The authors designed custom Markov Decision Processes (MDPs) for four classic problems: Maximum Independent Set (MIS), Maximum Clique (MC), Minimum Dominating Set (MDS), and Maximum Cut (MCut). States are represented as binary vectors with a "void" state for unassigned vertices. Using a three-state representation (in set, out of set, unspecified) allows the model to build solutions constructively while maintaining the flexibility to handle strict constraints.
Custom Markov Decision Processes for four classic combinatorial problems: Independent Set, Clique, Dominating Set, and Cut.
  • Transition-Based Training: Standard GFlowNets often require processing entire trajectories. For graphs with hundreds of nodes, this exhausts GPU memory. The authors developed a transition-based approach that learns from individual steps, making the model scalable to large graphs.
  • Forward-Looking (FL) Signals: To solve the credit assignment problem, they incorporated intermediate learning signals. Instead of waiting for the final graph to calculate a reward, the model uses a handcrafted intermediate reward (e.g., the current size of the independent set) to guide the learning process at every step.

Experimental Setup and Datasets

The models were evaluated on both synthetic and realistic benchmarks:

  • RB Graphs: Complicated synthetic graphs used to test the limits of MIS and MC solvers.
  • BA (Barabási-Albert) Graphs: Scale-free random graphs used for MDS and MCut.
  • ER (Erdős–Rényi) Graphs: Standard random graphs.
  • SATLIB: A realistic dataset consisting of instances reduced from Boolean Satisfiability (SAT) problems.
  • Scales: Datasets were split into "SMALL" (200-300 vertices) and "LARGE" (800-1200 vertices).

Key Results and Insights

The GFlowNet approach consistently outperformed other unsupervised and supervised learning baselines.

  • Superior Quality: On the SATLIB dataset for MIS, GFlowNets achieved a significantly lower "drop" (distance from the optimal solution) of 0.57%, compared to 1.05% for PPO (RL).
  • Scalability: In large-scale MIS tasks (800-1200 nodes), GFlowNets found larger independent sets than all other ML-based methods, including those specifically designed for graphs.
  • Efficiency: While exact solvers like Gurobi or KAMIS take hours to find solutions on large graphs, GFlowNets provide high-quality approximations in seconds or minutes. For example, on LARGE MIS graphs, GFlowNets took ~4 minutes vs. KAMIS's ~2 hours.
  • Solution-Level vs. Trajectory-Level Entropy: The authors highlight that standard entropy-regularized RL targets the wrong objective. It makes the path to a solution random, whereas GFlowNets make the set of final solutions diverse. This prevents the model from getting trapped in sub-optimal regions.

Limitations and Future Work

While highly effective, the approach has a few limitations:

  • Inference Latency: Though much faster than exact solvers, GFlowNets are slower than "one-pass" probabilistic methods because they must build the solution vertex-by-vertex.
  • Handcrafted Signals: The "Forward-Looking" signals currently require domain knowledge to design. Future work could involve learning these intermediate rewards automatically.
  • Generalization: While the model generalizes well to different graph sizes, further research is needed to understand how these models handle vastly different graph distributions than those seen during training.

Summary updated

BibTeX
@inproceedings{zhang2023let,
  author = {Dinghuai Zhang and Hanjun Dai and Nikolay Malkin and Aaron Courville and Yoshua Bengio and Ling Pan},
  title = {{Let the Flows Tell: Solving Graph Combinatorial Problems with GFlowNets}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=sTjW3JHs2V},
}
Figure