Expand description
Attributed graphs with typed node and edge features
This module provides AttributedGraph<N, E> – a graph where every node
carries data of type N and every edge carries data of type E. It
differs from the attribute-map approach in crate::attributes in that
the feature types are statically known, enabling zero-cost extraction of
dense feature matrices via a user-supplied projection function.
§Key types
| Type | Purpose |
|---|---|
AttributedGraph<N,E> | Core graph container |
AttributedGraphBuilder<N,E> | Ergonomic builder |
NeighborInfo<N,E> | Neighbour + data bundle returned by attributed_neighbors |
§Free functions
node_feature_matrix– project node data into anArray2<f64>edge_feature_matrix– project edge data into anArray2<f64>attributed_neighbors– enumerate neighbours with their datadijkstra_attributed– generalised Dijkstra using a caller-supplied cost function
Structs§
- Attributed
Graph - A directed graph whose nodes carry data of type
Nand whose edges carry data of typeE. - Attributed
Graph Builder - Builder for
AttributedGraphthat provides a fluent API. - Neighbor
Info - A neighbour together with its node data and the connecting edge data.
- NodeId
- Stable integer node identifier.
Functions§
- attributed_
neighbors - Return the out-neighbours of
nodetogether with their node data and the connecting edge data. - dijkstra_
attributed - Generalised Dijkstra shortest-path algorithm on an attributed graph.
- edge_
feature_ matrix - Construct a dense edge-feature matrix from an attributed graph.
- filter_
nodes - Filter nodes by a predicate on their data, returning matching
NodeIds. - in_
degrees - Compute the in-degree of each node.
- node_
feature_ matrix - Construct a dense node-feature matrix from an attributed graph.
- out_
degrees - Compute the out-degree of each node.