1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! # routik-solver
//!
//! Pure VRP core (no I/O) for the capacitated VRP with time windows (CVRPTW).
//! It holds the data model, the [`CostMatrix`] abstraction, the Clarke-Wright
//! savings construction, the local-search neighbourhoods, and a simulated-
//! annealing metaheuristic ([`solve`]).
//!
//! The solver depends on the [`CostMatrix`] trait **only** — distances and
//! times come from behind it, never from a baked-in map engine. Implementations
//! are [`HaversineMatrix`] (straight-line + a configurable speed) and
//! [`EuclideanMatrix`] (planar, unit speed — the Solomon-benchmark convention).
//!
//! Hard constraints (capacity, time windows) are always respected;
//! [`solve`] never returns a worse solution than the construction baseline
//! under the configured [`Objective`], and is deterministic for a given seed.
//!
//! ```
//! use routik_solver::{solve, Coord, HaversineMatrix, Problem, SolverConfig, Stop, StopId, Vehicle, VehicleId};
//!
//! let problem = Problem {
//! depot: Coord::new(48.8566, 2.3522),
//! stops: vec![Stop {
//! id: StopId(1),
//! coord: Coord::new(48.8606, 2.3376),
//! demand: 10,
//! time_window: None,
//! service_time: 0.1,
//! }],
//! vehicles: vec![Vehicle { id: VehicleId(1), capacity: 50 }],
//! depot_window: None,
//! };
//! let matrix = HaversineMatrix::from_problem(&problem, 50.0);
//! let solution = solve(&problem, &matrix, &SolverConfig::default()).expect("feasible");
//! assert!(solution.feasible);
//! ```
/// Property-test / fuzz support: an independent invariant oracle and an
/// `arbitrary`-driven instance builder. Compiled for the crate's own tests and,
/// behind the `fuzzing` feature, for the external cargo-fuzz crate.
pub use ;
pub use ;
pub use ;
pub use ;
pub use Objective;