Skip to main content

Module attributed_graph

Module attributed_graph 

Source
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

TypePurpose
AttributedGraph<N,E>Core graph container
AttributedGraphBuilder<N,E>Ergonomic builder
NeighborInfo<N,E>Neighbour + data bundle returned by attributed_neighbors

§Free functions

Structs§

AttributedGraph
A directed graph whose nodes carry data of type N and whose edges carry data of type E.
AttributedGraphBuilder
Builder for AttributedGraph that provides a fluent API.
NeighborInfo
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 node together 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.