rmp-route-optimizer 0.1.0

High-performance route optimization library for waste collection and logistics using Eulerian circuit algorithms
Documentation
//! Error types for route optimization

use thiserror::Error;

/// Result type for optimization operations
pub type Result<T> = std::result::Result<T, OptimizationError>;

/// Errors that can occur during route optimization
#[derive(Debug, Error)]
pub enum OptimizationError {
    /// Graph has no nodes
    #[error("Graph must contain at least one node")]
    EmptyGraph,

    /// Graph has no edges
    #[error("Graph must contain at least one edge")]
    NoEdges,

    /// Start node not found in graph
    #[error("Start node {0} not found in graph")]
    StartNodeNotFound(i64),

    /// Graph is not connected
    #[error("Graph is not connected - cannot create Eulerian circuit")]
    DisconnectedGraph,

    /// Invalid edge configuration
    #[error("Invalid edge: {0}")]
    InvalidEdge(String),

    /// Graph has too many odd-degree vertices
    #[error("Graph has {0} odd-degree vertices (maximum supported: 100)")]
    TooManyOddVertices(usize),

    /// Failed to augment graph
    #[error("Failed to make graph Eulerian: {0}")]
    AugmentationFailed(String),

    /// Circuit construction failed
    #[error("Failed to construct Eulerian circuit: {0}")]
    CircuitConstructionFailed(String),
}