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§

BipartiteResult
Result of bipartiteness check.
CentralizationResult
Result of a centralization convenience wrapper.
ClosenessCutoffResult
Result of closeness_cutoff.
EigenvectorScores
Output of eigenvector_centrality_full: the normalised centrality vector and the dominant eigenvalue of the (possibly shifted-back) adjacency matrix.
GetBiadjacencyResult
Result of get_biadjacency_matrix.
GetBiadjacencyWeightedResult
Result of get_biadjacency_weighted.
HitsScores
Output of hub_and_authority_scores: scaled hub and authority vectors and the dominant eigenvalue of A·Aᵀ.
PowerLawFitResult
Result of fitting a power-law distribution to a sample.
StronglyRegularParams
Result of strongly regular graph recognition.
UnfoldTreeResult
Result of unfolding a graph into a tree.

Enums§

AdjacencyType
Which triangle of the adjacency matrix to fill (undirected graphs only).
CentralizationMode
Whether centralization considers in-degree, out-degree, or total.
CorenessMode
Direction-handling for coreness_with_mode.
DegreeMode
Direction mode for degree computation in directed graphs.
EdgeTypeFilter
What kinds of edges are allowed when testing graphicality.
EigenvectorMode
How to consider edge directions for eigenvector_centrality_full and friends. Mirrors upstream’s IGRAPH_OUT / IGRAPH_IN / IGRAPH_ALL.
LaplacianNormalization
Laplacian normalization mode.
LoopHandling
How to count self-loop edges in the adjacency matrix diagonal.
LoopMode
How loops are counted when computing degree centralization.
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.
SortOrder
Sort order for vertex degree sorting.
StrengthMode
Direction mode for strength_with_mode on directed graphs. Ignored on undirected graphs.
TransitivityMode
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). 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.
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_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 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_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 of igraph_density(_, NULL_weights, _, /*loops=*/false).
diversity
Structural diversity index for all vertices in an undirected graph.
ecc
Compute the edge clustering coefficient for eids in graph.
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. 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_cutoff
Range-limited 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.
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 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_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 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_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_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_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 true when graph is 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 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_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 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_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.
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 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_linsys
PageRank via GMRES on (I - α · Mᵀ) · pr = (1 - α)/N · 1.
pagerank_weighted
Weighted PageRank scores via power iteration with damping 0.85.
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.
power_law_fit
Fit a power-law distribution to a sample of numbers.
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).
regularity
Return the regularity degree of the graph, or None if 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 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.
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.