Module topology

Module topology 

Source
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 distance
  • HyperGraph: 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§

HyperGraph
A hypergraph where edges can connect any number of vertices.
SimpleGraph
A simple unweighted undirected graph.
UnitDiskGraph
A unit disk graph with vertices at 2D positions.

Traits§

Graph
Trait for graph types, following Julia’s Graphs.jl AbstractGraph pattern.