Skip to main content

Crate rust_igraph

Crate rust_igraph 

Source
Expand description

§rust-igraph

Pure-Rust, high-performance graph and network analysis library.

A faithful port of igraph with 1,297 public APIs, zero unsafe, and no C/C++ FFI. Built for researchers, data scientists, and systems engineers who need production-grade graph algorithms in the Rust ecosystem.

§Feature overview

CategoryHighlights
TraversalBFS, DFS, topological sort, random walks
Shortest pathsDijkstra, Bellman-Ford, A*, Johnson, all-pairs, widest paths
Centralitybetweenness, closeness, eigenvector, PageRank, HITS, Katz
CommunityLouvain, Leiden, Infomap, Spinglass, label propagation, Walktrap, fast greedy
Connectivitycomponents, articulation points, bridges, separators, percolation
Flowmax-flow, min-cut, Gomory-Hu tree, disjoint paths
IsomorphismVF2, LAD, BLISS canonical labeling, isoclass
GeneratorsErdos-Renyi, Barabasi-Albert, SBM, lattices, 40+ more
Properties60+ structural recognizers, degree stats, transitivity, graphlets
EigenvaluesLanczos (symmetric), Arnoldi (general), adjacency
LayoutFruchterman-Reingold, Kamada-Kawai, DrL, MDS, LGL, circle, tree
I/OGML, GraphML, Pajek, DOT, LEDA, DL, DIMACS, NCOL, LGL
SimilarityJaccard, Dice, inverse-log-weighted

§Quick start

use rust_igraph::{Graph, bfs};

let mut g = Graph::with_vertices(4);
g.add_edge(0, 1).unwrap();
g.add_edge(0, 2).unwrap();
g.add_edge(1, 3).unwrap();

let order = bfs(&g, 0).unwrap();
assert_eq!(order, vec![0, 1, 2, 3]);

Or with the fluent builder:

use rust_igraph::GraphBuilder;

let g = GraphBuilder::undirected()
    .edges(&[(0, 1), (1, 2), (2, 3), (3, 0)])
    .build()
    .unwrap();
assert_eq!(g.vcount(), 4);

Methods are available directly on Graph for the most common operations:

use rust_igraph::Graph;

let g = Graph::from_edges(&[(0,1), (1,2), (2,0)], false, None).unwrap();
assert!(g.is_connected().unwrap());
assert!(g.is_simple().unwrap());
let pr = g.pagerank().unwrap();
assert_eq!(pr.len(), 3);

Random graph generators are one method call away:

use rust_igraph::Graph;

let er = Graph::erdos_renyi(1000, 0.01, 42).unwrap();
let ba = Graph::barabasi_albert(1000, 3, 42).unwrap();
let ws = Graph::watts_strogatz(1000, 6, 0.1, 42).unwrap();
assert_eq!(er.vcount(), 1000);
assert_eq!(ba.vcount(), 1000);
assert_eq!(ws.vcount(), 1000);

§Complete workflow

A typical analysis pipeline — load, explore, analyze, in just a few lines:

use rust_igraph::Graph;

// Build a small network
let g = Graph::from_edges(
    &[(0,1),(1,2),(2,3),(3,4),(4,0),(0,2),(2,4)],
    false, None
).unwrap();

// Structural overview
assert!(g.is_connected().unwrap());
assert!(g.is_simple().unwrap());
let apl = g.average_path_length().unwrap().unwrap();
assert!(apl < 2.0);

// Centrality
let pr = g.pagerank().unwrap();
let bc = g.betweenness().unwrap();

// Community structure
let communities = g.louvain().unwrap();
assert!(communities.modularity >= 0.0);

// Single-pair shortest path
let path = g.shortest_path_to(0, 3, None).unwrap();
assert!(!path.vertices.is_empty());

// Random walk
let (walk, _edges) = g.random_walk(0, 20, 42).unwrap();
assert_eq!(walk[0], 0);

§Import style

All algorithms are also re-exported as free functions at the crate root:

use rust_igraph::{Graph, pagerank, betweenness, louvain};

For minimal imports, use the prelude module:

use rust_igraph::prelude::*;

§License

GPL-2.0-or-later, matching upstream igraph.

Re-exports§

pub use crate::algorithms::chordality::ChordalResult;
pub use crate::algorithms::chordality::McsResult;
pub use crate::algorithms::chordality::is_chordal;
pub use crate::algorithms::cliques::clique_number;
pub use crate::algorithms::cliques::clique_size_hist;
pub use crate::algorithms::cliques::cliques;
pub use crate::algorithms::cliques::independence_number;
pub use crate::algorithms::cliques::independent_vertex_sets;
pub use crate::algorithms::cliques::largest_cliques;
pub use crate::algorithms::cliques::largest_independent_vertex_sets;
pub use crate::algorithms::cliques::largest_weighted_cliques;
pub use crate::algorithms::cliques::maximal_cliques;
pub use crate::algorithms::cliques::maximal_cliques_count;
pub use crate::algorithms::cliques::maximal_cliques_hist;
pub use crate::algorithms::cliques::maximal_cliques_subset;
pub use crate::algorithms::cliques::maximal_independent_vertex_sets;
pub use crate::algorithms::cliques::weighted_clique_number;
pub use crate::algorithms::cliques::weighted_cliques;
pub use crate::algorithms::coloring::BipartiteColoringResult;
pub use crate::algorithms::coloring::BipartiteEdgeDirection;
pub use crate::algorithms::coloring::GreedyColoringHeuristic;
pub use crate::algorithms::coloring::chromatic_number_upper_bound;
pub use crate::algorithms::coloring::edge_chromatic_number;
pub use crate::algorithms::coloring::edge_coloring_greedy;
pub use crate::algorithms::coloring::is_bipartite_coloring;
pub use crate::algorithms::coloring::is_edge_coloring;
pub use crate::algorithms::coloring::is_vertex_coloring;
pub use crate::algorithms::coloring::vertex_chromatic_number;
pub use crate::algorithms::coloring::vertex_coloring_greedy;
pub use crate::algorithms::constructors::adjacency::AdjacencyMode;
pub use crate::algorithms::constructors::adjacency::LoopsMode;
pub use crate::algorithms::constructors::adjacency::adjacency;
pub use crate::algorithms::constructors::atlas::ATLAS_SIZE;
pub use crate::algorithms::constructors::atlas::atlas;
pub use crate::algorithms::constructors::biadjacency::BiadjacencyResult;
pub use crate::algorithms::constructors::biadjacency::biadjacency;
pub use crate::algorithms::constructors::circulant::circulant;
pub use crate::algorithms::constructors::create::create;
pub use crate::algorithms::constructors::create_bipartite::create_bipartite;
pub use crate::algorithms::constructors::de_bruijn::de_bruijn;
pub use crate::algorithms::constructors::extended_chordal_ring::extended_chordal_ring;
pub use crate::algorithms::constructors::famous::famous;
pub use crate::algorithms::constructors::famous::famous_names;
pub use crate::algorithms::constructors::full::full_graph;
pub use crate::algorithms::constructors::full_bipartite::FullBipartite;
pub use crate::algorithms::constructors::full_bipartite::full_bipartite;
pub use crate::algorithms::constructors::full_citation::full_citation;
pub use crate::algorithms::constructors::full_multipartite::FullMultipartite;
pub use crate::algorithms::constructors::full_multipartite::MultipartiteMode;
pub use crate::algorithms::constructors::full_multipartite::full_multipartite;
pub use crate::algorithms::constructors::generalized_petersen::generalized_petersen;
pub use crate::algorithms::constructors::hamming::hamming;
pub use crate::algorithms::constructors::hexagonal_lattice::hexagonal_lattice;
pub use crate::algorithms::constructors::hypercube::MAX_HYPERCUBE_DIMENSION;
pub use crate::algorithms::constructors::hypercube::hypercube;
pub use crate::algorithms::constructors::kary_tree::TreeMode;
pub use crate::algorithms::constructors::kary_tree::kary_tree;
pub use crate::algorithms::constructors::kautz::kautz;
pub use crate::algorithms::constructors::lcf::lcf;
pub use crate::algorithms::constructors::linegraph::linegraph;
pub use crate::algorithms::constructors::mycielskian::mycielski_graph;
pub use crate::algorithms::constructors::mycielskian::mycielskian;
pub use crate::algorithms::constructors::prufer::from_prufer;
pub use crate::algorithms::constructors::prufer::to_prufer;
pub use crate::algorithms::constructors::realize_bipartite_degree_sequence::realize_bipartite_degree_sequence;
pub use crate::algorithms::constructors::realize_degree_sequence::RealizeDegseqMethod;
pub use crate::algorithms::constructors::realize_degree_sequence::realize_degree_sequence;
pub use crate::algorithms::constructors::realize_directed_degree_sequence::realize_directed_degree_sequence;
pub use crate::algorithms::constructors::regular_tree::regular_tree;
pub use crate::algorithms::constructors::ring::cycle_graph;
pub use crate::algorithms::constructors::ring::path_graph;
pub use crate::algorithms::constructors::ring::ring_graph;
pub use crate::algorithms::constructors::square_lattice::square_lattice;
pub use crate::algorithms::constructors::star::StarMode;
pub use crate::algorithms::constructors::star::star_graph;
pub use crate::algorithms::constructors::symmetric_tree::symmetric_tree;
pub use crate::algorithms::constructors::tree_from_parent_vector::tree_from_parent_vector;
pub use crate::algorithms::constructors::triangular_lattice::triangular_lattice;
pub use crate::algorithms::constructors::turan::turan;
pub use crate::algorithms::constructors::weighted_adjacency::weighted_adjacency;
pub use crate::algorithms::constructors::weighted_biadjacency::WeightedBiadjacencyResult;
pub use crate::algorithms::constructors::weighted_biadjacency::weighted_biadjacency;
pub use crate::algorithms::constructors::wheel::WheelMode;
pub use crate::algorithms::constructors::wheel::wheel_graph;
pub use crate::algorithms::cycles::CycleMode;
pub use crate::algorithms::cycles::CycleResult;
pub use crate::algorithms::cycles::find_cycle;
pub use crate::algorithms::dominating_set::is_dominating_set;
pub use crate::algorithms::dominating_set::minimum_dominating_set;
pub use crate::algorithms::edge_cover::is_edge_cover;
pub use crate::algorithms::edge_cover::minimum_edge_cover;
pub use crate::algorithms::embedding::adjacency_spectral_embedding::AdjacencySpectralEmbeddingResult;
pub use crate::algorithms::embedding::adjacency_spectral_embedding::SpectralWhich;
pub use crate::algorithms::embedding::adjacency_spectral_embedding::adjacency_spectral_embedding;
pub use crate::algorithms::embedding::dim_select::dim_select;
pub use crate::algorithms::embedding::laplacian_spectral_embedding::LaplacianSpectralEmbeddingResult;
pub use crate::algorithms::embedding::laplacian_spectral_embedding::LaplacianType;
pub use crate::algorithms::embedding::laplacian_spectral_embedding::laplacian_spectral_embedding;
pub use crate::algorithms::epidemics::Sir;
pub use crate::algorithms::epidemics::sir;
pub use crate::algorithms::feedback_arc_set::FasAlgorithm;
pub use crate::algorithms::feedback_arc_set::feedback_arc_set;
pub use crate::algorithms::feedback_vertex_set::FvsAlgorithm;
pub use crate::algorithms::feedback_vertex_set::feedback_vertex_set;
pub use crate::algorithms::fundamental_cycles::fundamental_cycles;
pub use crate::algorithms::games::barabasi::barabasi_game_bag;
pub use crate::algorithms::games::barabasi_aging::barabasi_aging_game;
pub use crate::algorithms::games::barabasi_psumtree::barabasi_game_psumtree;
pub use crate::algorithms::games::barabasi_psumtree::barabasi_game_psumtree_multiple;
pub use crate::algorithms::games::bipartite::BipartiteGraph;
pub use crate::algorithms::games::bipartite::BipartiteMode;
pub use crate::algorithms::games::bipartite::bipartite_game_gnm;
pub use crate::algorithms::games::bipartite::bipartite_game_gnp;
pub use crate::algorithms::games::bipartite::bipartite_iea_game;
pub use crate::algorithms::games::callaway_traits::callaway_traits_game;
pub use crate::algorithms::games::chung_lu::ChungLuVariant;
pub use crate::algorithms::games::chung_lu::chung_lu_game;
pub use crate::algorithms::games::cited_type::cited_type_game;
pub use crate::algorithms::games::citing_cited_type::citing_cited_type_game;
pub use crate::algorithms::games::correlated::correlated_game;
pub use crate::algorithms::games::correlated::correlated_pair_game;
pub use crate::algorithms::games::degree_sequence::degree_sequence_game_configuration;
pub use crate::algorithms::games::degree_sequence_configuration_simple::degree_sequence_game_configuration_simple;
pub use crate::algorithms::games::degree_sequence_fast_heur::degree_sequence_game_fast_heur_simple;
pub use crate::algorithms::games::degree_sequence_vl::degree_sequence_game_vl;
pub use crate::algorithms::games::dotproduct::DotProductWarnings;
pub use crate::algorithms::games::dotproduct::dot_product_game;
pub use crate::algorithms::games::dotproduct::dot_product_game_with_warnings;
pub use crate::algorithms::games::edge_sampling::EdgeSplit;
pub use crate::algorithms::games::edge_sampling::sample_edges;
pub use crate::algorithms::games::edge_sampling::split_edges;
pub use crate::algorithms::games::edge_sampling::split_edges_connected;
pub use crate::algorithms::games::edge_switching_simple::degree_sequence_game_edge_switching_simple;
pub use crate::algorithms::games::erdos_renyi::erdos_renyi_gnm;
pub use crate::algorithms::games::erdos_renyi::erdos_renyi_gnp;
pub use crate::algorithms::games::establishment::establishment_game;
pub use crate::algorithms::games::forestfire::forest_fire_game;
pub use crate::algorithms::games::grg::grg_game;
pub use crate::algorithms::games::grg::grg_game_with_coords;
pub use crate::algorithms::games::growing_random::growing_random_game;
pub use crate::algorithms::games::hsbm::hsbm_game;
pub use crate::algorithms::games::hsbm::hsbm_list_game;
pub use crate::algorithms::games::iea_game::iea_game;
pub use crate::algorithms::games::islands::simple_interconnected_islands_game;
pub use crate::algorithms::games::k_regular::k_regular_game;
pub use crate::algorithms::games::lastcit::lastcit_game;
pub use crate::algorithms::games::negative_sampling::sample_negative_edges;
pub use crate::algorithms::games::negative_sampling::sample_negative_edges_degree_biased;
pub use crate::algorithms::games::negative_sampling::sample_negative_edges_excluding;
pub use crate::algorithms::games::preference::asymmetric_preference_game;
pub use crate::algorithms::games::preference::preference_game;
pub use crate::algorithms::games::recent_degree::recent_degree_game;
pub use crate::algorithms::games::recent_degree_aging::recent_degree_aging_game;
pub use crate::algorithms::games::sbm::sbm_game;
pub use crate::algorithms::games::static_fitness::static_fitness_game;
pub use crate::algorithms::games::static_fitness::static_power_law_game;
pub use crate::algorithms::games::tree::tree_game_lerw;
pub use crate::algorithms::games::tree::tree_game_prufer;
pub use crate::algorithms::games::watts::watts_strogatz_game;
pub use crate::algorithms::graphlets::GraphletBasis;
pub use crate::algorithms::graphlets::GraphletDecomposition;
pub use crate::algorithms::graphlets::graphlets;
pub use crate::algorithms::graphlets::graphlets_candidate_basis;
pub use crate::algorithms::graphlets::graphlets_project;
pub use crate::algorithms::hrg::HrgDendrogram;
pub use crate::algorithms::hrg::HrgTree;
pub use crate::algorithms::hrg::from_hrg_dendrogram;
pub use crate::algorithms::hrg::hrg_consensus;
pub use crate::algorithms::hrg::hrg_create;
pub use crate::algorithms::hrg::hrg_fit;
pub use crate::algorithms::hrg::hrg_game;
pub use crate::algorithms::hrg::hrg_predict;
pub use crate::algorithms::hrg::hrg_sample;
pub use crate::algorithms::hrg::hrg_sample_many;
pub use crate::algorithms::independent_set::maximum_independent_set;
pub use crate::algorithms::matching::MatchingResult;
pub use crate::algorithms::matching::is_matching;
pub use crate::algorithms::matching::is_maximal_matching;
pub use crate::algorithms::matching::maximum_bipartite_matching;
pub use crate::algorithms::matching::maximum_bipartite_matching_weighted;
pub use crate::algorithms::matching_lsap::solve_lsap;
pub use crate::algorithms::max_cut::MaxCutResult;
pub use crate::algorithms::max_cut::cut_value;
pub use crate::algorithms::max_cut::maximum_cut;
pub use crate::algorithms::minimum_cycle_basis::minimum_cycle_basis;
pub use crate::algorithms::motifs::DyadCensus;
pub use crate::algorithms::motifs::TriadCensus;
pub use crate::algorithms::motifs::TriadType;
pub use crate::algorithms::motifs::dyad_census;
pub use crate::algorithms::motifs::graph_count;
pub use crate::algorithms::motifs::graph_count;
pub use crate::algorithms::motifs::isoclass;
pub use crate::algorithms::motifs::isoclass;
pub use crate::algorithms::motifs::isoclass_create;
pub use crate::algorithms::motifs::isoclass_subgraph;
pub use crate::algorithms::motifs::motifs_randesu;
pub use crate::algorithms::motifs::motifs_randesu;
pub use crate::algorithms::motifs::motifs_randesu_callback;
pub use crate::algorithms::motifs::motifs_randesu_estimate;
pub use crate::algorithms::motifs::motifs_randesu_no;
pub use crate::algorithms::motifs::triad_census;
pub use crate::algorithms::motifs::triad_census;
pub use crate::algorithms::simple_cycles::SimpleCycle;
pub use crate::algorithms::simple_cycles::SimpleCycleMode;
pub use crate::algorithms::simple_cycles::simple_cycles;
pub use crate::algorithms::vertex_cover::is_vertex_cover;
pub use crate::algorithms::vertex_cover::minimum_vertex_cover;

