Engineering Design and Computing Laboratory, ETH Zurich
Nicolas Hochuli ·
Lorenzo Miele ·
Kristina Shea · Tino Stankovic
Nicolas and Lorenzo contributed equally to this work.
Method · Benchmarks · Scalability · Installation · Training · Baselines · Citation
The paper studies goal-directed generation of embedded planar graphs: constructing both connectivity and node positions to match user-specified objectives while satisfying structural and geometric constraints. The proposed approach combines a parametric graph grammar with a dataset-free reinforcement learning policy, allowing graph size and geometric, topological, and spectral targets to be specified directly. Generation is formulated as a constrained Markov decision process, with feasibility checked at each graph transition.
The actor encodes the current graph using an E(2)-equivariant graph neural network with Jumping Knowledge aggregation.
It then selects a boundary node
A separate graph encoder supplies the critic's state-value estimate
The reward measures agreement with a set of target graph metrics
Here,
The scalability study evaluates graphs with 30 to 150 nodes under tight and loose constraint sets. Expected return decreases with graph size, with a larger drop under tighter constraints.
Scaling goal-directed generation across graph sizes and constraint settings.
Install the dependencies with UV (make sure you have uv installed) by running the command from the project root directory:
uv sync --lockedTo train the proposed method, run the following command:
uv run scripts/train_rl.pyfrom the project root. The hyperparameters, constraints and target metrics for training can be modified in
- conf/policy/ppo.yaml
- conf/constraints/default.yaml
- conf/target_metrics/default.yaml
Be aware that the first rollout takes way longer than the subsequent ones due to jit compilation of the grammar in JAX.
To evaluate baseline methods, run the following command:
uv run scripts/find_best_graphs_for_targets.pyEnsure to install the Boltzmann generator by following the instructions at ext/boltzmann-planar-graphs using
uv pip install -e ..
To run deep generative baselines, i.e. DiGress, GDSS with PRODIGY (in code directory) and MuDiff, see the respective
Readme files in the ext directory.
If you use this code or method please cite us using:
@misc{hochuli2026constrainedgoaldirectedplanargraph,
title={Constrained Goal-directed Planar Graph Generation with Grammar-based Reinforcement Learning},
author={Nicolas Hochuli and Lorenzo Miele and Kristina Shea and Tino Stankovic},
year={2026},
eprint={2610.06244},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2610.06244},
}
