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§
- Bipartite
Result - Result of bipartiteness check.
- Centralization
Result - Result of a centralization convenience wrapper.
- Closeness
Cutoff Result - Result of
closeness_cutoff. - Eigenvector
Scores - Output of
eigenvector_centrality_full: the normalised centrality vector and the dominant eigenvalue of the (possibly shifted-back) adjacency matrix. - GetBiadjacency
Result - Result of
get_biadjacency_matrix. - GetBiadjacency
Weighted Result - Result of
get_biadjacency_weighted. - Hits
Scores - Output of
hub_and_authority_scores: scaled hub and authority vectors and the dominant eigenvalue ofA·Aᵀ. - Power
LawFit Result - Result of fitting a power-law distribution to a sample.
- Strongly
Regular Params - Result of strongly regular graph recognition.
- Unfold
Tree Result - Result of unfolding a graph into a tree.
Enums§
- Adjacency
Type - Which triangle of the adjacency matrix to fill (undirected graphs only).
- Centralization
Mode - Whether centralization considers in-degree, out-degree, or total.
- Coreness
Mode - Direction-handling for
coreness_with_mode. - Degree
Mode - Direction mode for degree computation in directed graphs.
- Edge
Type Filter - What kinds of edges are allowed when testing graphicality.
- Eigenvector
Mode - How to consider edge directions for
eigenvector_centrality_fulland friends. Mirrors upstream’sIGRAPH_OUT/IGRAPH_IN/IGRAPH_ALL. - Laplacian
Normalization - Laplacian normalization mode.
- Loop
Handling - How to count self-loop edges in the adjacency matrix diagonal.
- Loop
Mode - How loops are counted when computing degree centralization.
- 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. - Sort
Order - Sort order for vertex degree sorting.
- Strength
Mode - Direction mode for
strength_with_modeon directed graphs. Ignored on undirected graphs. - Transitivity
Mode - How to handle vertices with degree < 2 when averaging local transitivity.
Functions§
- are_
adjacent - Check whether two vertices are connected by at least one edge.
- assortativity
- Value-based assortativity coefficient of
graph. - 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.
- assortativity_
nominal - Compute categorical (nominal) 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_
cutoff - Range-limited betweenness centrality.
- betweenness_
subset - Subset betweenness centrality.
- betweenness_
weighted - Per-vertex weighted betweenness centrality.
- bibcoupling
- Computes bibliographic coupling scores between all pairs of vertices.
- 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.
- closeness
- Per-vertex closeness centrality (
Vec<Option<f64>>). - closeness_
cutoff - Range-limited closeness centrality.
- closeness_
weighted - Per-vertex weighted closeness centrality.
- cocitation
- Computes the cocitation scores between all pairs of vertices.
- constraint
- Compute Burt’s constraint scores for all vertices.
- 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_
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_
triangles - Count the number of triangles in
graph. Edge directions, parallel edges, and self-loops are ignored. - degeneracy
- Return the degeneracy of a graph.
- degree_
correlation_ vector - Compute the degree correlation function
k_nn(k). - degree_
distribution - Compute the degree distribution histogram of a graph.
- degree_
sequence - Returns the degree sequence of the graph.
- density
- Edge density of
graph. Counterpart ofigraph_density(_, NULL_weights, _, /*loops=*/false). - diversity
- Structural diversity index for all vertices in an undirected graph.
- ecc
- Compute the edge clustering coefficient for
eidsingraph. - edge_
betweenness - Per-edge unweighted betweenness centrality.
- 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>). - 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.
- expand_
path_ to_ pairs - Expand a vertex path into consecutive pairs for edge lookup.
- get_
adjacency - Compute the adjacency matrix of a graph.
- 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_
laplacian - Compute the Laplacian matrix of a graph.
- get_
stochastic - Compute the stochastic adjacency matrix of a graph.
- 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_ cutoff - Range-limited 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. - has_
mutual - Check whether a directed graph has any mutual (reciprocal) edges.
- hub_
and_ authority_ scores - Compute Kleinberg’s hub and authority scores.
- is_
acyclic - Returns
trueiffgraphcontains 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_
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_
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
trueiff 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_
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
trueiffgraphis 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_
forest - Returns
Some(roots)iffgraphis a forest undermode, otherwiseNone. 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_
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_
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
truewhengraphis a perfect graph. - 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_
self_ complementary - Check whether a graph is self-complementary.
- is_
semicomplete - Check whether a directed graph is semicomplete.
- is_
series_ parallel - Check whether a graph is series-parallel.
- is_
simple - Returns
trueifgraphhas neither self-loops nor parallel edges. - is_
simple_ with_ mode is_simplewith explicitSimpleMode(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)iffgraphis a tree undermode, otherwiseNone. 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_
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.
- 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).
- 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 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. - 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
themrestricted to edges that also exist inus. - 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
themin the 1-neighbourhood defined byus. - 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.
- max_
degree - Returns the maximum degree in the graph.
- max_
degree_ vertex - Returns the vertex (or one of the vertices) with the maximum degree.
- 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).
- min_
degree - Returns the minimum degree in the graph.
- neighborhood
- k-hop neighbourhood vertex list for every vertex (
mode = All,mindist = 0). - 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
mindistfilter. - neighborhood_
with_ mode - Full mode-aware k-hop neighbourhood vertex list with
mindistfilter. - pagerank
PageRankscores via power iteration with damping0.85.- pagerank_
linsys PageRankvia GMRES on(I - α · Mᵀ) · pr = (1 - α)/N · 1.- pagerank_
weighted - Weighted
PageRankscores via power iteration with damping0.85. - personalized_
pagerank - Personalized
PageRankscores via power iteration. - personalized_
pagerank_ default - Personalized
PageRankwith default damping factor (0.85). - personalized_
pagerank_ vs - Personalized
PageRankwith a vertex-set reset distribution. - power_
law_ fit - Fit a power-law distribution to a sample of numbers.
- 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). - regularity
- Return the regularity degree of the graph, or
Noneif the graph is not regular. - rich_
club_ sequence - Per-vertex rich-club coefficient sequence for
graph. - running_
mean - Compute the running mean of a data vector.
- satisfies_
dirac - Check whether a graph satisfies Dirac’s condition.
- satisfies_
ore - Check whether a graph satisfies Ore’s condition.
- 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.
- sort_
vertices_ by_ degree - Return vertex IDs sorted by their degree.
- strength
- Weighted vertex degree for all vertices.
- strength_
with_ mode - Weighted vertex degree with direction mode and loop control.
- topological_
sorting - Returns a topological ordering of
graph’s vertices. - transitivity_
avglocal_ undirected - Average local transitivity (clustering coefficient).
- 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. - trussness
- Compute the trussness of every edge in an undirected graph.
- unfold_
tree - Unfold a graph into a tree by BFS, replicating multiply-visited vertices.