Modules§

algorithms
Algorithm implementations for rust-igraph.
prelude
Minimal import set for common use cases.

Structs§

AllShortestPaths
Result of get_all_shortest_paths / get_all_shortest_paths_with_mode.
AllShortestPathsDijkstra
Result of get_all_shortest_paths_dijkstra.
BetaWeightedGabriel
A Gabriel graph together with the per-edge β-threshold weights.
BfsSimple
Result of bfs_simple.
BfsTree
Result of a multi-output BFS scan from a single root. Returned by bfs_tree.
BiconnectedComponents
Output of biconnected_components.
BipartiteProjection
Result of a bipartite projection.
BipartiteProjectionSize
Sizes of both bipartite projections.
BipartiteResult
Result of bipartiteness check.
CentralizationResult
Result of a centralization convenience wrapper.
ClosenessCutoffResult
Result of closeness_cutoff.
CohesiveBlocks
Result of cohesive_blocks.
CommunityToMembershipResult
Result of community_to_membership: per-vertex cluster ids densified to 0..k, plus the size of each cluster in the same order.
CommunityVoronoiResult
Result of community_voronoi.
ConnectedComponents
Result of a weak connected-components scan.
ConvexHullResult
Result of convex_hull_2d.
DfsSimple
Result of dfs_simple.
DfsTree
Result of a multi-output DFS scan from a single root. Returned by dfs_tree.
DhParams
Parameters for the Davidson-Harel layout.
DijkstraAllPaths
Output of dijkstra_all_shortest_paths.
DijkstraPaths
Output of dijkstra_paths. parents[v] is the predecessor of v along the shortest-path tree from the single source (or None for the source itself and for unreachable vertices — the caller can disambiguate via distances[v]). inbound_edges[v] is the edge id v was reached through; None for the source and unreachable vertices.
DimacsGraph
Result of reading a DIMACS file.
DlGraph
Result of reading a DL file.
DominatorTree
Result of dominator_tree.
DotGraph
Result of parsing a DOT file.
DrlOptions
Full DrL options.
EccentricityClasses
Result of eccentricity_classes.
EdgeBetweennessResult
Result of edge_betweenness_community.
EdgelistPercolation
Outputs of edgelist_percolation. Same length as the input edge slice. giant_size[i] is the size of the largest component after edge i is added; vertex_count[i] is the number of distinct vertices touched by edges 0..=i.
EigenDecomposition
Result of an eigenvalue decomposition.
EigenvectorScores
Output of eigenvector_centrality_full: the normalised centrality vector and the dominant eigenvalue of the (possibly shifted-back) adjacency matrix.
EulerianClassification
Whether an Eulerian path or cycle exists in a graph.
EvenTarjanResult
Result of the Even-Tarjan reduction.
FastGreedyResult
Result of fast_greedy_modularity / fast_greedy_modularity_weighted.
FluidOptions
Full option bag for fluid_communities_with_options.
FluidResult
Result of fluid_communities / fluid_communities_with_options.
FrBounds
Optional per-vertex bounding box constraints.
FrBounds3d
3D bounding box constraints.
FrParams
Parameters for the 2D Fruchterman-Reingold layout.
FrParams3d
Parameters for the 3D Fruchterman-Reingold layout.
GemParams
Parameters for the GEM layout algorithm.
GeneralEigenDecomposition
Result of a general eigenvalue decomposition.
GetBiadjacencyResult
Result of get_biadjacency_matrix.
GetBiadjacencyWeightedResult
Result of get_biadjacency_weighted.
GomoryHuTree
Output of gomory_hu_tree — a weighted undirected tree on the same vertex set as the input graph, plus one flow value per tree edge.
Graph
Counterpart of igraph_t (see references/igraph/include/igraph_datatype.h).
GraphBuilder
A fluent builder for constructing Graph instances.
GraphSummary
Result of graph_summary containing precomputed graph statistics.
GraphmlGraph
Result of parsing a GraphML file.
GraphoptParams
Parameters for the GraphOpt layout.
HitsScores
Output of hub_and_authority_scores: scaled hub and authority vectors and the dominant eigenvalue of A·Aᵀ.
InducedSubgraphResult
Result of an induced subgraph extraction.
InfomapResult
Result of an Infomap run.
KShortestPath
Result of k_shortest_paths.
KkBounds
Per-vertex coordinate bounds for the 2D KK layout.
KkBounds3d
Per-vertex coordinate bounds for the 3D KK layout.
KkParams
Parameters for the 2D Kamada-Kawai layout.
KkParams3d
Parameters for the 3D Kamada-Kawai layout.
LabelSpreadResult
Result of label spreading prediction.
LadSubisomorphism
Result of a first-solution LAD subgraph-isomorphism search (subisomorphic_lad).
LeadingEigenvectorResult
Result of the leading eigenvector community detection.
LedaGraph
Result of reading a LEDA file.
LeidenOptions
Full set of options for leiden_with_options. Construct via LeidenOptions::default() and then mutate the fields you care about, mirroring the way upstream C exposes per-parameter defaults.
LeidenResult
Result of a Leiden run.
LglGraph
Result of reading an LGL file: the graph plus optional metadata.
LglParams
Parameters for the LGL layout algorithm.
LouvainResult
Result of a Louvain run.
LpaOptions
Full option bag for label_propagation_with_options.
LpaResult
Result of a label-propagation run.
MaxFlow
Output of max_flow: scalar value, per-edge flow vector, cut edge ids, and source-side / sink-side vertex partitions.
NcolGraph
Result of reading an NCOL file: the graph plus optional metadata.
NeighborSampleResult
Result of k-hop neighborhood sampling.
NeighborsIter
Zero-allocation iterator over the neighbors of a vertex.
PajekGraph
Result of reading a Pajek file.
PathLengthHistResult
Result of path_length_hist.
PowerLawFitResult
Result of fitting a power-law distribution to a sample.
PseudoDiameterResult
Result of the pseudo-diameter computation.
ReachabilityResult
Result of a reachability analysis.
ReindexMembershipResult
Result of reindex_membership: a densified membership vector [0, k), the old cluster id behind each new id (so new_to_old[i] is the original id that now maps to i), and the number of distinct clusters k = new_to_old.len().
ResidualGraphResult
Result of the residual graph computation.
ShortestPath
A single shortest path: the vertex sequence (including from and to) and the edge sequence along it. For a path of k vertices the edge vector has k - 1 entries.
ShortestPathsDijkstra
Result of get_shortest_paths_dijkstra: vertex and edge paths from a single source to all vertices.
SimplifyAndColorize
The colored simple graph produced by simplify_and_colorize.
SitePercolation
Outputs of site_percolation. Same length as vertex_order. giant_size[i] is the size of the largest connected component after vertex vertex_order[i] is activated; edge_count[i] is the cumulative number of edges added through step i (an edge is “added” the moment both its endpoints become active).
SpinglassOptions
Options for spinglass community detection.
SpinglassResult
Result of spinglass community detection.
SplitJoinDistance
Asymmetric split-join distances between two community partitions.
StCuts
Result of all_st_cuts.
StMinCuts
Result of all_st_mincuts.
StMincut
Output of st_mincut: scalar value, cut edge ids, and the source-side / sink-side vertex partitions.
StronglyRegularParams
Result of strongly regular graph recognition.
StructuralFeatures
Per-vertex structural feature vector.
SubgraphFromEdgesResult
Result of a subgraph-from-edges extraction.
SugiyamaParams
Parameters for the Sugiyama layout.
SugiyamaResult
Result of a Sugiyama layout computation.
UmapParams
Parameters for the UMAP layout algorithm.
UnfoldTreeResult
Result of unfolding a graph into a tree.
Vf2Isomorphism
Result of an exact VF2 graph-isomorphism test (isomorphic_vf2).
Vf2Subisomorphism
Result of a VF2 subgraph-isomorphism test (subisomorphic_vf2).
VoronoiPartition
Result of voronoi: the Voronoi cell each vertex belongs to plus the distance to its assigned generator.
WalktrapOptions
Tuning knobs for walktrap_with_options.
WalktrapResult
Result of walktrap / walktrap_weighted / walktrap_with_options.
WidestPaths
Sidecar outputs from a single-source widest-paths run. Carries the widths vector plus the parent-pointer SPT (vertex-side and edge-side). Counterpart of the parents and inbound_edges outputs of igraph_get_widest_paths. Source itself has parents[source] == None and inbound_edges[source] == None; unreachable vertices also have both None. To disambiguate the source from unreachable targets, consult widths: source has Some(f64::INFINITY), unreachable has None.
WlHashResult
Result of Weisfeiler-Lehman hashing.

