Skip to main content

Crate problemreductions

Crate problemreductions 

Source
Expand description

§Problem Reductions

NP-hard problem definitions and reductions. See the user guide for tutorials and examples.

§API Overview

ModulePurpose
modelsProblem types — graph, formula, set, algebraic, misc
rulesReduction rules, ReductionGraph for path search
solversBruteForce and ILPSolver
topologyGraph types — SimpleGraph, UnitDiskGraph, etc.
traitsCore traits — Problem
typesMax, Min, Extremum, ExtremumSense, ProblemParameters, WeightElement
variantVariant parameter system for problem type parameterization

Use prelude for convenient imports.

Re-exports§

pub use error::ProblemError;
pub use error::Result;
pub use expr::evaluate_approximate;
pub use expr::ApproximationError;
pub use expr::AsymptoticAnalysisError;
pub use growth::Growth;
pub use registry::ComplexityClass;
pub use registry::ProblemInfo;
pub use solvers::BruteForce;
pub use traits::Problem;
pub use types::And;
pub use types::Extremum;
pub use types::ExtremumSense;
pub use types::Max;
pub use types::Min;
pub use types::NumericSize;
pub use types::One;
pub use types::Or;
pub use types::ProblemParameters;
pub use types::Sum;
pub use types::WeightElement;
pub use inventory;

Modules§

config
Configuration utilities for problem solving.
error
Error types for the problemreductions library.
export
JSON export schema for example payloads.
expr
Symbolic expression integration for the problem-reduction domain.
growth
Symbolic growth domain: a dedicated asymptotic normal form for reduction parameter expressions.
io
File I/O utilities for problem serialization.
models
Problem model implementations.
parameters
Symbolic parameter transformations carried by reduction rules.
prelude
Prelude module for convenient imports.
random
Shared deterministic building blocks for model-owned random generators.
registry
Problem registry and metadata types.
rules
Reduction rules between NP-hard problems.
solvers
Solvers for computational problems.
topology
Graph topology types.
traits
Core traits for problem definitions.
types
Common types used across the problemreductions library.
variant
Variant system for type-level problem parameterization.

Macros§

decision_problem_meta
Register the decision problem name for a concrete optimization problem.
declare_variants
Declare explicit problem variants with per-variant complexity metadata.
impl_random_generate
Implement a typed, model-owned random generator using a typed input spec.
impl_variant_param
Implement VariantParam and optionally KValue for a type.
impl_variant_reduction
Generates an explicit same-model variant ReduceTo implementation.
problem_parameters
Define a problem’s canonical parameters from inherent getter methods.
register_brute_force
Register finite Cartesian reference solvers for concrete problem variants.
register_decision_variant
Register the boilerplate inventory entries for a concrete Decision<P> variant.
variant_params
Compose a Problem::variant() body from type parameter names.

Structs§

Expr
A cheap, immutable handle to a shared symbolic expression node.
ParseError

Functions§

big_o_normal_form
Compute the Big-O normal form of an expression.

Attribute Macros§

reduction
Attribute macro for automatic reduction registration.

Derive Macros§

CreateSpec
Generate static construction-input metadata from a typed create spec.