Convex duality contracts for production-grade mathematical optimization
Juan Pablo Vielma, Ross Anderson, Joey Huchette
TL;DR
This work presents MathOpt's unified dual-contract framework, a modular primal–dual scheme built on a simplified Fenchel view that operates on $opt_P = \inf_x \{ c\cdot x + \sum_i g_i(F^i(x)) \}$ with a corresponding abstract dual $opt_D$. By decomposing constraints into modules via $F^i$ and $g_i$, and leveraging $F^i_\nabla$ and $g_i^*$, the authors derive mechanical dual contracts that cover LP, conic, quadratic objectives, and two-sided linear constraints, while preserving standard dual properties such as weak duality and complementary slackness. The paper then demonstrates how these contracts specialize to classical forms (conic, Lagrangian, Fenchel) and discusses connections to Domain Driven Dual, GNLP, and Knotro-like two-sided optimality conditions, highlighting improved clarity for optimality certificates and infeasibility/ray certificates. The contributions yield a precise, extensible framework that unifies solver-specific dual forms, enabling robust user guidance, testing, and cross-solver interoperability in production optimization pipelines. Overall, this framework provides a rigorous, mechanical method to generate dual contracts across a broad class of convex problems, with practical implications for solver interfaces in production-critical systems.
Abstract
Deploying mathematical optimization in autonomous production systems requires precise contracts for objects returned by an optimization solver. Unfortunately, conventions on dual solution and infeasibility certificates (rays) vary widely across solvers and classes of problems. This paper presents the theoretical framework used by MathOpt (a domain-specific language developed and used at Google) to unify these notions. We propose an abstract primal-dual pair based on a simplified Fenchel duality scheme that allows for the mechanical derivation of dual problems and associated contracts for all classes of problems currently supported by MathOpt (including those with linear and quadratic objectives plus linear, conic, quadratic, and two-sided linear constraints). We also show how these contracts can improve clarity of complementary-slackness based optimality conditions for certain classes of problems.
