Skip to main content

scirs2_optimize/combinatorial/
mod.rs

1//! Combinatorial optimization algorithms.
2//!
3//! This module provides solvers for classic combinatorial optimization problems:
4//!
5//! - **TSP** ([`tsp`]): Traveling Salesman Problem — nearest-neighbor heuristic,
6//!   2-opt, 3-opt, Or-opt local search, MST lower bound, and a full solver.
7//! - **Knapsack** ([`knapsack`]): 0/1 knapsack DP (exact), branch-and-bound (exact),
8//!   greedy heuristic, fractional knapsack, and multi-dimensional knapsack.
9//! - **Assignment** ([`assignment`]): Hungarian algorithm (Kuhn-Munkres) for
10//!   minimum-cost assignment, and sparse minimum-cost bipartite matching.
11//! - **Graph Coloring** ([`graph_coloring`]): Welsh-Powell greedy, DSATUR,
12//!   exact backtracking, and chromatic number computation.
13//! - **Covering** ([`covering`]): Set cover, weighted set cover, vertex cover
14//!   (2-approximation), König's exact minimum vertex cover for bipartite graphs,
15//!   and hitting set.
16
17pub mod assignment;
18pub mod covering;
19pub mod graph_coloring;
20pub mod knapsack;
21pub mod tsp;
22
23// ── Re-exports ────────────────────────────────────────────────────────────────
24
25pub use assignment::{hungarian_algorithm, min_cost_matching, AssignmentResult};
26pub use covering::{
27    greedy_set_cover, hitting_set, min_vertex_cover_bip, vertex_cover_2approx, weighted_set_cover,
28    CoveringResult,
29};
30pub use graph_coloring::{ColoringResult, GraphColoring};
31pub use knapsack::{
32    fractional_knapsack, knapsack_branch_bound, knapsack_dp, knapsack_greedy,
33    multi_knapsack_greedy, KnapsackItem, KnapsackResult, MultiKnapsackItem,
34};
35pub use tsp::{
36    mst_lower_bound, nearest_neighbor_heuristic, or_opt, three_opt_move, tour_length, two_opt,
37    TspResult, TspSolver,
38};