A Rust library for NP-hard problem definitions and reductions. We aim to implement 100+ problems and reduction rules between them, with automatic reduction path search. Built with AI assistance.
This infrastructure aims to solve two problems:
- Given a hard problem
$A$ , reduce it to the most viable problem$B$ , to be solved efficiently with an external solver. - Given a solver
$S$ for problem$B$ , explore how efficiently it can be used for solving other problems.
Download PDF manual for humans.
Add to your Cargo.toml:
[dependencies]
problemreductions = "0.2"Install the pred command-line tool for exploring the reduction graph from your terminal:
cargo install problemreductions-cliOr build from source:
git clone https://github.com/CodingThrust/problem-reductions
cd problem-reductions
make cli # builds target/release/predSee the Getting Started guide for usage examples, the reduction workflow, and CLI usage.
The pred CLI includes a built-in MCP server for AI assistant integration:
{"mcpServers": {"problemreductions": {"command": "pred", "args": ["mcp"]}}}See the MCP documentation for available tools, prompts, and configuration details.
Contribute 10 non-trivial reduction rules and you will be automatically added to the author list of the paper. AI tools handle the implementation — contributors focus on designing correct reductions and test cases.
-
Open an issue using the Problem or Rule template. Fill in all sections — the templates guide you through the required information (definition, algorithm, size overhead, example instance, etc.).
Hint: If you use Claude Code / OpenCode / Codex (assume
ghCLI tool andsuperpowersplugin are installed), you can just type:File an issue on CodingThrust/problem-reductions, using the "Model" issue template, about the Closest Vector Problem. Brainstorm with me.File an issue on CodingThrust/problem-reductions, using the "Rule" issue template, about reduction from Closest Vector Problem to QUBO. Brainstorm with me.Then AI agents will guide you to fill in the issue template.
-
Our AI agents will pick up the issue and generate a plan to implement the reduction rule.
-
You will be mentioned in the pull request, provide feedback to the AI agents. If you are satisfied with the plan, you can merge the PR.
Optionally, if you prefer to implement yourself, I will recommend you to use the superpowers:brainstorming skill to help you write a detailed plan. Create a PR and let maintainers help review and merge the PR.
Run make help to see all available targets. See CLAUDE.md for the full command list and architecture details.
This project draws inspiration from the following packages:
- ProblemReductions.jl — Julia library for computational problem reductions. Our problem trait hierarchy, reduction interface (
ReduceTo/ReductionResult), and graph-based reduction registry are directly inspired by this package. - UnitDiskMapping.jl — Julia package for mapping problems to unit disk graphs. Our unit disk graph (King's subgraph / triangular lattice) reductions and the copy-line method are based on this implementation.
- qubogen — Python library for generating QUBO matrices from combinatorial problems. Our QUBO reduction formulas (Vertex Cover, Graph Coloring, Set Packing, Max-2-SAT, binary ILP) reference the implementations in this package.
- Karp — A DSL (built on Racket) for writing and testing Karp reductions between NP-complete problems (PLDI 2022 paper). Focused on education and proof verification rather than a solver pipeline.
- Complexity Zoo — Comprehensive catalog of 550+ computational complexity classes (Scott Aaronson).
- A Compendium of NP Optimization Problems — Online catalog of NP optimization problems with approximability results (Crescenzi & Kann).
- Computers and Intractability (Garey & Johnson, 1979) — The classic reference cataloging 300+ NP-complete problems with reductions. The most cited book in computer science.
MIT License - see LICENSE for details.