Differentiating Network Design Objectives for Balancing Cost and Distance

Zishang Chen, Longhe Lin, Zhiyuan Julian Su, Qi QiNeurIPS 2026

TL;DR

Imagine designing a city’s drone delivery network: build too few corridors and drones take endlessly winding detours; build too many and construction costs skyrocket. This paper introduces Cost Distance Policy Gradient (CDPG), the first framework that turns this discrete, tangled "Cost–Distance" network design problem into a smooth, differentiable landscape solvable with standard gradient descent. It achieves near-optimal network designs in a fraction of the time required by traditional combinatorial algorithms or commercial solvers.

What Problem Does This Paper Address?

Whether you are routing data in sensor networks, laying out highways, or planning UAV corridors, you face a fundamental tug-of-war: construction cost (paid once per built link) versus routing distance (paid every time demand travels along that link). In computer science, this is formalized as the Cost–Distance problem, where multiple weighted sources must reach a single destination (root) via a shared subnetwork.

Applying modern gradient-based optimization to this discrete problem has been a major roadblock because edge selection and routing are inseparable. You cannot simply relax edges into independent probabilities between 0 and 1. Why? Because whether a source even reaches the root—and how far it travels—depends on a domino effect of every downstream choice. Furthermore, naive probabilistic routing easily gets trapped in infinite loops (cycles), sending expected travel distances to infinity and breaking gradient descent.

Methods

To make this discrete puzzle differentiable, the authors reframe static network construction as a dynamic decision-making process—specifically, a Markov Decision Process (MDP)—and optimize it directly on each problem instance without needing pre-trained neural networks.

Figure 1: The CDPG pipeline. Edge logits and bilinear node embeddings parameterize a next-hop policy. DAD selects a root-oriented acyclic support, and row normalization gives routing probabilities. Value Solver evaluates construction and induced routing costs. Gradients update policy parameters under the current support; the acceptance test controls mask updates. Finally, TopoRounding converts the optimized policy into a discrete arborescence.

CDPG relies on four main components:

  • Stochastic Next-Hop Policy (New formulation): Instead of deciding globally which edges exist, every active node maintains a probability distribution over which neighbor to step to next, parameterized by direct edge weights and shared bilinear node embeddings.
  • Dynamic Acyclic Dropout, or DAD (Novel constraint handling): Standard "soft" penalties for graph cycles cost $\mathcal{O}(n^3)$ time and still allow tiny loops during training. DAD periodically takes a snapshot of the current flow, runs a fast shortest-path pass toward the root, and builds a strict, loop-free (acyclic) mask. It only accepts the new mask if it improves the objective, guaranteeing zero cycles at low overhead.
  • Truncated Value Solver (Fast evaluation): Computing exact expected path lengths via matrix inversion takes $\mathcal{O}(n^3)$ time. Instead, CDPG unrolls the routing probabilities over $d = \lceil \log_2 n \rceil$ sparse steps, adding a shortest-path penalty for any "unreached" flow left over.
  • TopoRounding (Quality-preserving discretization): Once gradients settle, you still have probabilities, not a real network. Exploiting DAD's loop-free structure, TopoRounding sweeps through the graph in a single linear $\mathcal{O}(m)$ pass, snapping soft probabilities into a hard, discrete tree that is mathematically guaranteed to be at least as good as the relaxed policy.

Datasets

CDPG is evaluated across 1,487 instances spanning three newly curated or adapted benchmark suites (note: CDPG optimizes each graph from scratch, so there is no "training set" in the supervised sense, though one instance, GBA-CDNet-3, is held out to tune hyperparameters):

  • GBA-CDNet: 9 large, dense UAV logistics networks from the Guangdong–Hong Kong–Macao Greater Bay Area, built using real logistics locations and travel distances from Tencent Location Service.
  • TN-CDNet: 478 instances converted from 8 open-source regional road networks (e.g., Winnipeg, Barcelona, Chicago, Berlin), representing medium-to-large sparse graphs.
  • CD-RandNet: 1,000 synthetic graphs (200 to 2,000 nodes) across four classic topologies: Erdős–Rényi, Watts–Strogatz, Stochastic Block Models, and Barabási–Albert, plus larger 5k–50k node variants for scalability testing.

