Module registry

Module registry 

Source
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

§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§

ProblemInfo
Metadata about a problem type.

Enums§

ComplexityClass
Computational complexity class of a problem.
GraphSubcategory
Graph problem subcategories.
NetworkSubcategory
Network problem subcategories.
OptimizationSubcategory
Optimization problem subcategories.
ProblemCategory
Top-level problem category.
SatisfiabilitySubcategory
Satisfiability problem subcategories.
SchedulingSubcategory
Scheduling problem subcategories.
SetSubcategory
Set problem subcategories.
SpecializedSubcategory
Specialized problem subcategories.
StringSubcategory
String problem subcategories.

Traits§

ProblemMetadata
Trait for problems that provide static metadata.