Enums§

AdjacencyType
Which triangle of the adjacency matrix to fill (undirected graphs only).
AggMode
Aggregation mode for neighborhood operations.
AllShortestPathsMode
Direction mode for get_all_shortest_paths and get_all_shortest_paths_with_mode.
AttributeValue
A single attribute value attached to a graph, vertex, or edge.
BfsMode
Direction mode for bfs_simple.
CachedProperty
The set of boolean graph properties that may be cached.
CentralizationMode
Whether centralization considers in-degree, out-degree, or total.
CommunityComparison
Which partition-comparison measure compare_communities returns.
ConnectednessMode
Connectivity mode for directed graphs.
CorenessMode
Direction-handling for coreness_with_mode.
DegreeMode
Direction mode for degree computation in directed graphs.
DfsMode
Direction mode for dfs_simple.
DijkstraMode
Direction selector for the mode-aware Dijkstra entry points (SP-001c). Counterpart of igraph_neimode_t restricted to the three values igraph_distances_dijkstra accepts. For undirected graphs every variant collapses to DijkstraMode::All (every edge is bidirectional).
DimacsProblem
The type of DIMACS problem read from the file.
DistanceMetric
Distance metric for spatial edge length computation.
DistancesCutoffMode
Direction mode for cutoff-aware unweighted distance functions.
DistancesFromMode
Direction mode for distances_from_with_mode.
DistancesMode
Direction mode for distances_all_with_mode.
DominatorMode
Traversal direction for dominator_tree.
DrlTemplate
Predefined parameter templates for DrL.
EccMode
Mode for direction-aware eccentricity / radius / diameter on directed graphs. For undirected graphs every mode reduces to EccMode::All.
EdgeTypeFilter
What kinds of edges are allowed when testing graphicality.
EigenWhich
Which eigenvalues to compute.
EigenvectorMode
How to consider edge directions for eigenvector_centrality_full and friends. Mirrors upstream’s IGRAPH_OUT / IGRAPH_IN / IGRAPH_ALL.
FrGrid
Grid acceleration mode for Fruchterman-Reingold layout.
GeneralEigenWhich
Which eigenvalues to compute for a general (non-symmetric) matrix.
GraphProductType
Selects which graph product type to compute.
IgraphError
All errors returned from rust-igraph.
LaplacianNormalization
Laplacian normalization mode.
LeidenObjective
Quality function (objective) that Leiden optimises. Mirrors igraph_leiden_objective_t.
LoopHandling
How to count self-loop edges in the adjacency matrix diagonal.
LoopMode
How loops are counted when computing degree centralization.
LpaVariant
Which variant of label propagation to run. Mirrors igraph_lpa_variant_t.
MstAlgorithm
Selector for the minimum-spanning-tree algorithm.
NeighborhoodMode
Direction mode for neighborhood_size_with_mode on directed graphs. Ignored on undirected graphs — every mode reduces to NeighborhoodMode::All.
ReachabilityMode
Direction mode for reachability in directed graphs.
ReciprocityMode
Reciprocity formula choice. Counterpart of upstream’s igraph_reciprocity_t (IGRAPH_RECIPROCITY_DEFAULT / IGRAPH_RECIPROCITY_RATIO).
RewireDirectedMode
Which endpoint of a directed edge to rewire.
RootChoice
Heuristic for selecting tree-layout roots when multiple candidates exist within a component.
RtMode
Mode for tree edge traversal direction.
ShortestPathMode
Direction mode for get_shortest_paths_with_mode.
SimpleMode
Direction-handling for is_simple_with_mode. Counterpart of upstream’s directed boolean parameter.
SimplePathMode
Mode for traversing neighbors in directed graphs.
SortOrder
Sort order for vertex degree sorting.
SpinglassUpdateRule
Update rule for the spinglass null model.
StrengthMode
Direction mode for strength_with_mode on directed graphs. Ignored on undirected graphs.
SubcomponentMode
Direction mode for subcomponent search.
ToDirectedMode
Mode for converting an undirected graph to directed.
ToUndirectedMode
Mode for converting a directed graph to undirected.
TransitivityMode
How to handle vertices with degree < 2 when averaging local transitivity.
VconnNei
Behaviour when source and target are directly adjacent.
VoronoiTiebreaker
Tie-breaking rule used when two or more generators reach a vertex at the same distance.
WalkMode
Direction mode for edge-path traversal.

Constants§

FLUID_DEFAULT_MAX_ITERATIONS
Default safety cap on outer iterations for fluid_communities / fluid_communities_with_options.
LEIDEN_DEFAULT_BETA
Default randomness used in the refinement step — same default as upstream igraph_community_leiden_simple (β = 0.01).
LEIDEN_DEFAULT_ITERATIONS
Default number of outer iterations. The reference paper and upstream both note that two iterations are usually enough.
SPINGLASS_DEFAULT_SPINS
Default number of spins for spinglass.
WALKTRAP_DEFAULT_STEPS
Default random-walk length matching the igraph reference (steps = 4).

Functions§

