helix-graph-algorithms 0.1.0

Storage-independent native graph representation and algorithms for Helix SDKs
Documentation

Storage-independent graph representation and native graph algorithms.

The crate deliberately has no dependency on Helix storage, query planning, async runtimes, or SDK bindings. SDKs query Helix once, construct a validated [Graph], and reuse that immutable graph for any number of local algorithms.

use helix_graph_algorithms::{Edge, Graph, GraphKind, Node};

let graph = Graph::new(
    GraphKind::DiGraph,
    [Node::new("a"), Node::new("b")],
    [Edge::new("ab", "a", "b")],
)?;
assert_eq!(graph.node_count(), 2);
assert_eq!(graph.edge_count(), 1);
# Ok::<(), helix_graph_algorithms::GraphError>(())