Skip to main content

Crate graphops

Crate graphops 

Source
Expand description

graphops: graph operators (walk/diffusion + related centralities).

This crate is the canonical home for operator implementations in this workspace. Call sites should prefer graphops::* (and not refer to historical names).

Public invariants (must not drift):

  • Node order: outputs are indexed by node id (0..n-1) consistent with the input graph’s adapter semantics (e.g. petgraph::NodeIndex::index() when using the petgraph feature).
  • Determinism: deterministic operators are deterministic given identical inputs + configs.
  • No silent normalization: normalization behavior is explicit in the API/docs (e.g. personalization vectors in PPR).

Swappable (allowed to change without breaking the contract):

  • iteration strategy (serial vs parallel)
  • convergence details (so long as tolerance semantics remain correct)
  • internal data structures (so long as invariants hold)

Re-exports§

pub use betweenness::betweenness_centrality;
pub use graph::PetgraphRef;
pub use graph::AdjacencyMatrix;
pub use graph::Graph;
pub use graph::GraphRef;
pub use graph::WeightedGraph;
pub use graph::WeightedGraphRef;
pub use node2vec::generate_biased_walks_precomp_ref;
pub use node2vec::generate_biased_walks_precomp_ref_from_nodes;
pub use node2vec::generate_biased_walks_weighted_plus_ref;
pub use node2vec::generate_biased_walks_weighted_ref;
pub use node2vec::PrecomputedBiasedWalks;
pub use node2vec::WeightedNode2VecPlusConfig;
pub use node2vec::generate_biased_walks_precomp_ref_parallel_from_nodes;
pub use random_walk::generate_biased_walks_ref_parallel;
pub use random_walk::generate_biased_walks_ref_parallel_from_nodes;
pub use random_walk::generate_walks_ref_parallel;
pub use random_walk::generate_walks_ref_parallel_from_nodes;
pub use centrality::closeness_centrality;
pub use centrality::harmonic_centrality;
pub use centrality::hits;
pub use eigenvector::eigenvector_centrality;
pub use eigenvector::eigenvector_centrality_run;
pub use eigenvector::EigenvectorRun;
pub use ellipsoidal::ellipsoid_distance;
pub use ellipsoidal::ellipsoid_overlap;
pub use ellipsoidal::ellipsoidal_embedding;
pub use ellipsoidal::Ellipsoid;
pub use ellipsoidal::EllipsoidalConfig;
pub use graph_kernel::random_walk_kernel;
pub use graph_kernel::sliced_wasserstein_graph_kernel;
pub use graph_kernel::structural_node_features;
pub use graph_kernel::wl_subtree_kernel;
pub use leiden::leiden;
pub use leiden::leiden_seeded;
pub use leiden::leiden_weighted;
pub use leiden::leiden_weighted_seeded;
pub use louvain::louvain;
pub use louvain::louvain_seeded;
pub use louvain::louvain_weighted;
pub use louvain::louvain_weighted_seeded;
pub use pagerank::pagerank;
pub use pagerank::pagerank_weighted;
pub use pagerank::PageRankConfig;
pub use pagerank::pagerank_checked;
pub use pagerank::pagerank_weighted_checked;
pub use pagerank::pagerank_checked_run;
pub use pagerank::pagerank_run;
pub use pagerank::pagerank_weighted_checked_run;
pub use pagerank::pagerank_weighted_run;
pub use pagerank::PageRankRun;
pub use partition::connected_components;
pub use partition::core_numbers;
pub use partition::k_core;
pub use partition::label_propagation;
pub use partition::strongly_connected_components;
pub use partition::topological_sort;
pub use ppr::personalized_pagerank;
pub use ppr::personalized_pagerank_checked;
pub use ppr::personalized_pagerank_checked_run;
pub use ppr::personalized_pagerank_run;
pub use random_walk::generate_biased_walks;
pub use random_walk::generate_biased_walks_from_nodes;
pub use random_walk::generate_biased_walks_ref;
pub use random_walk::generate_biased_walks_ref_from_nodes;
pub use random_walk::generate_biased_walks_ref_streaming_from_nodes;
pub use random_walk::generate_walks;
pub use random_walk::generate_walks_from_nodes;
pub use random_walk::generate_walks_ref;
pub use random_walk::generate_walks_ref_from_nodes;
pub use random_walk::generate_walks_ref_streaming_from_nodes;
pub use random_walk::sample_start_nodes_reservoir;
pub use random_walk::WalkConfig;
pub use reachability::reachability_counts_edges;
pub use shortest_path::bfs_distances;
pub use shortest_path::bfs_path;
pub use shortest_path::dijkstra_distances;
pub use similarity::cosine;
pub use similarity::jaccard;
pub use similarity::overlap;
pub use similarity::top_k_similar_jaccard;
pub use topk::normalize;
pub use topk::top_k;
pub use triangle::clustering_coefficients;
pub use triangle::global_clustering_coefficient;
pub use triangle::triangle_count;

Modules§

betweenness
Betweenness centrality.
centrality
Centrality measures beyond PageRank/betweenness.
eigenvector
Eigenvector centrality via power iteration.
ellipsoidal
Ellipsoidal graph embeddings.
graph
Minimal graph adapter traits.
graph_kernel
Graph kernels: WL subtree, random walk, and sliced Wasserstein. Graph kernels: similarity measures between labeled graphs.
leiden
Leiden community detection (Traag, Waltman & van Eck, 2019).
louvain
Louvain community detection (Blondel et al., 2008).
node2vec
Node2Vec / Node2Vec+ walk generation (OTF + PreComp).
pagerank
PageRank centrality (power iteration on a random-surfer Markov chain).
partition
Graph partitioning / community detection.
ppr
Personalized PageRank.
random_walk
Random walk generation.
reachability
Reachability helpers (transitive closure counts).
shortest_path
Shortest path wrappers for GraphRef and WeightedGraphRef.
similarity
Node similarity based on neighborhood overlap.
topk
Ranking utilities.
triangle
Triangle counting and clustering coefficients.

Enums§

Error
Errors returned by the *_checked variants of graph operators.

Type Aliases§

Result
Shorthand for std::result::Result<T, Error>.