a_star_path
Single-source single-target shortest path using A*.
abc_entropy
Compute the ABC entropy.
abc_index
Compute the atom-bond connectivity (ABC) index.
adhesion
Group adhesion — igraph C alias igraph_adhesion (flow.c:2433). Exact synonym for edge_connectivity; kept for naming parity with the upstream API and so users following the White-Harary (2001) sociological-network literature have a direct hit. Identical signature and behaviour.
albertson_coindex
Compute the Albertson coindex.
albertson_index
Compute the Albertson index (edge irregularity).
algebraic_connectivity
Compute the algebraic connectivity of a graph.
all_minimal_st_separators
List all vertex sets that are minimal (s,t) separators for some s and t.
all_simple_paths
Enumerate all simple paths from from to vertices in to.
all_st_cuts
List all (s,t) edge cuts of a directed graph (Provan-Shier).
all_st_mincuts
List all minimum (s,t) edge cuts of a directed graph (Provan-Shier).
are_adjacent
Check whether two vertices are connected by at least one edge.
arithmetic_geometric_index
Compute the arithmetic-geometric index.
articulation_points
Articulation points of graph (returns vertices in upstream’s DFS-discovery order).
assortativity
Value-based assortativity coefficient of graph.
assortativity_degree
Degree assortativity coefficient of graph (undirected, unweighted). Returns None for graphs with no edges or for regular graphs (all vertices same degree — the variance denominator vanishes, matching upstream’s IGRAPH_NAN).
assortativity_degree_directed
Directed degree assortativity coefficient (ALGO-PR-006c).
assortativity_degree_directed_weighted
Directed weighted degree assortativity (PR-006d).
assortativity_degree_weighted
Weighted degree assortativity coefficient.
assortativity_nominal
Compute categorical (nominal) assortativity coefficient.
atom_bond_sum_connectivity
Compute the atom-bond sum-connectivity index.
attention_aggregate
Aggregate a signal with per-edge attention weights.
augmented_forman_ricci_curvature
Augmented Forman-Ricci curvature for each edge.
augmented_zagreb_index
Compute the augmented Zagreb index.
automorphism_group
Compute a generating set of the automorphism group Aut(G).
average_local_efficiency
Average of local_efficiency over all N vertices. By upstream convention, returns 0.0 when vcount < 3 (no vertex can have two distinct neighbours, so every per-vertex value is trivially 0).
average_sombor_index
Compute the average Sombor index.
avg_local_clustering
Compute the average local clustering coefficient.
avg_nearest_neighbor_degree
Average nearest-neighbour degree, per vertex.
avg_nearest_neighbor_degree_weighted
Weighted average nearest-neighbour degree (Barrat formula).
avg_neighbor_connectivity
Compute the average neighbor connectivity of the graph.
avg_neighbor_degree_ratio
Compute the average neighbor degree ratio.
avg_path_fraction
Compute the average path fraction.
balaban_j_index
Compute the Balaban J index of a graph.
bandwidth
Compute the exact graph bandwidth B(G).
bandwidth_lower_bound
Compute a lower bound on graph bandwidth.
bandwidth_of_labeling
Compute the bandwidth of a specific labeling.
bell_index
Compute the Bell index (degree population variance).
bellman_ford_distances
Single-source Bellman-Ford shortest distances on graph from source, following out-edges on directed graphs.
bellman_ford_distances_with_mode
Single-source Bellman-Ford with directed-mode selection.
bellman_ford_path_to
Returns the shortest path from source to target using Bellman-Ford, following out-edges on directed graphs.
bellman_ford_path_to_with_mode
Returns the shortest path from source to target using Bellman-Ford with directed-mode selection.
bellman_ford_paths
Shortest paths from source to each vertex in targets using Bellman-Ford (handles negative edge weights).
bellman_ford_paths_with_mode
Multi-target Bellman-Ford shortest paths with directed-mode selection.
bertz_complexity_index
Compute the Bertz complexity index.
beta_weighted_gabriel_graph
Build the β-weighted Gabriel graph of a point set.
betweenness
Per-vertex (unweighted) betweenness centrality.
betweenness_centralization
Compute betweenness centralization.
betweenness_cutoff
Range-limited betweenness centrality.
betweenness_subset
Subset betweenness centrality.
betweenness_weighted
Per-vertex weighted betweenness centrality.
bfs
Visit order of vertices reachable from root, in BFS order.
bfs_simple
Mode-aware BFS from a single root, returning visit order, layer boundaries, and BFS-tree parents.
bfs_tree
Multi-output BFS from root. Returns visit order, per-vertex distances, and per-vertex BFS-tree parent in a single pass.
bibcoupling
Computes bibliographic coupling scores between all pairs of vertices.
biconnected_components
Compute the biconnected components of graph.
bipartite_projection
Project a bipartite graph onto one of its vertex types.
bipartite_projection_size
Compute sizes of both bipartite projections without building them.
bipartiteness_ratio
Compute the bipartiteness ratio (2 - μ_n) / 2.
bond_percolation
Bond percolation: the size of the largest component as edges of graph are added in the order specified by edge_order.
bridge_ratio
Compute the bridge ratio of the graph.
bridges
Bridges of graph — edges whose removal would increase the number of (weakly) connected components.
canonical_permutation
Compute a canonical vertex permutation of graph.
cartesian_product
Computes the Cartesian product of two graphs.
centrality_correlation
Compute the centrality correlation (betweenness vs closeness).
centralization
Compute the graph-level centralization score from per-vertex scores.
centralization_betweenness_tmax
Theoretical maximum betweenness centralization for a star graph.
centralization_betweenness_wrapper
Betweenness centralization: compute per-vertex betweenness scores and the graph-level centralization in one call.
centralization_closeness_tmax
Theoretical maximum closeness centralization for a star graph.
centralization_closeness_wrapper
Closeness centralization: compute per-vertex closeness scores and the graph-level centralization in one call.
centralization_degree_tmax
Theoretical maximum degree centralization for a star graph.
centralization_degree_wrapper
Degree centralization: compute per-vertex degree scores and the graph-level centralization in one call.
centralization_eigenvector_tmax
Theoretical maximum eigenvector centralization for a star graph.
centralization_eigenvector_wrapper
Eigenvector centralization: compute per-vertex eigenvector centrality scores and the graph-level centralization in one call.
cheeger_bounds
Compute Cheeger constant bounds from the normalized Laplacian.
chromatic_number_greedy
Count the number of colors used in a coloring.
circle_beta_skeleton
Build the circle-based β-skeleton of a 2-D point set.
circuit_rank_ratio
Compute the circuit rank ratio of the graph.
class_homophily
Class-balanced homophily ratio (adjusted for class imbalance).
clique_cover_number
Compute the clique cover number θ(G).
closed_triplet_ratio
Compute the closed triplet ratio (global transitivity).
closeness
Per-vertex closeness centrality (Vec<Option<f64>>).
closeness_centralization
Compute closeness centralization.
closeness_cutoff
Range-limited closeness centrality.
closeness_weighted
Per-vertex weighted closeness centrality.
clustering_degree_correlation
Compute the clustering-degree correlation.
cocitation
Computes the cocitation scores between all pairs of vertices.
cohesion
Group cohesion — igraph C alias igraph_cohesion (flow.c:2470). Exact synonym for vertex_connectivity; kept for naming parity with the upstream API and so users following the White-Harary (2001) sociological-network literature have a direct hit. Identical signature and behaviour.
cohesive_blocks
Identify the hierarchical cohesive block structure of a graph.
collatz_sinogowitz
Compute the Collatz–Sinogowitz irregularity.
communicability_matrix
Compute the communicability matrix between all pairs of vertices.
community_to_membership
Cut a binary dendrogram at steps merges, returning the resulting membership and cluster-size vectors.
community_voronoi
Voronoi-based community detection.
compare_communities
Compare two community membership vectors over the same vertex set.
complementer
Returns the complementer of graph.
component_ratio
Compute the component ratio.
compose
Computes the composition of two graphs.
conductance
Compute the conductance of a partition.
connect_neighborhood
Returns a new graph where each vertex is connected to all vertices reachable within order steps in the original graph.
connected_components
Compute the weak connected components of graph.
connective_eccentricity_index
Compute the connective eccentricity index.
connectivity_index
Compute the connectivity index of the graph.
constraint
Compute Burt’s constraint scores for all vertices.
contract_vertices
Contracts vertices according to a grouping, merging edges.
convergence_degree
Per-edge convergence degree.
convergence_degree_full
Convergence degree along with the per-edge In(e) / Out(e) counts.
convex_hull_2d
Compute the convex hull of a set of 2D points.
coreness
Per-vertex coreness number.
coreness_with_mode
Coreness with explicit CorenessMode (ALGO-PR-015b).
count_adjacent_triangles
Per-vertex adjacent-triangle count. Entry i is the number of triangles vertex i participates in. Parallel edges and self-loops are ignored — the simple graph induced by the OUT-neighbour view is used (consistent with count_triangles). For directed graphs that is not yet the underlying-undirected projection that upstream uses; see ALGO-PR-002 for the deferred fix.
count_automorphisms
Count the automorphisms of graph — the order |Aut(G)| of its automorphism group.
count_isomorphisms_vf2
Count the number of VF2 isomorphic mappings between two graphs.
count_loops
Counts self-loop edges in graph.
count_multiple
Per-edge multiplicity: how many edges share each edge’s endpoint pair.
count_multiple_1
Multiplicity of a single edge: how many edges share the same endpoint pair as edge eid.
count_mutual
Count the number of mutual edge pairs in a directed graph.
count_pairs_at_distance
Compute the number of vertex pairs at a given distance.
count_reachable
Per-vertex count of reachable vertices (including the vertex itself).
count_subisomorphisms_vf2
Count the number of VF2 subgraph-isomorphic embeddings of the pattern graph2 into the target graph1.
count_triangles
Count the number of triangles in graph. Edge directions, parallel edges, and self-loops are ignored.
cut_size
Compute the cut size of a partition.
cyclomatic_density
Compute the cyclomatic density.
decompose
Decompose graph into its weakly connected components.
degeneracy
Return the degeneracy of a graph.
degree_centralization
Compute degree centralization.
degree_closeness_correlation
Compute the degree-closeness correlation.
degree_concentration
Compute the degree concentration.
degree_core_ratio
Compute the core ratio (fraction of vertices with degree ≥ d̄).
degree_correlation_vector
Compute the degree correlation function k_nn(k).
degree_cv
Compute the degree coefficient of variation.
degree_density
Compute the degree density (normalized second moment of degree).
degree_diff_connectivity
Compute the degree difference connectivity index.
degree_distance
Compute the degree-distance index (Schultz-type).
degree_distance_correlation
Compute the degree-distance correlation.
degree_distribution
Compute the degree distribution histogram of a graph.
degree_diversity
Compute the degree diversity (number of distinct degree values).
degree_eccentricity_index
Compute the degree-eccentricity index.
degree_entropy
Shannon entropy of the degree distribution.
degree_entropy_ln
Compute the Shannon entropy of the degree distribution (natural log).
degree_entropy_normalized
Compute the normalized degree entropy.
degree_gini
Compute the Gini coefficient of the degree sequence.
degree_harmonic_mean_index
Compute the degree harmonic mean index.
degree_herfindahl
Compute the Herfindahl–Hirschman index of the degree sequence.
degree_hoover
Compute the Hoover index (Robin Hood index) of the degree sequence.
degree_iqr
Compute the interquartile range (IQR) of the degree sequence.
degree_isolated_ratio
Compute the isolated ratio (fraction of degree-0 vertices).
degree_kurtosis
Compute the excess kurtosis of the degree distribution.
degree_laplacian_energy
Compute the degree Laplacian energy of the graph.
degree_leaf_ratio
Compute the leaf ratio (fraction of degree-1 vertices).
degree_mad
Compute the mean absolute deviation of the degree sequence.
degree_max_deviation
Compute the maximum degree deviation from the mean.
degree_median
Compute the median of the degree sequence.
degree_median_ad
Compute the median absolute deviation of the degree sequence.
degree_mode
Compute the mode of the degree sequence.
degree_neighbor_max_sum
Compute the sum of maximum neighbor degrees.
degree_neighbor_min_sum
Compute the sum of minimum neighbor degrees.
degree_neighbor_range_sum
Compute the sum of neighbor degree ranges.
degree_neighbor_variance_sum
Compute the sum of neighbor degree variances.
degree_palma
Compute the Palma ratio of the degree sequence.
degree_profile
Compute degree profile for each vertex: [deg, deg², log(deg+1)].
degree_range
Compute the range of the degree sequence.
degree_sequence
Returns the degree sequence of the graph.
degree_skewness
Compute the skewness of the degree distribution.
degree_span_ratio
Compute the degree span ratio.
degree_spectral_gap_estimate
Compute the degree-based spectral gap estimate.
degree_structural_info
Structural information content based on degree sequence.
degree_sum_index
Compute the degree-sum index.
degree_tail_ratio
Compute the tail ratio (fraction of vertices with degree ≥ 2·d̄).
degree_theil
Compute the Theil index (GE(1)) of the degree sequence.
degree_variance
Compute the variance of the degree sequence.
degree_variance_ratio
Compute the degree variance ratio.
delaunay_graph
Build the Delaunay triangulation graph of a 1D or 2D point set.
density
Edge density of graph. Counterpart of igraph_density(_, NULL_weights, _, /*loops=*/false).
dfs
Pre-order visit of vertices reachable from root, in DFS order.
dfs_simple
Mode-aware DFS from a single root, returning pre/post-order, parents, and DFS-tree depth.
dfs_tree
Multi-output DFS from root. Returns visit order (pre and post), per-vertex parents, and DFS-tree depth in a single pass.
diameter
Diameter of graph — the maximum vertex eccentricity. None for a graph with no vertices.
diameter_radius_ratio
Compute the diameter-radius ratio.
diameter_vulnerability
Compute the diameter vulnerability.
diameter_weighted
OUT-mode default for diameter_weighted_with_mode.
diameter_weighted_with_mode
Mode-aware weighted diameter. None for vcount == 0.
diameter_with_mode
Diameter of graph under the given mode. None for vcount == 0.
difference
Returns orig \ sub: the multiset difference of the edges.
dijkstra_all_shortest_paths
All shortest weighted paths from source to every vertex, preserving every tie. Counterpart of igraph_get_all_shortest_paths_dijkstra(_, _, _, _, source, vss_all(), weights, mode).
dijkstra_distances
Single-source Dijkstra distances.
dijkstra_distances_cutoff
Single-source Dijkstra distances with an optional cutoff. When cutoff = Some(c), vertices whose shortest-path distance exceeds c are returned as None (unreachable-within-cutoff); the search stops relaxing edges out of any vertex whose mindist > c.
dijkstra_distances_cutoff_with_mode
Mode-aware dijkstra_distances_cutoff. Counterpart of igraph_distances_dijkstra_cutoff(_, _, source, vss_all(), weights, mode, cutoff).
dijkstra_distances_multi
Multi-source Dijkstra distances. result[i][v] is the shortest distance from sources[i] to v (or None if unreachable / past the cutoff).
dijkstra_distances_multi_with_mode
Mode-aware dijkstra_distances_multi.
dijkstra_distances_with_mode
Mode-aware Dijkstra distances. Counterpart of igraph_distances_dijkstra(_, _, source, vss_all(), weights, mode).
dijkstra_path_to
Reconstruct a single source-to-target path returning vertex and edge sequences. Ok(None) if target is unreachable; the source vertex appears as the first element when reachable.
dijkstra_path_to_with_mode
Mode-aware dijkstra_path_to. Counterpart of igraph_get_shortest_path_dijkstra(_, _, _, source, target, weights, mode).
dijkstra_paths
Single-source Dijkstra returning distances + parents + inbound edges over every vertex.
dijkstra_paths_with_mode
Mode-aware dijkstra_paths. Counterpart of igraph_get_shortest_paths_dijkstra(_, _, _, source, vss_all(), weights, mode, parents, inbound_edges).
dirichlet_energy
Compute the Dirichlet energy of a signal on a graph.
disjoint_union
Returns the disjoint union of left and right.
disjoint_union_many
Disjoint union of any number of graphs (ALGO-OP-002b).
distance_energy
Compute the distance energy E_D = Σ |λ_i(D)|.
distance_estrada_index
Compute the distance Estrada index DEE = Σ exp(λ_i(D)).
distance_spectral_radius
Compute the distance spectral radius ρ_D = λ_1(D).
distance_spectrum
Compute the distance spectrum, sorted in decreasing order.
distances
Unweighted shortest-path lengths from source to every vertex.
distances_all
All-pairs unweighted shortest distances.
distances_all_with_mode
All-pairs shortest distances with direction control.
distances_cutoff
Unweighted shortest-path lengths from source to every vertex, ignoring paths longer than cutoff.
distances_cutoff_multi
Multi-source unweighted distances with cutoff, direction-aware.
distances_cutoff_with_mode
Mode-aware distances_cutoff. For undirected graphs mode is ignored.
distances_from
Compute shortest-path distances from multiple sources to all vertices.
distances_from_with_mode
Compute shortest-path distances from multiple sources with direction control.
diversity
Structural diversity index for all vertices in an undirected graph.
dominator_tree
Compute the Lengauer-Tarjan dominator tree of a directed flowgraph.
ecc
Compute the edge clustering coefficient for eids in graph.
eccentric_connectivity_index
Compute the eccentric connectivity index.
eccentric_distance_sum
Compute the eccentric-distance sum.
eccentricity
Eccentricity of every vertex (length vcount). Result r[v] is the maximum shortest-path distance from v to any reachable vertex. Isolated vertices have eccentricity 0.
eccentricity_classes
Classify each vertex by its eccentricity class.
eccentricity_weighted
OUT-mode default for eccentricity_weighted_with_mode. Counterpart of igraph_eccentricity(_, weights, _, igraph_vss_all(), IGRAPH_OUT).
eccentricity_weighted_with_mode
Mode-aware weighted eccentricity. For each vertex v, returns max_{u reachable from v} dist(v, u), where distances are weighted shortest-path lengths (Dijkstra). Unreachable vertex pairs are ignored (matches upstream’s unconn=true); isolated vertices have eccentricity 0.0.
eccentricity_with_mode
Eccentricity of every vertex following mode-direction edges.
edge_adamic_adar_sum
Compute the sum of Adamic–Adar indices across all edges.
edge_betweenness
Per-edge unweighted betweenness centrality.
edge_betweenness_community
Run edge-betweenness community detection on graph.
edge_betweenness_community_weighted
Run weighted edge-betweenness community detection on graph with per-edge weights.
edge_betweenness_cutoff
Range-limited edge betweenness centrality.
edge_betweenness_subset
Subset edge betweenness centrality.
edge_betweenness_weighted
Per-edge weighted betweenness centrality (Vec<f64>).
edge_common_neighbor_sum
Compute the sum of common neighbor counts across all edges.
edge_conn_ratio
Compute the edge connectivity ratio.
edge_connectivity
Edge connectivity (adhesion) of a graph.
edge_connectivity_ratio
Compute the edge connectivity ratio.
edge_degree_cosine
Compute the cosine similarity of degree vectors across edges.
edge_degree_covariance
Compute the degree covariance across edges.
edge_degree_diff_ratio
Compute the degree difference ratio over edges.
edge_degree_discrepancy
Compute the normalized degree discrepancy across edges.
edge_degree_geometric_sum
Compute the edge degree geometric sum.
edge_degree_harmonic_sum
Compute the edge degree harmonic sum.
edge_degree_log_product
Compute the edge degree log-product sum.
edge_degree_max_sum
Compute the edge degree max sum.
edge_degree_mean_sum
Compute the edge degree mean sum.
edge_degree_min_sum
Compute the edge degree min sum.
edge_degree_pearson
Compute the Pearson correlation of endpoint degrees across edges.
edge_degree_product_ratio
Compute the product-sum ratio index over edges.
edge_degree_ratio_sum
Compute the edge degree ratio sum.
edge_degree_rms
Compute the edge endpoint degree RMS.
edge_degree_sorensen
Compute the Sørensen edge degree index.
edge_disjoint_paths
Maximum number of pairwise edge-disjoint paths from source to target.
edge_entropy
Shannon entropy of the edge-degree distribution.
edge_heterophily
Heterophily ratio: 1 - edge_homophily.
edge_homophily
Edge homophily ratio: fraction of edges connecting same-label vertices.
edge_inverse_degree_sum
Compute the inverse degree-sum index over edges.
edge_jaccard_sum
Compute the sum of Jaccard overlap coefficients across all edges.
edge_overlap_sum
Compute the sum of overlap coefficients across all edges.
edge_pi_index
Compute the edge-PI index.
edge_resilience
Compute edge resilience λ(G) / m.
edge_surplus_ratio
Compute the edge surplus ratio.
edge_szeged_index
Compute the edge-Szeged index.
edge_vertex_ratio
Compute the edge-vertex ratio.
edgelist_percolation
Percolation curve as a sequence of vertex-pair edges is added.
effective_resistance
Compute the effective resistance between two vertices.
effective_resistance_matrix
Compute the effective resistance matrix for all pairs.
efficiency_ratio
Compute the efficiency ratio.
eigen_adjacency
Compute selected eigenvalues of a graph’s adjacency matrix.
eigen_matrix
Compute selected eigenpairs of a general real matrix.
eigen_matrix_symmetric
Compute selected eigenpairs of a real symmetric matrix.
eigenvector_centrality
Backward-compatible undirected, unweighted entry point.
eigenvector_centrality_directed
Directed unweighted eigenvector centrality.
eigenvector_centrality_directed_weighted
Directed weighted eigenvector centrality.
eigenvector_centrality_full
Master entry point matching upstream’s signature.
eigenvector_centrality_weighted
Undirected weighted eigenvector centrality.
elimination_ordering
Compute an elimination ordering using the min-degree heuristic.
elliptic_sombor_index
Compute the elliptic Sombor index.
estrada_index
Compute the Estrada index of a graph.
eulerian_cycle
Build an Eulerian cycle if one exists, or return an error.
eulerian_path
Build an Eulerian path or cycle for graph if one exists. Returns Some(edge_ids) (the walk visits each edge exactly once) or None if no Eulerian walk exists.
ev_degree_randic
Compute the ev-degree Randić index.
even_tarjan_reduction
Compute the Even-Tarjan reduction of a graph.
expand_path_to_pairs
Expand a vertex path into consecutive pairs for edge lookup.
expansion
Compute the expansion (isoperimetric number) of a partition.
exponential_abc
Compute the exponential atom-bond connectivity index.
exponential_augmented_zagreb
Compute the exponential augmented Zagreb index.
exponential_first_zagreb
Compute the exponential first Zagreb index.
exponential_forgotten
Compute the exponential forgotten index.
exponential_ga
Compute the exponential geometric-arithmetic index.
exponential_inverse_degree
Compute the exponential inverse degree index.
exponential_randic
Compute the exponential Randić index.
exponential_sum_connectivity
Compute the exponential sum-connectivity index.
fast_greedy_modularity
Run fast greedy modularity community detection on graph (unweighted).
fast_greedy_modularity_weighted
Run fast greedy modularity community detection on graph with edge weights.
fiedler_vector
Compute the Fiedler vector of a graph.
fifth_ga_index
Compute the fifth geometric-arithmetic index.
first_ev_degree_zagreb
Compute the first ev-degree Zagreb index.
first_gourava_index
Compute the first Gourava index.
first_hyper_gourava_index
Compute the first hyper-Gourava index.
first_hyper_zagreb
Compute the first hyper-Zagreb index.
first_hyper_zagreb_coindex
Compute the first hyper-Zagreb coindex.
first_inverse_nirmala
Compute the first inverse Nirmala index.
first_leap_zagreb
Compute the first leap Zagreb index.
first_multiplicative_zagreb
Compute the first multiplicative Zagreb index.
first_neighborhood_zagreb
Compute the first neighborhood Zagreb index.
first_redefined_zagreb
Compute the first redefined Zagreb index.
first_reformulated_zagreb
Compute the first reformulated Zagreb index.
first_transmission_zagreb
Compute the first transmission Zagreb index.
first_ve_degree_zagreb_alpha
Compute the first ve-degree Zagreb alpha index.
first_ve_degree_zagreb_beta
Compute the first ve-degree Zagreb beta index.
first_zagreb_coindex
Compute the first Zagreb coindex.
first_zagreb_connection
Compute the first Zagreb connection index.
first_zagreb_entropy
Compute the first Zagreb entropy.
first_zagreb_index
Compute the first Zagreb index M₁(G) = Σ deg(v)².
floyd_warshall_distances
All-pairs shortest distances via Floyd-Warshall.
fluid_communities
Run Fluid Communities with default options (seed = 0, max_iterations = FLUID_DEFAULT_MAX_ITERATIONS).
fluid_communities_with_options
Run Fluid Communities with full option control.
forgotten_coindex
Compute the forgotten coindex (F-coindex).
forgotten_index
Compute the forgotten topological index.
forman_ricci_curvature
Forman-Ricci curvature for each edge.
fourth_abc_index
Compute the fourth atom-bond connectivity index.
freeman_degree_centralization
Compute Freeman’s degree centralization.
gabriel_graph
Build the Gabriel graph of a point set.
general_randic_index
Compute the general Randić index R_α(G).
general_sum_connectivity_index
Compute the general sum-connectivity index χ_α(G).
general_zeroth_order_randic
Compute the general zeroth-order Randić index.
geometric_arithmetic_index
Compute the geometric-arithmetic index.
get_adjacency
Compute the adjacency matrix of a graph.
get_all_shortest_paths
Find all shortest paths from source to every reachable vertex.
get_all_shortest_paths_dijkstra
Find all shortest paths from source to every reachable vertex using Dijkstra’s algorithm with non-negative edge weights.
get_all_shortest_paths_dijkstra_with_mode
Find all shortest paths from source with direction control.
get_all_shortest_paths_with_mode
Find all shortest paths from source with direction control.
get_biadjacency_matrix
Extract the biadjacency matrix from a bipartite graph.
get_biadjacency_weighted
Extract a weighted biadjacency matrix from a bipartite graph.
get_edgelist
Return all edges of the graph as a list of (source, target) pairs.
get_eids
Look up edge IDs for a batch of vertex pairs.
get_isomorphisms_vf2
Collect every VF2 isomorphic mapping between two graphs.
get_laplacian
Compute the Laplacian matrix of a graph.
get_shortest_path
Calculate a single shortest path from from to to.
get_shortest_path_astar
Calculate a single shortest path from from to to using A*.
get_shortest_paths
Returns one shortest path from source to every vertex in the graph.
get_shortest_paths_dijkstra
Returns one shortest path from source to every vertex in the graph, using weighted edges (Dijkstra’s algorithm).
get_shortest_paths_dijkstra_with_mode
Mode-aware get_shortest_paths_dijkstra.
get_shortest_paths_with_mode
Returns one shortest path from source to every vertex, with direction control for directed graphs.
get_stochastic
Compute the stochastic adjacency matrix of a graph.
get_subisomorphisms_lad
Enumerate all subgraph isomorphisms from pattern into target with the LAD algorithm. Each returned vector maps pattern vertex i (by index) to its target vertex.
get_subisomorphisms_vf2
Collect every VF2 subgraph-isomorphic embedding of the pattern graph2 into the target graph1.
giant_component_gap
Compute the giant component gap.
girth
Shortest cycle length in graph. Returns None for acyclic graphs.
global_efficiency
Global efficiency of graph — average inverse pairwise shortest distance over all N*(N-1) ordered vertex pairs. Pairs that are unreachable contribute 0.
gomory_hu_tree
Gomory-Hu cut tree of an undirected graph (Gusfield 1990).
gordon_scantlebury_index
Compute the Gordon-Scantlebury index (path-of-length-2 count).
graovac_ghorbani_index
Compute the Graovac-Ghorbani index.
graph_center
Return the central vertices of a graph — those with minimum eccentricity.
graph_compactness
Compute the compactness of the graph.
graph_energy
Compute the graph energy.
graph_integrity
Compute the integrity of a graph.
graph_periphery
Return the periphery vertices of a graph.
graph_power
Returns the k-th power of a graph as a simple graph.
graph_product
Computes a graph product selected by product_type.
graph_summary
Compute a quick structural summary of a graph.
graph_summary_string
Format a detailed multi-line summary of a graph.
graph_toughness
Compute the toughness of a graph.
greedy_clique_cover
Find a greedy clique cover.
greedy_clique_number
Compute the greedy clique number (lower bound on chromatic number).
greedy_coloring
Greedy vertex coloring in natural vertex order.
greedy_coloring_largest_first
Greedy coloring with largest-first (LF) ordering.
greedy_coloring_with_order
Greedy vertex coloring with a custom vertex processing order.
greedy_independent_set
Find a maximal independent set using a greedy heuristic.
greedy_matching
Find a greedy maximal matching.
gutman_index
Compute the Gutman index.
hamiltonian_cycle
Find a Hamiltonian cycle using backtracking.
hamiltonian_path
Find a Hamiltonian path using backtracking.
harary_index
Compute the Harary index of a graph.
harmonic_centrality
Per-vertex harmonic centrality.
harmonic_centrality_cutoff
Range-limited harmonic centrality.
harmonic_centrality_weighted
Per-vertex weighted harmonic centrality.
harmonic_graph_index
Compute the harmonic index.
has_hamiltonian_cycle
Check whether a graph has a Hamiltonian cycle.
has_hamiltonian_path
Check whether a graph has a Hamiltonian path.
has_loop
Returns true iff graph has at least one self-loop edge.
has_multiple
Returns true iff graph has at least one parallel edge.
has_mutual
Check whether a directed graph has any mutual (reciprocal) edges.
heat_kernel_diffuse
Diffuse a signal on the graph using the heat kernel.
hosoya_index
Compute the Hosoya index (Z-index) of a graph.
hub_and_authority_scores
Compute Kleinberg’s hub and authority scores.
hub_and_authority_scores_weighted
Weighted Kleinberg hub and authority scores.
hub_dominance
Compute the hub dominance.
hub_ratio
Compute the hub ratio.
hyper_wiener_index
Compute the hyper-Wiener index of a graph.
hyperbolicity
Compute δ-hyperbolicity as a floating-point value.
hyperbolicity_twice
Compute the Gromov δ-hyperbolicity of a graph.
independence_ratio
Compute the independence ratio α(G) / n.
independent_set_count_sequence
Compute the independence polynomial coefficient sequence.
induced_subgraph
Creates the subgraph induced by the specified vertices.
induced_subgraph_edges
Returns the IDs of edges whose both endpoints lie in vids.
infomap
Run Infomap with the default options (unweighted, 1 trial).
infomap_weighted
Run Infomap with per-edge weights (1 trial).
infomap_with_options
Run Infomap with full control over parameters.
intersection
Returns the intersection of left and right.
intersection_many
Returns the intersection of multiple graphs.
inverse_degree_index
Compute the inverse degree index (zeroth-order Randić index).
inverse_degree_power
Compute the inverse degree power index.
inverse_sum_indeg_index
Compute the inverse sum indeg index.
invert_permutation
Invert a permutation vector.
ira_index
Compute the power-difference irregularity index.
irb_index
Compute the root-difference irregularity index.
ird_index
Compute the square-difference irregularity index.
irga_index
Compute the geometric-arithmetic irregularity index.
irl_irregularity
Compute the IRL irregularity (irregularity by logarithm).
irlu_irregularity
Compute the IRLU irregularity (irregularity by log-ratio).
is_acyclic
Returns true iff graph contains no cycle.
is_apex_forest
Check whether a graph is an apex forest.
is_apex_tree
Check whether a graph is an apex tree.
is_banner_free
Check whether a graph is banner-free (no induced banner / flag).
is_biclique
Check whether a graph is a complete bipartite graph (biclique).
is_biconnected
Check whether graph is biconnected.
is_bigraphical
Test whether a bi-degree-sequence is bigraphical (realizable as a bipartite graph).
is_bipartite
Check whether a graph is bipartite and optionally return the partition.
is_biregular
Check whether a graph is biregular.
is_block_graph
Check whether a graph is a block graph.
is_bowtie_free
Check whether a graph is bowtie-free (no induced bowtie / butterfly).
is_bull_free
Check whether a graph is bull-free.
is_c4_free
Check whether a graph is C_4-free (no induced 4-cycle).
is_c5_free
Check whether a graph is C_5-free (no induced 5-cycle).
is_cactus_graph
Check whether a graph is a cactus graph.
is_caterpillar
Check whether a graph is a caterpillar tree.
is_chain_graph
Check whether a graph is a chain graph.
is_chordal_bipartite
Check whether a graph is chordal bipartite.
is_claw_free
Check whether a graph is claw-free.
is_clique
Check whether a set of vertices forms a clique.
is_clique_cover
Check whether a partition of vertices forms a valid clique cover.
is_cluster_graph
Check whether a graph is a cluster graph (disjoint union of cliques).
is_co_bipartite
Check whether a graph is co-bipartite.
is_co_chordal
Check whether a graph is co-chordal (complement is chordal).
is_cograph
Check whether a graph is a cograph (P4-free).
is_complete
Returns true iff every pair of distinct vertices is adjacent.
is_complete_bipartite
Check whether a graph is complete bipartite.
is_complete_multipartite
Check whether a graph is a complete multipartite graph.
is_connected
Tests whether the graph is connected.
is_cricket_free
Check whether a graph is cricket-free.
is_cubic
Check whether a graph is cubic (3-regular).
is_cycle
Check whether a graph is a cycle graph.
is_dag
Returns true iff graph is a directed acyclic graph.
is_dart_free
Check whether a graph is dart-free (no induced dart).
is_diamond_free
Check whether a graph is diamond-free.
is_distance_hereditary
Check whether a graph is distance-hereditary.
is_eulerian
Decide whether graph has an Eulerian path and/or cycle.
is_forest
Returns Some(roots) iff graph is a forest under mode, otherwise None. The null graph is a forest with empty roots.
is_fork_free
Check whether a graph is fork-free (no induced fork / cross).
is_gem_free
Check whether a graph is gem-free.
is_geodetic
Check whether a graph is geodetic.
is_graphical
Test whether a degree sequence is graphical (realizable as some graph).
is_hamiltonian_cycle
Check whether a sequence of vertices forms a valid Hamiltonian cycle.
is_hamiltonian_path
Check whether a sequence of vertices forms a valid Hamiltonian path.
is_house_free
Check whether a graph is house-free (no induced house graph).
is_independent_vertex_set
Check whether a set of vertices forms an independent set.
is_k_degenerate
Check whether a graph is k-degenerate.
is_lobster
Check whether a graph is a lobster tree.
is_loop
Returns a per-edge boolean vector marking self-loops.
is_minimal_separator
Check whether a set of vertices is a minimal separator.
is_multiple
Returns a per-edge boolean vector marking multiple (parallel) edges.
is_mutual
Check whether each edge in a directed graph is mutual (reciprocated).
is_net_free
Check whether a graph is net-free (no induced net subgraph).
is_outerplanar
Check whether a graph is outerplanar.
is_p5_free
Check whether a graph is P_5-free (no induced path on 5 vertices).
is_path
Check whether a graph is a path graph.
is_paw_free
Check whether a graph is paw-free.
is_perfect
Returns true when graph is a perfect graph.
is_perfect_matching
Check whether a matching is a perfect matching.
is_planar
Test whether a graph is planar.
is_proper_coloring
Check whether a coloring is valid (proper).
is_proper_interval
Check whether a graph is a proper interval graph.
is_pseudo_forest
Check whether a graph is a pseudo-forest.
is_ptolemaic
Check whether a graph is ptolemaic.
is_regular
Check whether a graph is regular.
is_same_graph
Returns true iff g1 and g2 are identical as labelled graphs: same vertex count, same directedness, same edge multiset. Edges differing only in storage order (or, for undirected, in endpoint orientation) are treated as identical.
is_self_complementary
Check whether a graph is self-complementary.
is_semicomplete
Check whether a directed graph is semicomplete.
is_separator
Check whether a set of vertices is a separator of the graph.
is_series_parallel
Check whether a graph is series-parallel.
is_simple
Returns true if graph has neither self-loops nor parallel edges.
is_simple_with_mode
is_simple with explicit SimpleMode (ALGO-PR-013b).
is_spider
Check whether a graph is a spider graph.
is_split_graph
Check whether a graph is a split graph.
is_star
Check whether a graph is a star graph.
is_strongly_chordal
Check whether a graph is strongly chordal.
is_strongly_regular
Check whether a graph is strongly regular.
is_threshold_graph
Check whether a graph is a threshold graph.
is_tournament
Check whether a graph is a tournament.
is_tree
Returns Some(root) iff graph is a tree under mode, otherwise None. The null graph (vcount == 0) is not a tree by convention.
is_triangle_free
Test whether a graph is triangle-free.
is_trivially_perfect
Check whether a graph is trivially perfect.
is_unicyclic
Check whether a graph is unicyclic.
is_valid_matching
Check whether a matching is valid.
is_weakly_chordal
Check whether a graph is weakly chordal.
is_well_covered
Check whether a graph is well-covered.
is_wheel
Check whether a graph is a wheel graph.
is_windmill
Check whether a graph is a windmill graph.
isolated_vertex_ratio
Compute the isolated vertex ratio.
isomorphic
Decide whether two graphs are isomorphic, choosing a backend automatically.
isomorphic_bliss
Test whether two graphs are isomorphic via canonical labeling (BLISS).
isomorphic_vf2
Test whether two graphs are isomorphic using the VF2 algorithm.
johnson_distances
All-pairs shortest-path distances via Johnson’s algorithm.
join
Creates the join of two graphs.
joint_degree_distribution
Compute the joint degree distribution matrix.
joint_degree_matrix
Compute the joint degree matrix of a graph.
joint_type_distribution
Compute the joint type distribution (mixing matrix).
k_shortest_paths
Finds the k shortest loopless paths between source and target.
katz_centrality
Compute Katz centrality for all vertices using power iteration.
kirchhoff_index
Compute the Kirchhoff index of a graph.
knnk
Per-degree average nearest-neighbour degree, k_nn(k).
knnk_weighted
Per-degree weighted average nearest-neighbour degree.
label_propagate_predict
Predict labels using simple majority voting from labeled neighbors.
label_propagation
Run label propagation with the default options (LpaVariant::Fast, no initial labels, no fixed vertices, seed 0).
label_propagation_weighted
Run label propagation with per-edge weights (default variant, no initial labels, no fixed vertices, seed 0).
label_propagation_with_options
Run label propagation with the full option bag.
label_spread
Predict labels for unlabeled vertices using label spreading.
lanzhou_index
Compute the Lanzhou index.
laplacian_spectrum
Compute all Laplacian eigenvalues, sorted in ascending order.
largest_component_fraction
Compute the largest component fraction.
layout_align
Align a graph layout with the coordinate axes.
layout_bipartite
Compute a bipartite layout.
layout_circle
Place vertices uniformly on a unit circle.
layout_davidson_harel
Compute the Davidson-Harel simulated annealing layout.
layout_drl
Compute the DrL layout.
layout_drl_3d
Compute the DrL layout in 3D.
layout_fruchterman_reingold
2D Fruchterman-Reingold force-directed layout.
layout_fruchterman_reingold_3d
3D Fruchterman-Reingold force-directed layout.
layout_gem
Compute the GEM force-directed layout.
layout_graphopt
Compute the GraphOpt force-directed layout.
layout_grid
Place vertices on a regular 2D grid.
layout_grid_3d
Place vertices on a regular 3D grid.
layout_kamada_kawai
Compute 2D Kamada-Kawai layout.
layout_kamada_kawai_3d
Compute 3D Kamada-Kawai layout.
layout_lgl
Compute the Large Graph Layout (LGL).
layout_mds
Compute the MDS (Multidimensional Scaling) layout.
layout_merge_dla
Merge multiple 2D layouts into a single combined layout using DLA placement.
layout_random
Place vertices uniformly at random in the square [-1, 1] × [-1, 1].
layout_random_3d
Place vertices uniformly at random in the cube [-1, 1]³.
layout_reingold_tilford
Compute the Reingold-Tilford tree layout.
layout_reingold_tilford_circular
Circular variant of the Reingold-Tilford layout.
layout_sphere
Place vertices approximately uniformly on a unit sphere.
layout_star
Place vertices in a star layout: center at origin, rest on a unit circle.
layout_sugiyama
Compute the Sugiyama hierarchical layout.
layout_umap
Compute the 2D UMAP layout.
layout_umap_3d
Compute the 3D UMAP layout.
le_community_to_membership
Cut an incomplete dendrogram after steps merges, starting from an initial (non-singleton) cluster assignment.
leading_eigenvector
Detect communities using Newman’s leading eigenvector method.
leading_eigenvector_weighted
Weighted leading eigenvector community detection (convenience wrapper).
leaf_to_hub_ratio
Compute the leaf-to-hub ratio.
leiden
Run Leiden with the default modularity objective, γ = 1, β = 0.01, two iterations, seed 0.
leiden_weighted
Run Leiden with per-edge weights (modularity objective, γ = 1, β = 0.01, two iterations, seed 0).
leiden_with_options
Run Leiden with the full set of options.
lexicographic_product
Computes the lexicographic product of two graphs.
line_graph
Construct the line graph L(G) of the input graph.
link_pred_adamic_adar
Compute Adamic-Adar Index for given vertex pairs.
link_pred_common_neighbors
Compute Common Neighbors score for given vertex pairs.
link_pred_jaccard
Compute Jaccard Coefficient for given vertex pairs.
link_pred_preferential_attachment
Compute Preferential Attachment score for given vertex pairs.
link_pred_resource_allocation
Compute Resource Allocation Index for given vertex pairs.
list_triangles
List all triangles in a graph.
local_efficiency
Per-vertex local efficiency. For each vertex v, computes the average inverse distance between every ordered pair of distinct vertices in N(v) (the unique non-self neighbours of v), measured in the subgraph obtained by removing v — paths must not pass through v. Pairs unreachable in G \ {v} contribute 0.
local_efficiency_ratio
Compute the local efficiency ratio.
local_scan_0
Local scan-0: vertex degree (unweighted) or strength (weighted).
local_scan_0_them
Local scan-0 on two graphs: degree/strength from them restricted to edges that also exist in us.
local_scan_1
For each vertex, count edges within its closed 1-neighborhood.
local_scan_1_ecount
Local scan-1 edge count / weight sum in the 1-neighbourhood of every vertex, with directed-mode support.
local_scan_1_ecount_them
Local scan-1 edge count on two graphs: count edges from them in the 1-neighbourhood defined by us.
local_scan_k
For each vertex, count edges within its closed k-neighborhood.
local_scan_k_ecount
Mode-aware local scan-k edge count / weight sum.
local_scan_k_ecount_them
Mode-aware local scan-k on two graphs.
local_scan_subset_ecount
Local scan on given vertex subsets: count edges (or sum weights) in the induced subgraph of each subset.
louvain
Run Louvain with the default options (γ = 1, unweighted, deterministic seed 0).
louvain_weighted
Run Louvain with per-edge weights (γ = 1, deterministic seed 0).
louvain_with_options
Run Louvain with the full set of options.
lune_beta_skeleton
Build the lune-based β-skeleton of a point set.
matching_count_sequence
Compute the matching count sequence [m(G,0), m(G,1), …].
matching_number
Compute the matching number ν(G).
max_degree
Returns the maximum degree in the graph.
max_degree_vertex
Returns the vertex (or one of the vertices) with the maximum degree.
max_flow
Full maximum-flow computation: value, per-edge flow, cut edges, and source-side / sink-side vertex partitions.
max_flow_value
Scalar maximum-flow value from source to target.
maximum_matching
Find the maximum matching (brute-force).
mean_degree
Mean degree of the graph.
mean_distance
Mean unweighted shortest-path length over all reachable ordered pairs. Counterpart of igraph_average_path_length(_, NULL_weights, _, _, /*directed=*/true, /*unconn=*/true).
mean_distance_weighted
Compute the weighted mean distance (average shortest path length).
mean_forman_ricci
Compute the average Forman-Ricci curvature of the graph.
merrifield_simmons_index
Compute the Merrifield–Simmons index of a graph.
meshedness_coefficient
Compute the meshedness coefficient of the graph.
min_degree
Returns the minimum degree in the graph.
mincut
Compute the global minimum cut of a (possibly weighted) graph.
mincut_value
Global minimum-cut value of a (possibly weighted) graph.
minimum_size_separators
Find all minimum-size separating vertex sets.
minimum_spanning_tree
Computes a minimum spanning tree (or forest, if disconnected) of graph and returns the IDs of the edges that constitute the tree.
minmax_degree_ratio
Compute the min-max degree ratio index.
modified_first_zagreb
Compute the modified first Zagreb index.
modified_first_zagreb_connection
Compute the modified first Zagreb connection index.
modified_sombor_index
Compute the modified Sombor index.
modular_product
Computes the modular product of two graphs.
modularity
Modularity of graph with respect to community assignment membership.
modularity_directed
Directed modularity (Leicht-Newman, ALGO-CO-001b).
modularity_matrix
Compute the modularity matrix B of a graph.
modularity_weighted
Weighted modularity (ALGO-CO-001c).
modularity_weighted_directed
Directed weighted modularity (Leicht-Newman, ALGO-CO-006c follow-up).
mostar_index
Compute the Mostar index of a graph.
multi_edge_ratio
Compute the multi-edge ratio of the graph.
multiplicative_abc
Compute the multiplicative atom-bond connectivity index.
multiplicative_ga
Compute the multiplicative geometric-arithmetic index.
multiplicative_randic
Compute the multiplicative Randić index.
multiplicative_sum_connectivity
Compute the multiplicative sum-connectivity index.
multiplicatively_weighted_harary
Compute the multiplicatively weighted Harary index.
narumi_katayama_index
Compute the Narumi-Katayama index.
natural_connectivity
Compute the natural connectivity of a graph.
nearest_neighbor_graph
Build the k-nearest-neighbor graph of a point set.
neighbor_aggregate
Aggregate a signal over each vertex’s neighborhood.
neighbor_degree_disparity
Compute the average neighbor degree ratio.
neighbor_sample
Sample k-hop neighborhoods around seed vertices.
neighbor_sample_weighted
Sample k-hop neighborhoods with importance-weighted sampling.
neighborhood
k-hop neighbourhood vertex list for every vertex (mode = All, mindist = 0).
neighborhood_forgotten_index
Compute the neighborhood forgotten index.
neighborhood_graphs
Per-vertex induced subgraphs of k-hop neighbourhoods (mode = All, mindist = 0).
neighborhood_graphs_with_mode
Per-vertex induced subgraphs of k-hop neighbourhoods with full mode control.
neighborhood_size
k-hop neighbourhood size for every vertex (mode = All, mindist = 0).
neighborhood_size_with_mode
Full mode-aware k-hop neighbourhood size with mindist filter.
neighborhood_with_mode
Full mode-aware k-hop neighbourhood vertex list with mindist filter.
nirmala_index
Compute the Nirmala index.
node_homophily
Node homophily ratio: average proportion of same-label neighbors.
normalized_algebraic_connectivity
Compute the normalized algebraic connectivity μ_2(L_norm).
normalized_cut
Compute the normalized cut (NCut) of a partition.
normalized_dirichlet_energy
Compute the normalized Dirichlet energy (Rayleigh quotient form).
normalized_laplacian_spectrum
Compute the normalized Laplacian spectrum, sorted ascending.
ollivier_ricci_curvature
Ollivier-Ricci curvature for each edge (lazy random walk variant).
pagerank
PageRank scores via power iteration with damping 0.85.
pagerank_linsys
PageRank via GMRES on (I - α · Mᵀ) · pr = (1 - α)/N · 1.
pagerank_weighted
Weighted PageRank scores via power iteration with damping 0.85.
path_length_hist
Compute a histogram of all shortest-path lengths.
pendant_edge_ratio
Compute the pendant edge ratio.
permute_vertices
Creates a new graph with vertices permuted according to the given mapping.
personalized_pagerank
Personalized PageRank scores via power iteration.
personalized_pagerank_default
Personalized PageRank with default damping factor (0.85).
personalized_pagerank_vs
Personalized PageRank with a vertex-set reset distribution.
pi_index
Compute the Padmakar-Ivan (PI) index of a graph.
platt_index
Compute the Platt index (sum of edge degrees).
power_law_fit
Fit a power-law distribution to a sample of numbers.
ppr_diffuse
Diffuse a signal using Personalized PageRank propagation.
pseudo_diameter
Approximate the diameter of a graph using pseudo-peripheral vertex search.
radius
Radius of graph — the minimum vertex eccentricity. None for a graph with no vertices (matches upstream’s IGRAPH_NAN for the null graph).
radius_weighted
OUT-mode default for radius_weighted_with_mode.
radius_weighted_with_mode
Mode-aware weighted radius. None for vcount == 0.
radius_with_mode
Radius of graph under the given mode. None for vcount == 0.
randic_entropy
Compute the Randić entropy.
randic_index
Compute the Randić connectivity index.
random_sample
Generate an increasing random sequence of integers from [l, h].
random_spanning_tree
Uniformly sample a random spanning tree (or forest) of a graph.
random_walk
Random walk on graph starting at start, taking up to steps transitions.
random_walk_node2vec
Performs a second-order biased random walk (Node2Vec) starting at start for up to steps transitions.
random_walks
Generate multiple random walks from every vertex in the graph.
random_walks_from
Generate random walks from a specific set of starting vertices.
random_walks_node2vec
Generate multiple Node2Vec random walks from every vertex.
ratio_cut
Compute the ratio cut of a partition.
reachability
Compute per-component reachability bitsets.
reachability_matrix
Dense reachability matrix of graph. result[i][j] is true iff vertex j is reachable from i in zero or more steps.
read_dimacs
Read a graph from DIMACS flow/edge format.
read_dl
Read a graph from UCINET DL format.
read_dot
Read a graph from DOT (Graphviz) format.
read_edgelist
Read an edge list from any Read into a fresh Graph.
read_gml
Read a graph from GML format.
read_graphdb
Read a graph from GraphDB binary format.
read_graphml
Read a graph from GraphML format.
read_leda
Read a graph from LEDA native graph format.
read_lgl
Read a graph from LGL (.lgl) format.
read_ncol
Read a graph from NCOL (.ncol) format.
read_pajek
Read a graph from Pajek (.net) format.
reciprocal_degree_distance
Compute the reciprocal degree distance (additively weighted Harary index).
reciprocal_randic_index
Compute the reciprocal Randić index.
reciprocal_transmission_index
Compute the reciprocal transmission index.
reciprocity
Reciprocity of graph. Returns None for graphs with no edges (matches upstream’s IGRAPH_NAN).
reciprocity_ratio
Compute the reciprocity ratio of the graph.
reciprocity_with_mode
Reciprocity with explicit mode + ignore_loops (ALGO-PR-004b).
reduced_first_zagreb
Compute the reduced first Zagreb index.
reduced_forgotten_index
Compute the reduced forgotten index.
reduced_reciprocal_randic
Compute the reduced reciprocal Randić index.
reduced_second_zagreb
Compute the reduced second Zagreb index.
reduced_sombor_index
Compute the reduced Sombor index.
reduced_sum_connectivity
Compute the reduced sum-connectivity index.
regularity
Return the regularity degree of the graph, or None if the graph is not regular.
reindex_membership
Relabel a membership vector so cluster ids run contiguously over 0..k, where k is the number of distinct clusters. The partition is unchanged: two vertices share a cluster in the output iff they shared one in the input. New ids are assigned in first-occurrence order — the first cluster id you encounter when sweeping left to right becomes 0, the next new one becomes 1, and so on.
relative_neighborhood_graph
Build the relative neighborhood graph of a point set.
residual_graph
Compute the residual graph given capacity and flow vectors.
resistance_centrality
Compute resistance centrality for all vertices.
reverse
Returns a new graph with all edge directions reversed.
reverse_edges
Returns a new graph with only the specified edges reversed.
reverse_residual_graph
Compute the reverse-residual graph given capacity and flow vectors.
revised_szeged_index
Compute the revised Szeged index of a graph.
rewire
Randomly rewires a graph while preserving its degree sequence.
rewire_directed_edges
Rewires one endpoint of directed edges with constant probability.
rewire_edges
Rewires graph edges with constant probability.
rich_club_sequence
Per-vertex rich-club coefficient sequence for graph.
rooted_product
Computes the rooted product of two graphs.
roots_for_tree_layout
Choose “nice” roots for a tree layout.
running_mean
Compute the running mean of a data vector.
rwpe
Compute Random Walk Positional Encoding for all vertices.
rwpe_vertices
Compute RWPE only for specified vertices (more efficient for batches).
sample_dirichlet
Sample points from a Dirichlet distribution.
sample_sphere_surface
Sample points uniformly from the surface of a sphere.
sample_sphere_volume
Sample points uniformly from the volume of a sphere.
satisfies_dirac
Check whether a graph satisfies Dirac’s condition.
satisfies_ore
Check whether a graph satisfies Ore’s condition.
schultz_index
Compute the Schultz index (degree-distance index).
second_ev_degree_zagreb
Compute the second ev-degree Zagreb index.
second_gourava_index
Compute the second Gourava index.
second_hyper_zagreb
Compute the second hyper-Zagreb index.
second_hyper_zagreb_coindex
Compute the second hyper-Zagreb coindex.
second_inverse_nirmala
Compute the second inverse Nirmala index.
second_leap_zagreb
Compute the second leap Zagreb index.
second_multiplicative_zagreb
Compute the second multiplicative Zagreb index.
second_neighborhood_zagreb
Compute the second neighborhood Zagreb index.
second_reformulated_zagreb
Compute the second reformulated Zagreb index.
second_transmission_zagreb
Compute the second transmission Zagreb index.
second_ve_degree_zagreb
Compute the second ve-degree Zagreb index.
second_zagreb_coindex
Compute the second Zagreb coindex.
second_zagreb_connection
Compute the second Zagreb connection index.
second_zagreb_entropy
Compute the second Zagreb entropy.
second_zagreb_index
Compute the second Zagreb index M₂(G) = Σ_{(u,v)∈E} deg(u)·deg(v).
self_loop_ratio
Compute the self-loop ratio of the graph.
sigma_coindex
Compute the sigma coindex.
sigma_index
Compute the sigma index (Gutman irregularity).
signless_laplacian_energy
Compute the signless Laplacian energy.
signless_laplacian_smallest
Compute the smallest signless Laplacian eigenvalue q_1(Q).
signless_laplacian_spectral_radius
Compute the signless Laplacian spectral radius q_n(Q).
signless_laplacian_spectrum
Compute the signless Laplacian spectrum, sorted ascending.
similarity_dice
Compute the full Dice similarity matrix for all vertex pairs.
similarity_dice_es
Computes Dice similarity coefficients for pairs of vertices connected by the given edges.
similarity_dice_pairs
Computes Dice similarity coefficients for given vertex pairs.
similarity_inverse_log_weighted
Compute the full inverse-log-weighted (Adamic-Adar) similarity matrix.
similarity_inverse_log_weighted_pairs
Computes the inverse log-weighted (Adamic-Adar) similarity for given vertex pairs.
similarity_jaccard
Compute the full Jaccard similarity matrix for all vertex pairs.
similarity_jaccard_es
Computes Jaccard similarity coefficients for pairs of vertices connected by the given edges.
similarity_jaccard_pairs
Computes Jaccard similarity coefficients for given vertex pairs.
simplify
Return a copy of graph with self-loops and/or parallel edges removed.
simplify_and_colorize
Build a vertex- and edge-colored simple graph from graph.
site_percolation
Site percolation: the size of the largest component as vertices (sites) of graph are activated in the order specified by vertex_order.
smoothness_ratio
Compute the smoothness ratio of a signal on a graph.
sombor_coindex
Compute the Sombor coindex.
sombor_index
Compute the Sombor index.
sort_vertices_by_degree
Return vertex IDs sorted by their degree.
spanner
Compute a t-spanner of the graph.
spanning_tree_count
Count the number of spanning trees using Kirchhoff’s theorem.
spatial_edge_lengths
Compute edge lengths from spatial vertex coordinates.
spectral_bisection
Compute a spectral bisection of the graph.
spectral_gap
Compute the spectral gap of a graph.
spectral_gap_ratio
Compute the spectral gap ratio μ_2 / μ_n.
spectral_radius
Compute the spectral radius of a graph.
spinglass
Spinglass community detection with default options.
spinglass_weighted
Spinglass community detection with edge weights.
spinglass_with_options
Spinglass community detection with full options.
split_join_distance
Compute the two asymmetric projection distances between comm1 and comm2.
square_clustering_ratio
Compute the square clustering ratio.
square_density
Compute the square (4-cycle) density of the graph.
st_edge_connectivity
Edge connectivity between two vertices: the minimum number of edges whose removal disconnects source from target.
st_mincut
Full s-t minimum-cut: scalar value, the cut edge list, and the source-side / sink-side vertex partitions.
st_mincut_value
Scalar s-t minimum-cut value (capacity of the minimum edge set whose removal disconnects source from target).
st_vertex_connectivity
Vertex connectivity between two vertices.
strength
Weighted vertex degree for all vertices.
strength_with_mode
Weighted vertex degree with direction mode and loop control.
strong_product
Computes the strong product of two graphs.
strongly_connected_components
Compute the strongly connected components of graph.
structural_feature_vectors
Compute structural feature vectors for all vertices.
subcomponent
Returns all vertices reachable from source following edges in the specified mode.
subgraph_centrality
Compute subgraph centrality for all vertices.
subgraph_from_edges
Create a subgraph containing only the specified edges.
subisomorphic
Decide whether graph2 is isomorphic to a subgraph of graph1.
subisomorphic_lad
Decide whether pattern is isomorphic to a subgraph of target using the LAD algorithm, returning the first embedding found.
subisomorphic_vf2
Test whether the pattern graph2 is a (non-induced) subgraph of the target graph1, using the VF2 algorithm.
sum_connectivity_index
Compute the sum-connectivity index.
symmetric_degree_ratio
Compute the symmetric degree ratio index.
symmetric_diffuse
Diffuse a signal using symmetric normalized propagation.
symmetric_division_deg_index
Compute the symmetric division deg index.
szeged_index
Compute the Szeged index of a graph.
tensor_product
Computes the tensor (categorical/direct) product of two graphs.
terminal_wiener_index
Compute the terminal Wiener index.
third_leap_zagreb
Compute the third leap Zagreb index.
third_zagreb_index
Compute the third Zagreb index.
to_directed
Converts an undirected graph to a directed graph.
to_undirected
Converts a directed graph to an undirected graph.
topological_sorting
Returns a topological ordering of graph’s vertices.
total_eccentricity
Compute the total eccentricity.
total_irregularity
Compute the total irregularity.
total_variation
Compute the total variation of a signal on a graph.
transitive_closure
Transitive closure of graph. The returned graph shares the same vertex count and direction as the input.
transitivity_avglocal_undirected
Average local transitivity (clustering coefficient).
transitivity_barrat
Barrat’s weighted local transitivity, per vertex.
transitivity_gap
Compute the transitivity gap.
transitivity_local_undirected
Local transitivity (clustering coefficient) per vertex.
transitivity_undirected
Global transitivity (clustering coefficient) of graph3 * triangles / connected_triples. Returns None when there are no connected triples (matches upstream’s IGRAPH_TRANSITIVITY_NAN mode); use .unwrap_or(0.0) for the IGRAPH_TRANSITIVITY_ZERO behaviour.
transmission_ratio
Compute the transmission ratio.
treewidth_min_fill
Compute an upper bound on treewidth via min-fill elimination.
treewidth_upper_bound
Compute an upper bound on treewidth via min-degree elimination.
triangle_density
Compute the triangle density of the graph.
triangle_participation
Compute the triangle participation ratio.
trussness
Compute the trussness of every edge in an undirected graph.
umap_compute_weights
Compute UMAP weights from edge distances.
unfold_tree
Unfold a graph into a tree by BFS, replicating multiply-visited vertices.
union
Returns the union of left and right.
union_many
Returns the union of multiple graphs.
variable_first_zagreb
Compute the variable first Zagreb index.
variable_sum_exdeg
Compute the variable sum exdeg index.
vertex_conn_ratio
Compute the vertex connectivity ratio.
vertex_connectivity
Vertex connectivity (cohesion) of a graph.
vertex_connectivity_ratio
Compute the vertex connectivity ratio.
vertex_disjoint_paths
Maximum number of pairwise internally vertex-disjoint paths from source to target.
vertex_path_from_edge_path
Convert an edge path to a vertex path.
vertex_resilience
Compute vertex resilience κ(G) / n.
von_neumann_entropy
Approximate Von Neumann entropy of the graph.
voronoi
Voronoi partitioning of a graph from a set of generator vertices.
walk_entropy
Compute the walk entropy of the graph.
walk_regularity
Compute the walk regularity index of the graph.
walktrap
Run Walktrap on an unweighted, undirected graph with default steps = 4.
walktrap_weighted
Run Walktrap on a weighted, undirected graph with default steps = 4.
walktrap_with_options
Run Walktrap with a custom WalktrapOptions.
widest_path
Widest path from from to to: returns the vertex sequence and the edge sequence along the widest (maximum-bottleneck) path.
widest_path_widths
Single-source widest-path widths on graph from source, following out-edges on directed graphs.
widest_path_widths_floyd_warshall
All-pairs widest-path widths via the Floyd-Warshall recurrence.
widest_path_widths_floyd_warshall_with_mode
Mode-aware variant of widest_path_widths_floyd_warshall. Mode selects how directed edges contribute to the adjacency matrix:
widest_path_widths_with_mode
Widest-path widths with directed-mode selection. Mirrors widest_path_widths but lets you choose OUT/IN/ALL traversal for directed graphs (ignored on undirected).
widest_path_with_mode
Widest path with mode selection. Mirrors widest_path but lets you pick OUT/IN/ALL traversal on directed graphs.
widest_paths
Single-source widest-paths sidecar: widths plus the parent-pointer SPT. Convenient when you want all of widths, parent vertices, and inbound edge ids in one call without re-running the SPT.
widest_paths_to
Widest paths from a single source to multiple targets. Returns one WidestPathResult per element of targets, in the same order; None means the target is unreachable from from.
widest_paths_to_with_mode
Mode-aware variant of widest_paths_to.
widest_paths_with_mode
Mode-aware variant of widest_paths.
wiener_index
Compute the Wiener index of a connected graph.
wiener_polarity_index
Compute the Wiener polarity index of a graph.
wl_hash
Compute the Weisfeiler-Lehman hash of a graph.
wl_hash_iterations
Compute WL hashes at each iteration level (subtree patterns of depth 0..k).
wl_isomorphic
Check if two graphs have equal WL hash (necessary but not sufficient for isomorphism).
write_dimacs_flow
Write a graph in DIMACS max-flow format.
write_dl
Write a graph in UCINET DL edgelist1 format.
write_dot
Write a graph in DOT (Graphviz) format.
write_edgelist
Write a graph as an edge list.
write_gml
Write a graph in GML format, including attributes.
write_graphml
Write a graph in GraphML format, including attributes.
write_leda
Write a graph in LEDA native graph format.
write_lgl
Write a graph in LGL format.
write_ncol
Write a graph in NCOL format.
write_pajek
Write a graph in Pajek (.net) format.

Type Aliases§

AstarHeuristic
A heuristic estimating the distance from a candidate vertex (first argument) to the target vertex (second argument). Must be admissible (never overestimate the true remaining distance) for the result to be a true shortest path.
BellmanFordPathEntry
One entry in the result of bellman_ford_paths: Some((vertices, edges)) if the target is reachable, None otherwise.
EdgeIter
Iterator over graph edges as (from, to) pairs.
IgraphResult
Convenience alias for Result<T, IgraphError>.
Mincut
Result of the global minimum cut computation.
Node2VecWalkResult
Result of a Node2Vec random walk: the vertex chain and the edge chain.
VertexId
Vertex id. The Phase-0 ADR-0007 fixes this to u32; Option<VertexId> is the idiomatic “no vertex” sentinel (igraph C uses -1).
WidestPathResult
One entry of widest_paths_to’s output: Some((vertices, edges)) for a reachable target, None for unreachable. Each vertex chain begins with the source and ends with the target; each edge chain has length one less.