aiondb-graph

Property graph model and graph-algorithm library. Defines node and edge label descriptors, traversal and pattern-match specifications, the planner entry point used by the engine for graph queries, and a set of algorithms that operate on the GraphView trait abstraction.

cargo

[dependencies]
aiondb-graph = { path = "../aiondb-graph" }

modules

modulepurpose
modelunified GraphLabelDescriptor (node or edge).
nodeNodeDescriptor for graph nodes.
edgeEdgeDescriptor for graph edges.
traversalTraversalSpec and TraversalDirection.
patternMatchPattern, RowProvider, and the pattern matcher.
pathshortest-path and all-paths algorithms.
plannerbuild_graph_plan planner entry point.
algorithmsalgorithm library on top of the GraphView trait.

algorithms

modulefunctions
pagerankpagerank, pagerank_default, PageRankConfig.
connected_componentsconnected_components, count_components, strongly_connected_components.
communitylouvain, louvain_with_config, modularity, LouvainConfig.
centralitybetweenness_centrality, betweenness_centrality_normalized, closeness_centrality.
degreedegree_centrality, in_degree_centrality, out_degree_centrality, degree_distribution.
triangletriangle_count, node_triangle_count, local_clustering_coefficient, global_clustering_coefficient.
similarityjaccard_similarity, overlap_coefficient, adamic_adar, common_neighbors, top_k_similar.
kcorecore_numbers, degeneracy.
procedureslist_procedures, execute_algorithm, AlgorithmConfig, ProcedureInfo.

key types

itemdescription
GraphLabelDescriptorenum wrapping NodeLabelDescriptor or EdgeLabelDescriptor.
NodeDescriptorproperty metadata for a graph node label.
EdgeDescriptorsource/target plus property metadata for an edge label.
TraversalSpec, TraversalDirectiondirection and depth bounds for traversals.
MatchPattern, PatternStep, NodeMatchSpec, RelMatchSpecpattern-match query shape.
Binding, BoundValue, MatchResult, PathElementpattern-match output.
RowProvidertrait used by pattern and path algorithms to fetch rows and adjacency.
match_patternexecute a MatchPattern against a RowProvider.
shortest_path, all_pathsgraph path algorithms over RowProvider.
build_graph_planplanner entry point for graph queries.
algorithms::GraphView, algorithms::AdjacencyGraphabstract graph trait and a simple in-memory implementation.

Fabric sharding

Graph Fabric routing lives in aiondb-shard::fabric so graph placement stays separate from generic row storage. GraphShardSpec::route_adjacency routes outgoing or incoming adjacency to one shard when the edge shard key is exactly the requested endpoint, and ShardedStorage uses that path before calling adjacency indexes on physical shards. The sharded storage registry caches the Fabric spec and updates it from the real register_edge_table(source, target) ordinals, so edge tables whose source/target columns are not the first two columns still route correctly. GraphShardSpec::route_edge routes exact edge lookups when source and target are known, including composite (source_id, target_id) shard keys, and falls back to fan-out when the endpoint mapping cannot prove shard locality.

example

use aiondb_graph::algorithms::{pagerank_default, AdjacencyGraph};

let mut graph = AdjacencyGraph::new(4);
graph.add_edge(0, 1);
graph.add_edge(1, 2);
graph.add_edge(2, 0);
graph.add_edge(3, 0);

let scores = pagerank_default(&graph);
assert_eq!(scores.len(), 4);