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§
- Eigenvector
Scores - Output of
eigenvector_centrality_full: the normalised centrality vector and the dominant eigenvalue of the (possibly shifted-back) adjacency matrix. - Hits
Scores - Output of
hub_and_authority_scores: scaled hub and authority vectors and the dominant eigenvalue ofA·Aᵀ.
Enums§
- Coreness
Mode - Direction-handling for
coreness_with_mode. - Eigenvector
Mode - How to consider edge directions for
eigenvector_centrality_fulland friends. Mirrors upstream’sIGRAPH_OUT/IGRAPH_IN/IGRAPH_ALL. - Neighborhood
Mode - Direction mode for
neighborhood_size_with_modeon directed graphs. Ignored on undirected graphs — every mode reduces toNeighborhoodMode::All. - Reciprocity
Mode - Reciprocity formula choice. Counterpart of upstream’s
igraph_reciprocity_t(IGRAPH_RECIPROCITY_DEFAULT/IGRAPH_RECIPROCITY_RATIO). - Simple
Mode - Direction-handling for
is_simple_with_mode. Counterpart of upstream’sdirectedboolean parameter.
Functions§
- assortativity_
degree - Degree assortativity coefficient of
graph(undirected, unweighted). ReturnsNonefor graphs with no edges or for regular graphs (all vertices same degree — the variance denominator vanishes, matching upstream’sIGRAPH_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_efficiencyover allNvertices. By upstream convention, returns0.0whenvcount < 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
iis the number of triangles vertexiparticipates in. Parallel edges and self-loops are ignored — the simple graph induced by the OUT-neighbour view is used (consistent withcount_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 ofigraph_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. ReturnsNonefor acyclic graphs. - global_
efficiency - Global efficiency of
graph— average inverse pairwise shortest distance over allN*(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
trueiffgraphhas at least one self-loop edge. - has_
multiple - Returns
trueiffgraphhas at least one parallel edge. - hub_
and_ authority_ scores - Compute Kleinberg’s hub and authority scores.
- is_
acyclic - Returns
trueiffgraphcontains no cycle. - is_
complete - Returns
trueiff every pair of distinct vertices is adjacent. - is_dag
- Returns
trueiffgraphis a directed acyclic graph. - is_
forest - Returns
Some(roots)iffgraphis a forest undermode, otherwiseNone. 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
trueifgraphhas neither self-loops nor parallel edges. - is_
simple_ with_ mode is_simplewith explicitSimpleMode(ALGO-PR-013b).- is_tree
- Returns
Some(root)iffgraphis a tree undermode, otherwiseNone. 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 inN(v)(the unique non-self neighbours ofv), measured in the subgraph obtained by removingv— paths must not pass throughv. Pairs unreachable inG \ {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
mindistfilter. - neighborhood_
with_ mode - Full mode-aware k-hop neighbourhood vertex list with
mindistfilter. - pagerank
PageRankscores via power iteration with damping0.85.- pagerank_
weighted - Weighted
PageRankscores via power iteration with damping0.85. - reciprocity
- Reciprocity of
graph. ReturnsNonefor graphs with no edges (matches upstream’sIGRAPH_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
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.