TL;DR
This paper introduces highly scalable Integer Linear Programming (ILP) formulations to find the absolute optimal vertex elimination orderings in Algorithmic Differentiation (AD). By abandoning traditional timestep tracking in favor of relative ordering, their approach scales to graphs up to two orders of magnitude larger than previous exact methods, allowing researchers to finally validate that popular greedy heuristics perform remarkably well in practice.
What Problem Does This Paper Address?
Algorithmic Differentiation (AD) is a foundational technique used to compute derivatives of mathematical functions efficiently by representing calculations as directed acyclic graphs (DAGs). This process can be executed via a sequence of vertex eliminations. However, finding the sequence that minimizes computational cost (Optimal Vertex Elimination) or minimizes the final graph size (Minimum Edge Count) is NP-complete.
For decades, practitioners have relied on greedy heuristics to find good elimination orderings. Unfortunately, evaluating exactly how close these heuristics come to the true mathematical optimum has been impossible for realistic workloads because previous exact methods (ILP formulations) were computationally prohibitive for graphs with more than roughly 30 vertices. This paper bridges that gap by providing a scalable exact baseline.
Methods
The authors break through the scalability barrier by rethinking how the elimination process is modeled. Instead of tracking the entire graph structure at discrete timesteps $t_1, t_2, \dots$, which causes an explosion of variables and constraints, the new ILP formulation encodes only the relative order of vertex eliminations.
This formulation reduces the number of constraints from $\Theta(n^4)$ to $\Theta(n^3)$ and slashes the number of variables for the Minimum Edge Count problem to $\Theta(n^2)$. To further accelerate the solver, they incorporate:
- Max-Flow Reductions: Efficiently computing lower bounds on vertex degrees using source-sink separators.
- Symmetry Breaking: Precomputations that eliminate impossible edge creations.
- Advanced Preprocessing: Pruning the graph using safe reduction rules before feeding it to the ILP solver.
On the theoretical side, the authors introduce MiddleOut, a new approximation algorithm parameterized by the size of a minimum source-sink separator, and establish the very first approximation lower bounds (proving the problems are APX-hard).
The various greedy heuristics evaluated against the exact baseline are summarized below:
Datasets
The authors assembled a diverse evaluation corpus of 56 computational graphs across five distinct suites:
- CHMU: 5 small foundational graphs from prior literature ($10 \le |V| \le 16$).
- G&W: 4 classic textbook problems from Griewank and Walther ($6 \le |V| \le 34$).
- NLS: 26 realistic graphs generated from nonlinear least squares test problems using the AD tool CoDiPack ($8 \le |V| \le 1751$).
- Evol: 10 evolution graphs resulting from the discretization of time-dependent partial differential equations (PDEs) using stencils ($36 \le |V| \le 1200$).
- AlphaG: 11 test problems generated from JAX functions via Graphax ($7 \le |V| \le 140$).
Key Insights and Ideas
- The Relative Order Advantage: The core "aha moment" is realizing that the exact timestep of an edge's creation doesn't matter for optimization; only the pairwise elimination order of the vertices dictates the final cost.
- Heuristics are Surprisingly Excellent: The most comforting finding for practitioners is that popular greedy heuristics (like Relative Markowitz,
rMar) are not just wild guesses—they consistently achieve solutions within a few percent of the true mathematical optimum on real-world data. - Ensembles Eliminate Worst-Case Failures: While any single heuristic can be tricked by a contrived graph structure, a simple ensemble combining just four basic strategies (Forward, Reverse, Markowitz, and Relative Markowitz) achieves the absolute optimal solution on 82% of the test graphs.
Key Results
- Dramatic Solver Speedups: The new ILP formulations solved 3x more graphs for Optimal Vertex Elimination and 4x more graphs for Minimum Edge Count within a 10-minute timeout compared to the previous state-of-the-art ILPs. On graphs solved by both, the new method was typically over 92% to 96% faster.
- Quantifying Heuristic Quality: Across 47 fully solved graphs, the standard Markowitz rule (
Mar) achieved a mean approximation ratio of 1.12, while the refined Relative Markowitz (rMar) dropped to an impressive 1.03. - MCMC Success: For the Minimum Edge Count problem, the Markov Chain Monte Carlo method ($\text{MC}^2$) solved every single graph in the corpus optimally, with the sole exception of the evolution datasets.
Limitations and Future Work
- Poor LP Relaxations: Relaxing the integer constraints to continuous $[0,1]$ values yields large integrality gaps ($\Omega(n^{1/4})$ for vertex elimination and $\Omega(n)$ for edge count). This implies that simple fractional rounding schemes are unlikely to yield high-quality approximations unless restricted to bounded-degree graphs.
- The Evolution Graph Mystery: Standard greedy heuristics like
Marperform terribly on large evolution graphs derived from PDE stencils, whereas simple forward/reverse topological modes excel. The authors note that a rigorous theoretical justification for this behavior remains an open challenge. - Separator Tightness: While the MiddleOut algorithm provides an $O(|C|^2)$ approximation bound based on an S-T separator $C$, future work is needed to determine if this bound can be tightened when $C$ is a minimum separator.
Summary updated