Expand description
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);Modules§
- loader
- Validation boundary for graph-query response bytes.
Structs§
- Betweenness
Options - Node and edge betweenness options.
- Community
- One canonical community.
- Community
Result - Louvain partition and diagnostics.
- Cycle
- One canonical simple cycle. The first node is not repeated at the end.
- Cycle
Options - Bounded cycle-enumeration options.
- Cycle
Result - Bounded cycle output and truncation state.
- Edge
- Immutable edge input and public edge record.
- EdgeId
- Collision-free identity for a stored edge or a synthesized reversal.
- Edge
Score - One stable edge centrality score.
- Graph
- Validated immutable graph used by every native algorithm.
- Graph
Property - Property selected as a graph identity source.
- Layout
Options - Deterministic Fruchterman-Reingold layout options.
- Leiden
Options - Weighted Leiden options matching Graphify’s graspologic defaults while making convergence work explicitly bounded.
- Leiden
Result - Canonical weighted Leiden partition and diagnostics.
- Louvain
Options - Proper weighted multi-level Louvain options.
- Node
- Immutable node input and public node record.
- Node
Degree - One deterministic node degree record.
- Node
Position - One final two-dimensional node position.
- Node
Score - One node centrality score.
- NonNegative
Finite F64 - Finite floating-point value greater than or equal to zero.
- Path
Edge - One edge in a found path.
- Positive
Finite F64 - Finite floating-point value strictly greater than zero.
- Traversal
Options - Complete Graphify-compatible traversal options.
- Traversal
Result - Stable traversal output.
- Traversed
Edge - Edge responsible for one discovery.
- Visit
- One visited node.
Enums§
- Betweenness
Mode - Source-selection policy for Brandes centrality.
- Degree
Kind - Degree flavor.
- Edge
Traversal Direction - Whether an edge was traversed with or against its stored orientation.
- External
Id - Lossless, deterministically ordered external graph identity.
- Graph
Error - Graph construction or lookup failure.
- Graph
Kind - Declared graph topology contract.
- HubExpansion
Policy - Whether high-degree nodes may expand their adjacency.
- Identity
Selection - Explicit node identity selection contract.
- Path
Result - Exhaustive local shortest-path result states.
- Path
Weight - Whether shortest paths use edge weights.
- Traversal
Direction - Direction used by local graph traversals.
- Traversal
Strategy - Traversal algorithm.
Type Aliases§
- Attributes
- Selected immutable properties attached to a node, edge, or graph.
- NodeId
- Opaque external node identifier returned to SDK callers.