Expand description
Graph topology types.
This module provides the Graph trait and various graph implementations:
SimpleGraph: Standard unweighted graph (default for most problems)UnitDiskGraph: Vertices with 2D positions, edges based on distanceHyperGraph: Edges can connect any number of vertices
§Design Philosophy
Following Julia’s Graphs.jl pattern, problems are generic over graph type:
ⓘ
// Problems work with any graph type
pub struct IndependentSet<G: Graph = SimpleGraph, W = i32> {
graph: G,
weights: Vec<W>,
}
// Reductions can target specific topologies
impl ReduceTo<IndependentSet<SimpleGraph>> for SAT { ... }
impl ReduceTo<IndependentSet<UnitDiskGraph>> for SAT { ... } // Different gadgets!Structs§
- Hyper
Graph - A hypergraph where edges can connect any number of vertices.
- Simple
Graph - A simple unweighted undirected graph.
- Unit
Disk Graph - A unit disk graph with vertices at 2D positions.
Traits§
- Graph
- Trait for graph types, following Julia’s Graphs.jl AbstractGraph pattern.