problemreductions/topology/
mod.rs

1//! Graph topology types.
2//!
3//! This module provides the [`Graph`] trait and various graph implementations:
4//!
5//! - [`SimpleGraph`]: Standard unweighted graph (default for most problems)
6//! - [`UnitDiskGraph`]: Vertices with 2D positions, edges based on distance
7//! - [`HyperGraph`]: Edges can connect any number of vertices
8//!
9//! # Design Philosophy
10//!
11//! Following Julia's Graphs.jl pattern, problems are generic over graph type:
12//!
13//! ```rust,ignore
14//! // Problems work with any graph type
15//! pub struct IndependentSet<G: Graph = SimpleGraph, W = i32> {
16//!     graph: G,
17//!     weights: Vec<W>,
18//! }
19//!
20//! // Reductions can target specific topologies
21//! impl ReduceTo<IndependentSet<SimpleGraph>> for SAT { ... }
22//! impl ReduceTo<IndependentSet<UnitDiskGraph>> for SAT { ... }  // Different gadgets!
23//! ```
24
25mod graph;
26mod hypergraph;
27mod unit_disk_graph;
28
29pub use graph::{Graph, SimpleGraph};
30pub use hypergraph::HyperGraph;
31pub use unit_disk_graph::UnitDiskGraph;