Solver

Configure and run the solver — phases, moves, termination, and SolverManager.

The solver takes your domain model and constraints, then searches for the best solution using metaheuristic algorithms. Configuration controls which algorithms run, how long to search, and how moves are selected.

Quick Start

use solverforge::prelude::*;

static MANAGER: SolverManager<Schedule> = SolverManager::new();

let config = SolverConfig::from_toml_str(r#"
    [termination]
    seconds_spent_limit = 30
"#).unwrap();

let (job_id, rx) = MANAGER.solve(problem);

// Receive improving solutions via channel
for (solution, score) in rx {
    println!("New best score: {:?}", score);
}

Sections

  • Configuration — TOML-based solver configuration
  • Phases — Construction heuristic, local search, exhaustive search
  • Moves — Move types and selectors
  • Termination — When to stop solving
  • SolverManager — Running and managing solver instances

Configuration

TOML-based solver configuration with SolverConfig.

Solver Phases

Construction heuristic, local search, exhaustive search, partitioned search, and VND.

Moves

Move types, selectors, and the zero-allocation MoveArena.

Termination

Control when the solver stops — time limits, step counts, score targets, and composites.

SolverManager

Run and manage solver instances with channel-based streaming.