Solving an NP-hard optimization problem often requires reformulating it for a specific solver -- quantum hardware, a commercial optimizer, or a domain heuristic. A tool for polynomial-time reductions between hard problems would let practitioners route any supported problem to any supported solver through a single interface. Building such a library at scale, however, has remained out of reach. We show that harness engineering, the practice of designing constraints, verification systems, and feedback loops that channel AI coding agents, can overcome this barrier. Our harness combines a no-code contribution route for domain experts, a multilayer verification stack ranging from type-level checks to agentic feature tests (AI agents role-playing as end users), and a fully automated implementation-review-integration pipeline. In about three months, we built a command-line tool backed by a library of 100+ problem types and 200+~reduction rules in over 170k lines of Rust. The result suggests that a well-engineered harness lets agents build well-tested software at a scale and pace beyond prior reduction-library efforts. Because the reduction graph composes transitively, a new solver registered for any single problem type instantly becomes available to every problem connected by a reduction path. The source code is available at https://github.com/CodingThrust/problem-reductions.
翻译:解决NP-hard优化问题通常需要针对特定求解器(量子硬件、商业优化器或领域启发式算法)重新表述问题。在困难问题之间建立多项式时间归约的工具,可使实践者通过单一接口将任意支持的问题路由至任意支持的求解器。然而,构建如此大规模的归约库一直难以实现。我们证明,通过设计约束、验证系统和反馈回路来引导AI编码智能体的工程化方法(即"约束工程")能够突破这一障碍。我们的约束工程结合了供领域专家使用的无代码贡献路径、从类型级检查到智能体特征测试(AI智能体扮演最终用户)的多层验证栈,以及全自动化的实现-审查-集成流水线。在约三个月内,我们构建了一个命令行工具,其底层库包含100+种问题类型和200+条归约规则,代码量超过17万行Rust。结果表明,精心设计的约束工程能使智能体以远超此前归约库项目的规模与速度构建经过充分测试的软件。由于归约图具有传递组合性,为任一问题类型注册的新求解器将立即可用于所有存在归约路径连接的问题。源代码见https://github.com/CodingThrust/problem-reductions。