An interactive, dynamic knowledgebase of canonical Computer Science problems, solutions, and reductions
- Website: https://redux.portneuf.cose.isu.edu/
- API Documentation: https://api.redux.portneuf.cose.isu.edu/swagger/index.html
- About Redux
- Features
- Quick Start
- Documentation
- Architecture
- Contributing
- Contributors
- Additional Resources
Redux is a web-based platform that makes computational complexity theory accessible and interactive. It provides:
- Interactive Problem Visualization: See canonical NP-Complete problems in action
- Reduction Framework: Understand how problems reduce to one another
- Solver & Verifier Tools: Execute and verify solutions to computational problems
- Educational Resource: Built on Karp's 21 NP-Complete problems and beyond
The backend is designed to be adaptable and can work with different frontends. The default frontend can be found at Redux_GUI.
NP-Complete Problem Library: Comprehensive collection of canonical CS problems
RESTful API: Full API access with Swagger documentation
Solver Algorithms: Multiple solving strategies for each problem
Certificate Verification: Verify solutions efficiently
Reduction Mappings: Visualize and understand problem reductions
Graph & SAT Visualizations: Interactive problem representations
- .NET 10 SDK
- Node.js (for frontend)
- Visual Studio or your preferred IDE
-
Clone the repositories
# Backend git clone https://github.com/ReduxISU/Redux.git # Frontend (optional, for full local setup) git clone https://github.com/ReduxISU/Redux_GUI.git
-
Run the Backend
Navigate to the Redux directory and run:
dotnet run
The API will be available at
http://127.0.0.1:27000/ -
Access Swagger API Documentation
Open your browser to:
http://127.0.0.1:27000/swagger/index.html
For automatic reloading during development:
dotnet watch --project API.csproj run -- --project API.csprojdocker build -t reduxapi .
docker run -it --rm -p 27000:80 --name reduxapi reduxapiAll problems are located in Problems/NPComplete/. Each problem follows a standardized structure:
NPC_PROBLEMNAME/
├── PROBLEMNAME_class.cs # Implements IProblem interface
├── Solvers/ # Solver implementations
├── Verifiers/ # Verifier implementations
└── PROBLEMNAME_controller.cs # API endpoints
Redux uses five main interfaces that problems must implement:
- IProblem - Main problem interface with solver, verifier, and visualization
- ISolver - Solves problem instances
- IVerifier - Verifies solution certificates
- IVisualization - Creates visual representations
- IReduction - Maps one problem to another
For detailed interface documentation, see the Interfaces section below.
The Redux API is documented using SwaggerUI. All endpoints can be tested directly from the Swagger interface at:
- Production:
https://api.redux.portneuf.cose.isu.edu/swagger/index.html - Local:
http://127.0.0.1:27000/swagger/index.html
When adding an API endpoint, the current practice is to add a controller into the problem reduction controller class, which corresponds to a specific class for that problem reduction. Each reduction has its own controller. The current naming convention is NameOfRelatedClassController.
Important: If not named correctly, the GUI will not function properly.
Controller Attributes:
Each controller should include:
[Route("controller")][Tag("Problem Name")]
API calls must include proper XML comments to appear in SwaggerUI documentation. Add these comments above each HTTP call:
<summary>- Brief description of API call<param name="parameterName" example="example value">- Description of parameter<response code="200">- What call returns
Example:
/// <summary>Brief description of API call</summary>
/// <param name="parameterName" example="example value">Description of parameter</param>
/// <response code="200">What call returns</response>SPADE is used for parsing instance strings into usable data structures. It should be used in problem class constructors.
Documentation: SPADE GitHub
Example usage can be found in the Knapsack problem class.
Redux/
├── Problems/
│ └── NPComplete/ # NP-Complete problem implementations
├── Interfaces/ # Core interfaces and graph utilities
├── AdditionalControllers/
│ └── Navigation/ # API controllers for problem retrieval
└── API.csproj # Main project file
For graph-based problems, use UtilCollectionGraph from the Interfaces folder. It includes:
- Automatic handling of directed/undirected graphs
- Weight management
ToAPIGraph()conversion for API responses
Located in AdditionalControllers/Navigation/, these controllers handle:
- Retrieving available problems
- Listing algorithms
- Problem metadata
** Caution**: The frontend heavily relies on these controllers. Changes should be made carefully.
We welcome contributions! Join our community:
- Discord: https://discord.gg/sEC3rTXn2Z
- Weekly Meetings: Thursdays at 11:30 AM MT via Zoom
- Production Branch:
CSharpAPI - Development Branch:
develop
Workflow:
- Make changes on the
developbranch (or create a feature branch) - Create a pull request to
develop - Assign a reviewer
- After code review, merge into
develop - Periodically merge
developintoCSharpAPIfor production
** Important**: DO NOT complete pull requests before they are reviewed.
- Correctly implements all interfaces
- Includes at least one solver
- Includes at least one verifier
- Tests created and passing
- Correctly implements all interfaces
- Includes working solution mapping function
- Located in correct folder
- Has API endpoint for reduction info, reduced string, and mapped solution
- Controller named properly
- Controller in proper controller class
- Proper XML comments for all HTTP calls
-
Create folder:
Problems/NPComplete/NPC_PROBLEMNAME/ -
Implement required files:
Folder Structure:
Each problem folder should include 4 files/folders:
PROBLEMNAME_class.cs(implementsIProblem)Solvers/folder with at least one solverVerifiers/folder with at least one verifierPROBLEMNAME_controller.cswith API endpoints
- Write tests
- Submit pull request
Testing uses Xunit. All new problems should include tests for:
- Verifier correctness
- Solver correctness
- Reduction algorithms
Run tests with:
dotnet testMain interface with generic types for ISolver, IVerifier, and IVisualization.
Required Fields:
problemName- Human-readable nameformalDefinition- Mathematical definitionproblemDefinition- Readable descriptionsource- CitationdefaultInstance- Example instancecontributors- Developer namesdefaultSolver- Default solver objectdefaultVerifier- Default verifier object
Required Constructors:
- Constructor taking a string instance
- Constructor using default instance
Implements solving algorithms.
Required Methods:
Solve(problem)→ Returns solution stringGetSteps()→ (Optional) Returns first 99 solution steps
Verifies solution certificates.
Required Methods:
Verify(problem, certificate)→ Returns boolean
Creates visual representations.
Visualization Types:
Boolean Satisfiability- UsesAPI_SATGraph D3- UsesAPI_graph
Required Methods:
Visualize(problem)→ ReturnsAPI_JSONSolvedVisualization(problem, solution)→ (Optional) Highlights solutionStepsVisualization(steps)→ (Optional) Visualizes steps
Maps one problem to another.
Required Fields:
reductionFrom- Starting problemreductionTo- Resulting problemgadgets- UI element relationships for highlighting
Required Methods:
Reduce()- Performs the reductionMapSolutions(certificate)- Maps solution from one problem to another
- Install service file to
/etc/systemd/system/redux.service - Configure paths for your environment
- Enable and start:
systemctl daemon-reload
systemctl enable redux.service
systemctl start redux.servicecd [working directory]
git pull origin
sudo systemctl restart redux.servicejournalctl -xeu reduxFor complete production setup instructions, see the production documentation in the repository.
This project is developed by students and faculty at Idaho State University's Computer Science Department.
For a complete list of contributors, visit our About Us page.
- GitHub Repository
- Wikipedia: What is NP-Complete?
- Karp's 21 NP-Complete Problems
- Redux GUI Documentation
- SPADE Parser
- Frontend: Redux_GUI
- Quantum Solver: quantumsolver
This project is developed at Idaho State University's Computer Science Department.
- Issues: Please use GitHub Issues for bug reports and feature requests
- Discord: Join our community
- Email: Contact the CS department at Idaho State University

