Expand description
Problem registry and metadata types.
This module provides types for problem classification, introspection, and discovery. It enables organizing 100+ NP-complete problems into a hierarchical category system and provides rich metadata for each problem type.
§Overview
ProblemCategory- Hierarchical categorization (e.g.,graph/independent)ProblemInfo- Rich metadata (name, description, complexity, reductions)ProblemMetadata- Trait for problems to provide their own metadataComplexityClass- Computational complexity classification
§Example
use problemreductions::registry::{ProblemCategory, GraphSubcategory, ProblemInfo, ComplexityClass};
// Create a category path
let category = ProblemCategory::Graph(GraphSubcategory::Independent);
assert_eq!(category.path(), "graph/independent");
// Create problem metadata
let info = ProblemInfo::new("Independent Set", "Find maximum non-adjacent vertices")
.with_aliases(&["MIS", "Stable Set"])
.with_complexity(ComplexityClass::NpComplete)
.with_reduction_from("3-SAT");
assert!(info.is_np_complete());§Using with Problems
Problems that implement ProblemMetadata can be queried for their category and info:
use problemreductions::registry::ProblemMetadata;
use problemreductions::models::graph::IndependentSetT;
use problemreductions::topology::SimpleGraph;
let info = IndependentSetT::<SimpleGraph, i32>::problem_info();
let category = IndependentSetT::<SimpleGraph, i32>::category();
println!("Problem: {} ({})", info.name, category.path());Structs§
- Problem
Info - Metadata about a problem type.
Enums§
- Complexity
Class - Computational complexity class of a problem.
- Graph
Subcategory - Graph problem subcategories.
- Network
Subcategory - Network problem subcategories.
- Optimization
Subcategory - Optimization problem subcategories.
- Problem
Category - Top-level problem category.
- Satisfiability
Subcategory - Satisfiability problem subcategories.
- Scheduling
Subcategory - Scheduling problem subcategories.
- SetSubcategory
- Set problem subcategories.
- Specialized
Subcategory - Specialized problem subcategories.
- String
Subcategory - String problem subcategories.
Traits§
- Problem
Metadata - Trait for problems that provide static metadata.