Key Insights and Ideas

  • Exact acyclicity unlocks everything: Usually, enforcing hard combinatorial rules kills gradients. Here, DAD's exact loop-free mask (updated without backpropagating through the mask itself) prevents infinite-distance explosions and enables linear-time, lossless rounding at the end.
  • Logarithmic lookahead is enough: You don't need to simulate paths all the way to the root during gradient steps. Propagating flow just $\lceil \log_2 n \rceil$ hops and estimating the rest gives controlled relative error, bringing the overall fixed-accuracy complexity down to a remarkably lean $\mathcal{O}(m \log n)$.
  • Immune to source-set explosion: Classic Cost–Distance approximation algorithms slow down drastically as you add more demand sources (scaling linearly or quadratically with the number of sources $|S|$). Because CDPG shares a single node-level routing policy across all flows once they meet, its runtime stays nearly flat even when active sources fill up the graph.

Key Results

Across all 20 benchmark categories, CDPG achieves the best objective quality among all non-commercial methods while sitting comfortably in the fast-runtime regime.

Figure 2: Runtime–quality comparison of CDPG and compared methods. Objectives are normalized by the Gurobi lower bound. Failed runs exceed the shared time limit for their dataset. Lower objective and runtime values are better.
  • Real-world UAV scale: On the largest UAV instance (GBA-CDNet-1, with 17,408 nodes, 1.13M directed arcs, and 16,440 sources), CDPG finishes in 21.75 seconds with an objective ratio of 1.071 relative to the Gurobi commercial solver's theoretical lower bound. The specialized Held Routing baseline takes 123.38 seconds and lands at a 2.130 ratio—making CDPG 5.7× faster while cutting total cost nearly in half (49.7% reduction).
  • Near-optimal across topologies: CDPG stays tightly hugged against the Gurobi lower bound everywhere: 1.012–1.113 on UAV networks, 1.002–1.182 on road networks, and 1.014–1.038 on synthetic graphs. On large dense graphs, Gurobi itself frequently hits the 2-hour timeout and returns worse feasible networks than CDPG.
  • Massive graph scalability: On 50,000-node synthetic graphs (~2 million arcs), CDPG runs in roughly a quarter of the time of Held Routing (runtime ratios of 0.241 on ER and 0.246 on BA) while still finding cheaper networks.

Limitations and Future Work

Not discussed in the paper. (While the authors note in passing that sparse-demand regimes with very few sources make classic algorithms like Held Routing runtime-competitive, and mention that differentiable surrogates can generally be used for unsupervised neural training or post-inference refinement, they do not include a dedicated section discussing formal limitations or future research directions.)

Summary updated

Abstract

Many network design tasks must decide which directed arcs to build so that multiple sources can reach a root efficiently. Building fewer or cheaper arcs reduces construction cost, but may force long routing paths; building more arcs shortens routes, but increases construction cost. The Cost--Distance problem formalizes this trade-off, yet it has remained difficult to optimize with gradient-based methods because the selected network, the induced routes, and the routing cost are tightly coupled. We propose Cost Distance Policy Gradient (CDPG), a differentiable framework that treats local next-hop choices as a routing policy, prevents unstable cyclic routing through Dynamic Acyclic Dropout, evaluates the objective with a truncated value solver, and uses the induced acyclic support for quality-preserving TopoRounding. Under the stated conditions, CDPG has a fixed-accuracy \(\mathcal{O}(m\log n)\) efficiency guarantee. Experiments cover 1,487 instances in UAV logistics networks, transportation networks, and four synthetic graph families; across this suite, CDPG shows a strong time--quality trade-off compared with other differentiable baselines, Cost--Distance-specific algorithms, and the commercial solver. Our code is available at: https://github.com/Sakuraced/Cost-Distance-Policy-Gradient-CDPG.
BibTeX
@inproceedings{chen2026differentiating,
  author = {Zishang Chen and Longhe Lin and Zhiyuan Julian Su and Qi Qi},
  title = {{Differentiating Network Design Objectives for Balancing Cost and Distance}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=YuYZQCQoQp},
}
Figure