pub mod formats;
pub mod generate;
pub mod graph;
pub mod largest;
pub mod layout;
pub mod legacy;
pub mod ops;
pub mod regular;
pub mod rng;
pub mod search;
pub use formats::Format;
pub use generate::Model;
pub use graph::{Graph, GraphBuilder, WeightedGraph};
pub use largest::{Largest, Shape, largest};
pub use rng::RngKind;
pub use search::{
AUTO_TABU_TENURE, DEFAULT_KICK_SIZE, Experiment, MAX_AUTO_TABU_TENURE, Regular, SearchGraph,
SearchParams, SearchResult, auto_tabu_tenure, search, search_sequential, search_settings,
};
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("vertex {vertex} is out of range [0, {n})")]
VertexOutOfRange { vertex: i64, n: usize },
#[error("self-loop at vertex {0}; graphs must be simple")]
SelfLoop(usize),
#[error("vertex {0} is listed twice")]
DuplicateVertex(usize),
#[error(
"{0} is not a valid subgraph size: it must be at least 2, larger than the number of fixed vertices, and smaller than the number of graph vertices"
)]
InvalidSubgraphSize(i64),
#[error("{0} is not a valid diversification frequency: it must be at least 1")]
InvalidDiversificationFrequency(i64),
#[error(
"the file holds {0} graphs; choose one (CLI: --index N, Python: index=N) or use them all (CLI: search --all, Python: read_all)"
)]
MultipleGraphs(usize),
#[error("{0}")]
Invalid(String),
#[error("{}{msg}", line.map(|l| format!("line {l}: ")).unwrap_or_default())]
Parse { line: Option<usize>, msg: String },
#[error("{0}")]
Legacy(String),
#[error(transparent)]
Io(#[from] std::io::Error),
}