DC3: A learning method for optimization with hard constraints
Priya L. Donti, David Rolnick, J. Zico Kolter
TL;DR
DC3 introduces a differentiable framework for solving optimization problems with hard constraints by first completing a partial network output to satisfy equality constraints and then applying a differentiable gradient-based correction to enforce inequalities. This approach enables end-to-end training while guaranteeing feasibility, demonstrated on convex QPs, simple non-convex problems, and ACOPF, where it consistently achieves feasible, near-optimal solutions with substantial speedups over traditional solvers and prior deep-learning baselines. The combination of equality completion (via explicit solves or implicit differentiation) and inequality correction (via gradient steps on the constraint manifold) provides robust performance across diverse problem classes. DC3 thus offers a practical, generalizable path to fast, constraint-satisfying neural approximations for large-scale optimization in engineering and beyond.
Abstract
Large optimization problems with hard constraints arise in many settings, yet classical solvers are often prohibitively slow, motivating the use of deep networks as cheap "approximate solvers." Unfortunately, naive deep learning approaches typically cannot enforce the hard constraints of such problems, leading to infeasible solutions. In this work, we present Deep Constraint Completion and Correction (DC3), an algorithm to address this challenge. Specifically, this method enforces feasibility via a differentiable procedure, which implicitly completes partial solutions to satisfy equality constraints and unrolls gradient-based corrections to satisfy inequality constraints. We demonstrate the effectiveness of DC3 in both synthetic optimization tasks and the real-world setting of AC optimal power flow, where hard constraints encode the physics of the electrical grid. In both cases, DC3 achieves near-optimal objective values while preserving feasibility.
