Expand description
Minimal import set for common use cases.
use rust_igraph::prelude::*;This re-exports only the essential types and the most frequently used algorithms. For the full API, import directly from the crate root:
use rust_igraph::{Graph, louvain, pagerank, betweenness};Re-exports§
pub use crate::algorithms::cliques::clique_number;pub use crate::algorithms::constructors::famous::famous;pub use crate::algorithms::constructors::full::full_graph;pub use crate::algorithms::constructors::ring::cycle_graph;pub use crate::algorithms::games::barabasi::barabasi_game_bag;pub use crate::algorithms::games::erdos_renyi::erdos_renyi_gnp;pub use crate::algorithms::games::watts::watts_strogatz_game;
Structs§
- Bipartite
Result - Result of bipartiteness check.
- Graph
- Counterpart of
igraph_t(seereferences/igraph/include/igraph_datatype.h). - Graph
Builder - A fluent builder for constructing
Graphinstances. - Graph
Summary - Result of
graph_summarycontaining precomputed graph statistics. - Hits
Scores - Output of
hub_and_authority_scores: scaled hub and authority vectors and the dominant eigenvalue ofA·Aᵀ. - Neighbors
Iter - Zero-allocation iterator over the neighbors of a vertex.
Enums§
- Attribute
Value - A single attribute value attached to a graph, vertex, or edge.
- Connectedness
Mode - Connectivity mode for directed graphs.
- Degree
Mode - Direction mode for degree computation in directed graphs.
- Igraph
Error - All errors returned from rust-igraph.
- MstAlgorithm
- Selector for the minimum-spanning-tree algorithm.
Functions§
- articulation_
points - Articulation points of
graph(returns vertices in upstream’s DFS-discovery order). - betweenness
- Per-vertex (unweighted) 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. - bridges
- Bridges of
graph— edges whose removal would increase the number of (weakly) connected components. - closeness
- Per-vertex closeness centrality (
Vec<Option<f64>>). - connected_
components - Compute the weak connected components of
graph. - coreness
- Per-vertex coreness number.
- count_
triangles - Count the number of triangles in
graph. Edge directions, parallel edges, and self-loops are ignored. - degree_
sequence - Returns the degree sequence of the graph.
- density
- Edge density of
graph. Counterpart ofigraph_density(_, NULL_weights, _, /*loops=*/false). - dfs
- Pre-order visit of vertices reachable from
root, in DFS order. - 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.Nonefor a graph with no vertices. - dijkstra_
distances - Single-source Dijkstra distances.
- dijkstra_
paths - Single-source Dijkstra returning distances + parents + inbound edges over every vertex.
- eccentricity
- Eccentricity of every vertex (length
vcount). Resultr[v]is the maximum shortest-path distance fromvto any reachable vertex. Isolated vertices have eccentricity0. - eigenvector_
centrality - Backward-compatible undirected, unweighted entry point.
- get_
shortest_ paths - Returns one shortest path from
sourceto every vertex in the graph. - graph_
summary - Compute a quick structural summary of a graph.
- harmonic_
centrality - Per-vertex harmonic centrality.
- hub_
and_ authority_ scores - Compute Kleinberg’s hub and authority scores.
- is_
bipartite - Check whether a graph is bipartite and optionally return the partition.
- is_
connected - Tests whether the graph is connected.
- is_
simple - Returns
trueifgraphhas neither self-loops nor parallel edges. - isomorphic_
vf2 - Test whether two graphs are isomorphic using the VF2 algorithm.
- katz_
centrality - Compute Katz centrality for all vertices using power iteration.
- leiden
- Run Leiden with the default modularity objective,
γ = 1,β = 0.01, two iterations, seed0. - list_
triangles - List all triangles in a graph.
- louvain
- Run Louvain with the default options (
γ = 1, unweighted, deterministic seed0). - max_
flow - Full maximum-flow computation: value, per-edge flow, cut edges, and source-side / sink-side vertex partitions.
- mean_
distance - Mean unweighted shortest-path length over all reachable ordered pairs.
Counterpart of
igraph_average_path_length(_, NULL_weights, _, _, /*directed=*/true, /*unconn=*/true). - minimum_
spanning_ tree - Computes a minimum spanning tree (or forest, if disconnected) of
graphand returns the IDs of the edges that constitute the tree. - modularity
- Modularity of
graphwith respect to community assignmentmembership. - pagerank
PageRankscores via power iteration with damping0.85.- radius
- Radius of
graph— the minimum vertex eccentricity.Nonefor a graph with no vertices (matches upstream’sIGRAPH_NANfor the null graph). - strongly_
connected_ components - Compute the strongly connected components of
graph. - topological_
sorting - Returns a topological ordering of
graph’s vertices. - transitivity_
undirected - Global transitivity (clustering coefficient) of
graph—3 * triangles / connected_triples. ReturnsNonewhen there are no connected triples (matches upstream’sIGRAPH_TRANSITIVITY_NANmode); use.unwrap_or(0.0)for theIGRAPH_TRANSITIVITY_ZERObehaviour.
Type Aliases§
- Edge
Iter - Iterator over graph edges as
(from, to)pairs. - Igraph
Result - Convenience alias for
Result<T, IgraphError>. - Vertex
Id - Vertex id. The Phase-0 ADR-0007 fixes this to
u32;Option<VertexId>is the idiomatic “no vertex” sentinel (igraph C uses-1).