Skip to main content

converge_optimization/
lib.rs

1//! # converge-optimization
2//!
3//! Optimization algorithms for converge.zone - a Rust reimplementation of
4//! key OR-Tools algorithms optimized for the converge platform.
5//!
6//! ## Modules
7//!
8//! - [`assignment`] - Linear assignment problem (Hungarian, Goldberg-Kennedy)
9//! - [`graph`] - Graph algorithms (shortest path, max flow, min cost flow)
10//! - [`knapsack`] - Knapsack problems (0-1, bounded, multidimensional)
11//! - [`scheduling`] - Scheduling constraints and solvers
12//! - [`setcover`] - Set cover heuristics
13//! - [`provider`] - Converge platform integration
14//!
15//! ## Quick Start
16//!
17//! ```rust
18//! use converge_optimization::assignment::{hungarian, AssignmentProblem};
19//!
20//! // Cost matrix: agent i to task j
21//! let costs = vec![
22//!     vec![10, 5, 13],
23//!     vec![3, 9, 18],
24//!     vec![14, 8, 7],
25//! ];
26//!
27//! let problem = AssignmentProblem::from_costs(costs);
28//! let solution = hungarian::solve(&problem).unwrap();
29//! println!("Total cost: {}", solution.total_cost);
30//! ```
31//!
32//! ## Feature Flags
33//!
34//! - `ffi` - Enable C++ OR-Tools bindings for complex algorithms
35//! - `full` - Enable all features
36
37#![warn(missing_docs)]
38#![warn(clippy::all)]
39#![warn(clippy::pedantic)]
40#![allow(clippy::module_name_repetitions)]
41
42pub mod assignment;
43pub mod gate;
44pub mod graph;
45pub mod knapsack;
46pub mod packs;
47pub mod scheduling;
48pub mod setcover;
49pub mod provider;
50
51#[cfg(feature = "sat")]
52pub mod cp;
53
54mod error;
55mod types;
56
57pub use error::{Error, Result};
58pub use types::*;
59
60/// Prelude for common imports
61pub mod prelude {
62    pub use crate::assignment::{AssignmentProblem, AssignmentSolution, AssignmentSolver};
63    pub use crate::gate::{ProblemSpec, ProposedPlan, SolverReport, PromotionGate, GateDecision};
64    pub use crate::graph::{Graph, NodeId, EdgeId};
65    pub use crate::knapsack::{KnapsackProblem, KnapsackSolution, KnapsackSolver};
66    pub use crate::packs::{Pack, PackRegistry, PackSolveResult};
67    pub use crate::Error;
68    pub use crate::Result;
69}