Prior-Informed Flow Matching (PIFM) reconstructs a partly observed graph. A link predictor scores the masked pairs of nodes, and we call these scores the prior. A learned flow then refines them together. Often we know more about the graph than its observed pairs: a cap on the degree of its nodes, a minimum number of triangles, or a range for its edge density. PIFM has no way to use these facts.
Constrained Primal-Dual PIFM (CPD-PIFM) uses them at sampling time, with the trained PIFM model as it is.
What CPD-PIFM adds to the sampler
- One Lagrange multiplier per constraint, carried along the sampling trajectory.
- At every step the sampler predicts its endpoint, checks the constraints on it, and raises the multiplier of each constraint that the prediction violates.
- The multipliers steer the following steps.
In nine settings on three benchmarks, the share of reconstructions that meet their constraints rises by 11 to 26 percentage points.
Problem formulation
A binary mask $\xi$ equals 1 on the pairs of nodes we observe and 0 on the masked pairs, and the observation of the adjacency matrix $A$ is $A^O = \xi \odot A$. We are also given $m$ constraints. Each is a statistic $c_l$ of the graph with a budget $\epsilon_l$: for a degree cap, $c_l$ is the maximum degree and $\epsilon_l$ is the largest degree allowed. A floor is a cap on the negated statistic. We look for a distribution $p$ of reconstructions $\hat{A}$ that is closest to $A$ on average, keeps every observed pair, and meets every budget in expectation:
$$\min_{p}\; \mathbb{E}_p\bigl[\lVert A - \hat{A} \rVert_F^2\bigr] \quad \text{subject to} \quad \xi \odot \hat{A} = A^O, \qquad \mathbb{E}_p\bigl[c_l(\hat{A})\bigr] \le \epsilon_l, \;\; l = 1, \dots, m.$$
Counts such as degrees and triangles are taken after rounding the reconstruction at 0.5. We call a reconstruction feasible when it meets every budget, and we call feasibility the share of graphs whose reconstruction is feasible.
We follow one graph through the page and call it the running graph. It is a protein graph from ENZYMES with 12 nodes, 24 edges and 10 triangles. Of its 66 pairs of nodes, 34 are masked, and the observed edges alone form a single triangle. The side information is a triangle floor: the graph has at least 10 triangles.
Method
PIFM starts from the observed pairs and, on the masked pairs, the prior with small Gaussian noise added. It integrates a learned velocity $v_\theta$ in $K$ Euler steps, and after each step it clips the entries to $[0, 1]$ and puts the observed pairs back. CPD-PIFM adds one multiplier $\eta_l \ge 0$ per constraint, starting at zero. Step $k$, at time $t = k/K$, does three things.
- Predict the endpoint. Extrapolating the current velocity to $t = 1$ predicts the final graph $\hat{A}_{1|t}$, and the observed pairs are put back into it.
- Update the multipliers. The slack $u_l = (c_l - \epsilon_l)/S_l$, with $S_l$ a fixed scale, is positive when constraint $l$ is violated. Each multiplier moves by its slack on the predicted endpoint and stays at or above zero. The new value acts from the next step.
- Take a guided step. The velocity gains a guidance term $g_k$. For each constraint it takes the gradient of a differentiable surrogate $\tilde{u}_l$ of the slack, keeps the masked pairs with the projection $\Pi_\xi$, normalizes, and weights by the current multiplier $\eta_{l,k}$.
$$\hat{A}_{1|t} = A^O + (1 - \xi) \odot \mathrm{clip}\bigl(\hat{A}_t + (1 - t)\, v_\theta(\hat{A}_t, t),\, 0,\, 1\bigr)$$
$$\eta_{k+1} = \bigl[\eta_k + \rho\, u(\hat{A}_{1|t})\bigr]_+ , \qquad g_k = -\sum_{l=1}^{m} \eta_{l,k}\, \frac{\Pi_\xi \nabla \tilde{u}_l(\hat{A}_{1|t})}{\lVert \Pi_\xi \nabla \tilde{u}_l(\hat{A}_{1|t}) \rVert_F}$$
$$\hat{A}_{t + 1/K} = \mathrm{clip}\Bigl(\hat{A}_t + \tfrac{1}{K}\bigl[v_\theta(\hat{A}_t, t) + \lambda_k\, g_k\bigr],\, 0,\, 1\Bigr)$$
Here $\rho$ is the step size of the multipliers, and the guidance strength $\lambda_k = \bar{\lambda}/(1 - t)$ grows as the endpoint prediction becomes more reliable. The scale $\bar{\lambda}$ is chosen on validation graphs for each setting, and no weight is chosen per constraint.
A violated constraint raises its multiplier, and the multiplier pushes the following steps against the violation. Once the prediction satisfies the constraint, the slack is negative and the multiplier shrinks. When it reaches zero, the step is a plain PIFM step again. The state and the multipliers evolve together, as in primal-dual methods for constrained reinforcement learning and constrained diffusion.
Adaptive multipliers
The multipliers adapt to each graph. The figure follows the triangle floor of 10 on two ENZYMES graphs, over 200 samples of each that differ only in the noise of the start. On the running graph the predicted endpoint starts at 3 triangles. The multiplier rises until step 4, where the prediction reaches the floor, and is back at zero by step 8. On the second graph every PIFM sample already meets the floor, and the multiplier barely moves: it peaks at 0.0003, against 0.017 on the running graph.
Of the 200 PIFM samples of the running graph, 179 miss the floor. With guidance all 200 meet it, and the mean rises from 7.0 to 22.7 triangles. On the second graph the mean moves from 22.7 to 23.0.
Guarantees
CPD-PIFM inherits the permutation equivariance of PIFM. When the constraints and their surrogates do not depend on the labels of the nodes, relabeling the nodes of the input relabels the distribution of the reconstruction in the same way.
A second result bounds the violation left at the end of sampling. With slacks bounded by $B$, $\bar{B} = \sqrt{m}\, B$ and $\rho = 1/(\bar{B}\sqrt{K})$, the expected slack of every constraint satisfies
$$\mathbb{E}\bigl[u_l(\hat{A})\bigr] \;\le\; \frac{\bar{B}}{\sqrt{K}} + \varepsilon_g + \bar{e}.$$
The first term is the cost of adapting the multipliers, and it decays with the number of steps. The other two are assumed bounds: $\varepsilon_g$ on the average multiplier-weighted slack along the trajectory, and $\bar{e}$ on the average gap between the predicted slack and the final one. The figure shows the effect of $K$ on PROTEINS under two constraints that compete, an edge floor and a degree cap. Feasibility under CPD-PIFM rises from 62% at $K = 2$ to 85% at $K = 64$, and PIFM levels off near 54%.
Results
We reuse PIFM’s trained models and GraphSAGE priors on ENZYMES, PROTEINS and IMDB-B, with half of the pairs of each graph masked uniformly at random and $K = 32$ steps. The budgets are quantiles of the training graphs: a degree cap, a triangle floor, an edge-density band, all three together, and a competing pair of an edge floor and a degree cap. We report feasibility, the area under the ROC curve (AUC) on the masked pairs, and the squared maximum mean discrepancy (MMD) between the degree histograms of the reconstructions and of the true graphs, as means over five seeds.
Feasibility rises in all nine settings, by 11 to 26 percentage points. Each single-constraint setting reaches at least 96%, and the combined settings reach 70 to 73%. AUC changes by between −0.013 and +0.027.
We also compare with one fixed weight in place of the adaptive multipliers, shared across settings, on a single seed. CPD-PIFM matches or exceeds its feasibility in eight of the nine settings and has the lower degree MMD in six, and the fixed weight has the higher AUC in six.
Conclusion
CPD-PIFM turns structural side information into Lagrange multipliers that adapt along each sampling trajectory. It reuses the trained flow, keeps every observed pair, and needs one guidance scale per setting, chosen on validation graphs. Feasibility rises in every setting we tested, with AUC within 0.03 of PIFM.
Paper and citation
The paper is on arXiv and under review at ICASSP 2027. CPD-PIFM builds on Prior-Informed Flow Matching.
@misc{chen2026cpdpifm,
title = {Feasible Flow Matching for Graph Reconstruction via Within-Sampling Primal-Dual Guidance},
author = {Chen, Haoming and Zilberstein, Nicolas and Paternain, Santiago and Segarra, Santiago},
year = {2026},
eprint = {2609.32980},
archivePrefix = {arXiv},
note = {Submitted to ICASSP 2027}
}