Skip to main content

Module properties

Module properties 

Source
Expand description

Graph properties — invariants and metrics. Phase 1 entries: ALGO-PR-001 (girth), ALGO-PR-002 (triangles + global/local transitivity), ALGO-PR-003 (density + mean distance), ALGO-PR-004 (reciprocity), ALGO-PR-005 (avg nearest-neighbour degree), ALGO-PR-006 (degree assortativity).

Structs§

EigenvectorScores
Output of eigenvector_centrality_full: the normalised centrality vector and the dominant eigenvalue of the (possibly shifted-back) adjacency matrix.
HitsScores
Output of hub_and_authority_scores: scaled hub and authority vectors and the dominant eigenvalue of A·Aᵀ.

Enums§

CorenessMode
Direction-handling for coreness_with_mode.
EigenvectorMode
How to consider edge directions for eigenvector_centrality_full and friends. Mirrors upstream’s IGRAPH_OUT / IGRAPH_IN / IGRAPH_ALL.
NeighborhoodMode
Direction mode for neighborhood_size_with_mode on directed graphs. Ignored on undirected graphs — every mode reduces to NeighborhoodMode::All.
ReciprocityMode
Reciprocity formula choice. Counterpart of upstream’s igraph_reciprocity_t (IGRAPH_RECIPROCITY_DEFAULT / IGRAPH_RECIPROCITY_RATIO).
SimpleMode
Direction-handling for is_simple_with_mode. Counterpart of upstream’s directed boolean parameter.

Functions§

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.
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).
avg_nearest_neighbor_degree
Average nearest-neighbour degree, per vertex.
betweenness
Per-vertex (unweighted) betweenness centrality.
betweenness_weighted
Per-vertex weighted betweenness centrality.
closeness
Per-vertex closeness centrality (Vec<Option<f64>>).
closeness_weighted
Per-vertex weighted closeness centrality.
convergence_degree
Per-edge convergence degree.
convergence_degree_full
Convergence degree along with the per-edge In(e) / Out(e) counts.
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_loops
Counts self-loop edges in graph.
count_multiple
Per-edge multiplicity: how many edges share each edge’s endpoint pair.
count_triangles
Count the number of triangles in graph. Edge directions, parallel edges, and self-loops are ignored.
density
Edge density of graph. Counterpart of igraph_density(_, NULL_weights, _, /*loops=*/false).
edge_betweenness
Per-edge unweighted betweenness centrality.
edge_betweenness_weighted
Per-edge weighted betweenness centrality (Vec<f64>).
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.
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.
harmonic_centrality
Per-vertex harmonic centrality.
harmonic_centrality_weighted
Per-vertex weighted harmonic centrality.
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.
hub_and_authority_scores
Compute Kleinberg’s hub and authority scores.
is_acyclic
Returns true iff graph contains no cycle.
is_complete
Returns true iff every pair of distinct vertices is adjacent.
is_dag
Returns true iff graph is a directed acyclic graph.
is_forest
Returns Some(roots) iff graph is a forest under mode, otherwise None. The null graph is a forest with empty roots.
is_loop
Returns a per-edge boolean vector marking self-loops.
is_multiple
Returns a per-edge boolean vector marking multiple (parallel) edges.
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_tree
Returns Some(root) iff graph is a tree under mode, otherwise None. The null graph (vcount == 0) is not a tree by convention.
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.
mean_distance
Mean unweighted shortest-path length over all reachable ordered pairs. Counterpart of igraph_average_path_length(_, NULL_weights, _, _, /*directed=*/true, /*unconn=*/true).
neighborhood
k-hop neighbourhood vertex list for every vertex (mode = All, mindist = 0).
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.
pagerank
PageRank scores via power iteration with damping 0.85.
pagerank_weighted
Weighted PageRank scores via power iteration with damping 0.85.
reciprocity
Reciprocity of graph. Returns None for graphs with no edges (matches upstream’s IGRAPH_NAN).
reciprocity_with_mode
Reciprocity with explicit mode + ignore_loops (ALGO-PR-004b).
topological_sorting
Returns a topological ordering of graph’s vertices.
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.