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.
EccentricityClasses
Result of eccentricity_classes.
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.
GraphSummary
Result of graph_summary containing precomputed graph statistics.
HitsScores
Output of hub_and_authority_scores: scaled hub and authority vectors and the dominant eigenvalue of A·Aᵀ.
LabelSpreadResult
Result of label spreading prediction.
PowerLawFitResult
Result of fitting a power-law distribution to a sample.
StronglyRegularParams
Result of strongly regular graph recognition.
StructuralFeatures
Per-vertex structural feature vector.
UnfoldTreeResult
Result of unfolding a graph into a tree.

Enums§

AdjacencyType
Which triangle of the adjacency matrix to fill (undirected graphs only).
AggMode
Aggregation mode for neighborhood operations.
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§

abc_entropy
Compute the ABC entropy.
abc_index
Compute the atom-bond connectivity (ABC) index.
albertson_coindex
Compute the Albertson coindex.
albertson_index
Compute the Albertson index (edge irregularity).
algebraic_connectivity
Compute the algebraic connectivity of a graph.
are_adjacent
Check whether two vertices are connected by at least one edge.
arithmetic_geometric_index
Compute the arithmetic-geometric index.
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.
atom_bond_sum_connectivity
Compute the atom-bond sum-connectivity index.
attention_aggregate
Aggregate a signal with per-edge attention weights.
augmented_forman_ricci_curvature
Augmented Forman-Ricci curvature for each edge.
augmented_zagreb_index
Compute the augmented Zagreb index.
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).
average_sombor_index
Compute the average Sombor index.
avg_local_clustering
Compute the average local clustering coefficient.
avg_nearest_neighbor_degree
Average nearest-neighbour degree, per vertex.
avg_neighbor_connectivity
Compute the average neighbor connectivity of the graph.
avg_neighbor_degree_ratio
Compute the average neighbor degree ratio.
avg_path_fraction
Compute the average path fraction.
balaban_j_index
Compute the Balaban J index of a graph.
bandwidth
Compute the exact graph bandwidth B(G).
bandwidth_lower_bound
Compute a lower bound on graph bandwidth.
bandwidth_of_labeling
Compute the bandwidth of a specific labeling.
bell_index
Compute the Bell index (degree population variance).
bertz_complexity_index
Compute the Bertz complexity index.
betweenness
Per-vertex (unweighted) betweenness centrality.
betweenness_centralization
Compute betweenness centralization.
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.
bipartiteness_ratio
Compute the bipartiteness ratio (2 - μ_n) / 2.
bipartivity_index
Compute the bipartivity index.
bridge_ratio
Compute the bridge ratio of the graph.
centrality_correlation
Compute the centrality correlation (betweenness vs closeness).
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.
cheeger_bounds
Compute Cheeger constant bounds from the normalized Laplacian.
chromatic_number_greedy
Count the number of colors used in a coloring.
circuit_rank_ratio
Compute the circuit rank ratio of the graph.
class_homophily
Class-balanced homophily ratio (adjusted for class imbalance).
clique_cover_number
Compute the clique cover number θ(G).
closed_triplet_ratio
Compute the closed triplet ratio (global transitivity).
closeness
Per-vertex closeness centrality (Vec<Option<f64>>).
closeness_centralization
Compute closeness centralization.
closeness_cutoff
Range-limited closeness centrality.
closeness_weighted
Per-vertex weighted closeness centrality.
clustering_degree_correlation
Compute the clustering-degree correlation.
clustering_path_ratio
Compute the clustering-path ratio.
cocitation
Computes the cocitation scores between all pairs of vertices.
collatz_sinogowitz
Compute the Collatz–Sinogowitz irregularity.
communicability_matrix
Compute the communicability matrix between all pairs of vertices.
component_ratio
Compute the component ratio.
conductance
Compute the conductance of a partition.
connective_eccentricity_index
Compute the connective eccentricity index.
connectivity_index
Compute the connectivity index of the graph.
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_pairs_at_distance
Compute the number of vertex pairs at a given distance.
count_triangles
Count the number of triangles in graph. Edge directions, parallel edges, and self-loops are ignored.
cut_size
Compute the cut size of a partition.
cyclomatic_density
Compute the cyclomatic density.
degeneracy
Return the degeneracy of a graph.
degree_assortativity_proxy
Compute the degree assortativity proxy.
degree_centralization
Compute degree centralization.
degree_closeness_correlation
Compute the degree-closeness correlation.
degree_concentration
Compute the degree concentration.
degree_core_ratio
Compute the core ratio (fraction of vertices with degree ≥ d̄).
degree_correlation_vector
Compute the degree correlation function k_nn(k).
degree_cv
Compute the degree coefficient of variation.
degree_density
Compute the degree density (normalized second moment of degree).
degree_diff_connectivity
Compute the degree difference connectivity index.
degree_distance
Compute the degree-distance index (Schultz-type).
degree_distance_correlation
Compute the degree-distance correlation.
degree_distribution
Compute the degree distribution histogram of a graph.
degree_diversity
Compute the degree diversity (number of distinct degree values).
degree_eccentricity_index
Compute the degree-eccentricity index.
degree_entropy
Shannon entropy of the degree distribution.
degree_entropy_ln
Compute the Shannon entropy of the degree distribution (natural log).
degree_entropy_normalized
Compute the normalized degree entropy.
degree_gini
Compute the Gini coefficient of the degree sequence.
degree_harmonic_mean_index
Compute the degree harmonic mean index.
degree_herfindahl
Compute the Herfindahl–Hirschman index of the degree sequence.
degree_hoover
Compute the Hoover index (Robin Hood index) of the degree sequence.
degree_iqr
Compute the interquartile range (IQR) of the degree sequence.
degree_isolated_ratio
Compute the isolated ratio (fraction of degree-0 vertices).
degree_kurtosis
Compute the excess kurtosis of the degree distribution.
degree_laplacian_energy
Compute the degree Laplacian energy of the graph.
degree_leaf_ratio
Compute the leaf ratio (fraction of degree-1 vertices).
degree_mad
Compute the mean absolute deviation of the degree sequence.
degree_max_deviation
Compute the maximum degree deviation from the mean.
degree_median
Compute the median of the degree sequence.
degree_median_ad
Compute the median absolute deviation of the degree sequence.
degree_mixing_entropy
Compute the degree mixing entropy.
degree_mode
Compute the mode of the degree sequence.
degree_neighbor_max_sum
Compute the sum of maximum neighbor degrees.
degree_neighbor_min_sum
Compute the sum of minimum neighbor degrees.
degree_neighbor_range_sum
Compute the sum of neighbor degree ranges.
degree_neighbor_variance_sum
Compute the sum of neighbor degree variances.
degree_palma
Compute the Palma ratio of the degree sequence.
degree_profile
Compute degree profile for each vertex: [deg, deg², log(deg+1)].
degree_range
Compute the range of the degree sequence.
degree_sequence
Returns the degree sequence of the graph.
degree_skewness
Compute the skewness of the degree distribution.
degree_span_ratio
Compute the degree span ratio.
degree_spectral_gap_estimate
Compute the degree-based spectral gap estimate.
degree_structural_info
Structural information content based on degree sequence.
degree_sum_index
Compute the degree-sum index.
degree_tail_ratio
Compute the tail ratio (fraction of vertices with degree ≥ 2·d̄).
degree_theil
Compute the Theil index (GE(1)) of the degree sequence.
degree_variance
Compute the variance of the degree sequence.
degree_variance_ratio
Compute the degree variance ratio.
density
Edge density of graph. Counterpart of igraph_density(_, NULL_weights, _, /*loops=*/false).
diameter_radius_ratio
Compute the diameter-radius ratio.
diameter_vulnerability
Compute the diameter vulnerability.
dirichlet_energy
Compute the Dirichlet energy of a signal on a graph.
distance_energy
Compute the distance energy E_D = Σ |λ_i(D)|.
distance_estrada_index
Compute the distance Estrada index DEE = Σ exp(λ_i(D)).
distance_spectral_radius
Compute the distance spectral radius ρ_D = λ_1(D).
distance_spectrum
Compute the distance spectrum, sorted in decreasing order.
diversity
Structural diversity index for all vertices in an undirected graph.
ecc
Compute the edge clustering coefficient for eids in graph.
eccentric_connectivity_index
Compute the eccentric connectivity index.
eccentric_distance_sum
Compute the eccentric-distance sum.
eccentricity_classes
Classify each vertex by its eccentricity class.
edge_adamic_adar_sum
Compute the sum of Adamic–Adar indices across all edges.
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>).
edge_common_neighbor_sum
Compute the sum of common neighbor counts across all edges.
edge_conn_ratio
Compute the edge connectivity ratio.
edge_connectivity_ratio
Compute the edge connectivity ratio.
edge_degree_cosine
Compute the cosine similarity of degree vectors across edges.
edge_degree_covariance
Compute the degree covariance across edges.
edge_degree_diff_ratio
Compute the degree difference ratio over edges.
edge_degree_discrepancy
Compute the normalized degree discrepancy across edges.
edge_degree_geometric_sum
Compute the edge degree geometric sum.
edge_degree_harmonic_sum
Compute the edge degree harmonic sum.
edge_degree_log_product
Compute the edge degree log-product sum.
edge_degree_max_sum
Compute the edge degree max sum.
edge_degree_mean_sum
Compute the edge degree mean sum.
edge_degree_min_sum
Compute the edge degree min sum.
edge_degree_pearson
Compute the Pearson correlation of endpoint degrees across edges.
edge_degree_product_ratio
Compute the product-sum ratio index over edges.
edge_degree_ratio_sum
Compute the edge degree ratio sum.
edge_degree_rms
Compute the edge endpoint degree RMS.
edge_degree_sorensen
Compute the Sørensen edge degree index.
edge_entropy
Shannon entropy of the edge-degree distribution.
edge_heterophily
Heterophily ratio: 1 - edge_homophily.
edge_homophily
Edge homophily ratio: fraction of edges connecting same-label vertices.
edge_inverse_degree_sum
Compute the inverse degree-sum index over edges.
edge_jaccard_sum
Compute the sum of Jaccard overlap coefficients across all edges.
edge_overlap_sum
Compute the sum of overlap coefficients across all edges.
edge_pi_index
Compute the edge-PI index.
edge_resilience
Compute edge resilience λ(G) / m.
edge_surplus_ratio
Compute the edge surplus ratio.
edge_szeged_index
Compute the edge-Szeged index.
edge_vertex_ratio
Compute the edge-vertex ratio.
effective_resistance
Compute the effective resistance between two vertices.
effective_resistance_matrix
Compute the effective resistance matrix for all pairs.
efficiency_ratio
Compute the efficiency ratio.
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.
elimination_ordering
Compute an elimination ordering using the min-degree heuristic.
elliptic_sombor_index
Compute the elliptic Sombor index.
estrada_index
Compute the Estrada index of a graph.
ev_degree_randic
Compute the ev-degree Randić index.
even_odd_walk_ratio
Compute the even-odd walk ratio.
expand_path_to_pairs
Expand a vertex path into consecutive pairs for edge lookup.
expansion
Compute the expansion (isoperimetric number) of a partition.
exponential_abc
Compute the exponential atom-bond connectivity index.
exponential_augmented_zagreb
Compute the exponential augmented Zagreb index.
exponential_first_zagreb
Compute the exponential first Zagreb index.
exponential_forgotten
Compute the exponential forgotten index.
exponential_ga
Compute the exponential geometric-arithmetic index.
exponential_inverse_degree
Compute the exponential inverse degree index.
exponential_randic
Compute the exponential Randić index.
exponential_sum_connectivity
Compute the exponential sum-connectivity index.
fiedler_vector
Compute the Fiedler vector of a graph.
fifth_ga_index
Compute the fifth geometric-arithmetic index.
first_ev_degree_zagreb
Compute the first ev-degree Zagreb index.
first_gourava_index
Compute the first Gourava index.
first_hyper_gourava_index
Compute the first hyper-Gourava index.
first_hyper_zagreb
Compute the first hyper-Zagreb index.
first_hyper_zagreb_coindex
Compute the first hyper-Zagreb coindex.
first_inverse_nirmala
Compute the first inverse Nirmala index.
first_leap_zagreb
Compute the first leap Zagreb index.
first_multiplicative_zagreb
Compute the first multiplicative Zagreb index.
first_neighborhood_zagreb
Compute the first neighborhood Zagreb index.
first_redefined_zagreb
Compute the first redefined Zagreb index.
first_reformulated_zagreb
Compute the first reformulated Zagreb index.
first_transmission_zagreb
Compute the first transmission Zagreb index.
first_ve_degree_zagreb_alpha
Compute the first ve-degree Zagreb alpha index.
first_ve_degree_zagreb_beta
Compute the first ve-degree Zagreb beta index.
first_zagreb_coindex
Compute the first Zagreb coindex.
first_zagreb_connection
Compute the first Zagreb connection index.
first_zagreb_entropy
Compute the first Zagreb entropy.
first_zagreb_index
Compute the first Zagreb index M₁(G) = Σ deg(v)².
forgotten_coindex
Compute the forgotten coindex (F-coindex).
forgotten_index
Compute the forgotten topological index.
forman_ricci_curvature
Forman-Ricci curvature for each edge.
fourth_abc_index
Compute the fourth atom-bond connectivity index.
freeman_degree_centralization
Compute Freeman’s degree centralization.
frustration_ratio
Compute the frustration ratio.
general_randic_index
Compute the general Randić index R_α(G).
general_sum_connectivity_index
Compute the general sum-connectivity index χ_α(G).
general_zeroth_order_randic
Compute the general zeroth-order Randić index.
geometric_arithmetic_index
Compute the geometric-arithmetic index.
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.
giant_component_gap
Compute the giant component gap.
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.
gordon_scantlebury_index
Compute the Gordon-Scantlebury index (path-of-length-2 count).
graovac_ghorbani_index
Compute the Graovac-Ghorbani index.
graph_compactness
Compute the compactness of the graph.
graph_energy
Compute the graph energy.
graph_integrity
Compute the integrity of a graph.
graph_periphery
Return the periphery vertices of a graph.
graph_summary
Compute a quick structural summary of a graph.
graph_summary_string
Format a detailed multi-line summary of a graph.
graph_toughness
Compute the toughness of a graph.
greedy_clique_cover
Find a greedy clique cover.
greedy_clique_number
Compute the greedy clique number (lower bound on chromatic number).
greedy_coloring
Greedy vertex coloring in natural vertex order.
greedy_coloring_largest_first
Greedy coloring with largest-first (LF) ordering.
greedy_coloring_with_order
Greedy vertex coloring with a custom vertex processing order.
greedy_independent_set
Find a maximal independent set using a greedy heuristic.
greedy_matching
Find a greedy maximal matching.
gutman_index
Compute the Gutman index.
hamiltonian_cycle
Find a Hamiltonian cycle using backtracking.
hamiltonian_path
Find a Hamiltonian path using backtracking.
harary_index
Compute the Harary index of a graph.
harmonic_centrality
Per-vertex harmonic centrality.
harmonic_centrality_cutoff
Range-limited harmonic centrality.
harmonic_centrality_weighted
Per-vertex weighted harmonic centrality.
harmonic_graph_index
Compute the harmonic index.
has_hamiltonian_cycle
Check whether a graph has a Hamiltonian cycle.
has_hamiltonian_path
Check whether a graph has a Hamiltonian path.
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.
heat_kernel_diffuse
Diffuse a signal on the graph using the heat kernel.
hosoya_index
Compute the Hosoya index (Z-index) of a graph.
hub_and_authority_scores
Compute Kleinberg’s hub and authority scores.
hub_dominance
Compute the hub dominance.
hub_dominance_ratio
Compute the hub dominance ratio.
hub_ratio
Compute the hub ratio.
hyper_wiener_index
Compute the hyper-Wiener index of a graph.
hyperbolicity
Compute δ-hyperbolicity as a floating-point value.
hyperbolicity_twice
Compute the Gromov δ-hyperbolicity of a graph.
independence_ratio
Compute the independence ratio α(G) / n.
independent_set_count_sequence
Compute the independence polynomial coefficient sequence.
inverse_degree_index
Compute the inverse degree index (zeroth-order Randić index).
inverse_degree_power
Compute the inverse degree power index.
inverse_sum_indeg_index
Compute the inverse sum indeg index.
ira_index
Compute the power-difference irregularity index.
irb_index
Compute the root-difference irregularity index.
ird_index
Compute the square-difference irregularity index.
irga_index
Compute the geometric-arithmetic irregularity index.
irl_irregularity
Compute the IRL irregularity (irregularity by logarithm).
irlu_irregularity
Compute the IRLU irregularity (irregularity by log-ratio).
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_clique_cover
Check whether a partition of vertices forms a valid clique cover.
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_hamiltonian_cycle
Check whether a sequence of vertices forms a valid Hamiltonian cycle.
is_hamiltonian_path
Check whether a sequence of vertices forms a valid Hamiltonian path.
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_perfect_matching
Check whether a matching is a perfect matching.
is_planar
Test whether a graph is planar.
is_proper_coloring
Check whether a coloring is valid (proper).
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_valid_matching
Check whether a matching is valid.
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.
isolated_vertex_ratio
Compute the isolated vertex ratio.
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).
kirchhoff_index
Compute the Kirchhoff index of a graph.
label_propagate_predict
Predict labels using simple majority voting from labeled neighbors.
label_spread
Predict labels for unlabeled vertices using label spreading.
lanzhou_index
Compute the Lanzhou index.
laplacian_spectrum
Compute all Laplacian eigenvalues, sorted in ascending order.
largest_component_fraction
Compute the largest component fraction.
leaf_to_hub_ratio
Compute the leaf-to-hub ratio.
link_pred_adamic_adar
Compute Adamic-Adar Index for given vertex pairs.
link_pred_common_neighbors
Compute Common Neighbors score for given vertex pairs.
link_pred_jaccard
Compute Jaccard Coefficient for given vertex pairs.
link_pred_preferential_attachment
Compute Preferential Attachment score for given vertex pairs.
link_pred_resource_allocation
Compute Resource Allocation Index for given vertex pairs.
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_efficiency_ratio
Compute the local efficiency ratio.
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.
matching_count_sequence
Compute the matching count sequence [m(G,0), m(G,1), …].
matching_number
Compute the matching number ν(G).
max_degree
Returns the maximum degree in the graph.
max_degree_vertex
Returns the vertex (or one of the vertices) with the maximum degree.
maximum_matching
Find the maximum matching (brute-force).
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).
mean_forman_ricci
Compute the average Forman-Ricci curvature of the graph.
merrifield_simmons_index
Compute the Merrifield–Simmons index of a graph.
meshedness_coefficient
Compute the meshedness coefficient of the graph.
min_degree
Returns the minimum degree in the graph.
minmax_degree_ratio
Compute the min-max degree ratio index.
modified_first_zagreb
Compute the modified first Zagreb index.
modified_first_zagreb_connection
Compute the modified first Zagreb connection index.
modified_sombor_index
Compute the modified Sombor index.
mostar_index
Compute the Mostar index of a graph.
multi_edge_ratio
Compute the multi-edge ratio of the graph.
multiplicative_abc
Compute the multiplicative atom-bond connectivity index.
multiplicative_ga
Compute the multiplicative geometric-arithmetic index.
multiplicative_randic
Compute the multiplicative Randić index.
multiplicative_sum_connectivity
Compute the multiplicative sum-connectivity index.
multiplicatively_weighted_harary
Compute the multiplicatively weighted Harary index.
narumi_katayama_index
Compute the Narumi-Katayama index.
natural_connectivity
Compute the natural connectivity of a graph.
navigability_ratio
Compute the navigability ratio.
neighbor_aggregate
Aggregate a signal over each vertex’s neighborhood.
neighbor_degree_disparity
Compute the average neighbor degree ratio.
neighborhood
k-hop neighbourhood vertex list for every vertex (mode = All, mindist = 0).
neighborhood_forgotten_index
Compute the neighborhood forgotten index.
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.
nirmala_index
Compute the Nirmala index.
node_homophily
Node homophily ratio: average proportion of same-label neighbors.
normalized_algebraic_connectivity
Compute the normalized algebraic connectivity μ_2(L_norm).
normalized_cut
Compute the normalized cut (NCut) of a partition.
normalized_dirichlet_energy
Compute the normalized Dirichlet energy (Rayleigh quotient form).
normalized_laplacian_spectrum
Compute the normalized Laplacian spectrum, sorted ascending.
odd_cycle_density
Compute the odd cycle density.
ollivier_ricci_curvature
Ollivier-Ricci curvature for each edge (lazy random walk variant).
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.
pendant_edge_ratio
Compute the pendant edge ratio.
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.
pi_index
Compute the Padmakar-Ivan (PI) index of a graph.
platt_index
Compute the Platt index (sum of edge degrees).
power_law_fit
Fit a power-law distribution to a sample of numbers.
ppr_diffuse
Diffuse a signal using Personalized PageRank propagation.
randic_entropy
Compute the Randić entropy.
randic_index
Compute the Randić connectivity index.
ratio_cut
Compute the ratio cut of a partition.
reciprocal_degree_distance
Compute the reciprocal degree distance (additively weighted Harary index).
reciprocal_randic_index
Compute the reciprocal Randić index.
reciprocal_transmission_index
Compute the reciprocal transmission index.
reciprocity
Reciprocity of graph. Returns None for graphs with no edges (matches upstream’s IGRAPH_NAN).
reciprocity_ratio
Compute the reciprocity ratio of the graph.
reciprocity_with_mode
Reciprocity with explicit mode + ignore_loops (ALGO-PR-004b).
reduced_first_zagreb
Compute the reduced first Zagreb index.
reduced_forgotten_index
Compute the reduced forgotten index.
reduced_reciprocal_randic
Compute the reduced reciprocal Randić index.
reduced_second_zagreb
Compute the reduced second Zagreb index.
reduced_sombor_index
Compute the reduced Sombor index.
reduced_sum_connectivity
Compute the reduced sum-connectivity index.
regularity
Return the regularity degree of the graph, or None if the graph is not regular.
resistance_centrality
Compute resistance centrality for all vertices.
revised_szeged_index
Compute the revised Szeged index of a graph.
rich_club_density
Compute the rich club density.
rich_club_sequence
Per-vertex rich-club coefficient sequence for graph.
running_mean
Compute the running mean of a data vector.
rwpe
Compute Random Walk Positional Encoding for all vertices.
rwpe_vertices
Compute RWPE only for specified vertices (more efficient for batches).
satisfies_dirac
Check whether a graph satisfies Dirac’s condition.
satisfies_ore
Check whether a graph satisfies Ore’s condition.
schultz_index
Compute the Schultz index (degree-distance index).
second_ev_degree_zagreb
Compute the second ev-degree Zagreb index.
second_gourava_index
Compute the second Gourava index.
second_hyper_zagreb
Compute the second hyper-Zagreb index.
second_hyper_zagreb_coindex
Compute the second hyper-Zagreb coindex.
second_inverse_nirmala
Compute the second inverse Nirmala index.
second_leap_zagreb
Compute the second leap Zagreb index.
second_multiplicative_zagreb
Compute the second multiplicative Zagreb index.
second_neighborhood_zagreb
Compute the second neighborhood Zagreb index.
second_reformulated_zagreb
Compute the second reformulated Zagreb index.
second_transmission_zagreb
Compute the second transmission Zagreb index.
second_ve_degree_zagreb
Compute the second ve-degree Zagreb index.
second_zagreb_coindex
Compute the second Zagreb coindex.
second_zagreb_connection
Compute the second Zagreb connection index.
second_zagreb_entropy
Compute the second Zagreb entropy.
second_zagreb_index
Compute the second Zagreb index M₂(G) = Σ_{(u,v)∈E} deg(u)·deg(v).
self_loop_ratio
Compute the self-loop ratio of the graph.
sigma_coindex
Compute the sigma coindex.
sigma_index
Compute the sigma index (Gutman irregularity).
signless_laplacian_energy
Compute the signless Laplacian energy.
signless_laplacian_smallest
Compute the smallest signless Laplacian eigenvalue q_1(Q).
signless_laplacian_spectral_radius
Compute the signless Laplacian spectral radius q_n(Q).
signless_laplacian_spectrum
Compute the signless Laplacian spectrum, sorted ascending.
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.
smallworld_omega
Compute the small-world omega estimate.
smallworld_sigma
Compute the small-world sigma estimate.
smoothness_ratio
Compute the smoothness ratio of a signal on a graph.
sombor_coindex
Compute the Sombor coindex.
sombor_index
Compute the Sombor index.
sort_vertices_by_degree
Return vertex IDs sorted by their degree.
spanning_tree_count
Count the number of spanning trees using Kirchhoff’s theorem.
spectral_bisection
Compute a spectral bisection of the graph.
spectral_gap
Compute the spectral gap of a graph.
spectral_gap_ratio
Compute the spectral gap ratio μ_2 / μ_n.
spectral_radius
Compute the spectral radius of a graph.
square_clustering_ratio
Compute the square clustering ratio.
square_density
Compute the square (4-cycle) density of the graph.
strength
Weighted vertex degree for all vertices.
strength_with_mode
Weighted vertex degree with direction mode and loop control.
structural_feature_vectors
Compute structural feature vectors for all vertices.
subgraph_centrality
Compute subgraph centrality for all vertices.
sum_connectivity_index
Compute the sum-connectivity index.
symmetric_degree_ratio
Compute the symmetric degree ratio index.
symmetric_diffuse
Diffuse a signal using symmetric normalized propagation.
symmetric_division_deg_index
Compute the symmetric division deg index.
szeged_index
Compute the Szeged index of a graph.
terminal_wiener_index
Compute the terminal Wiener index.
third_leap_zagreb
Compute the third leap Zagreb index.
third_zagreb_index
Compute the third Zagreb index.
topological_sorting
Returns a topological ordering of graph’s vertices.
total_eccentricity
Compute the total eccentricity.
total_irregularity
Compute the total irregularity.
total_variation
Compute the total variation of a signal on a graph.
transitivity_avglocal_undirected
Average local transitivity (clustering coefficient).
transitivity_gap
Compute the transitivity gap.
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.
transmission_ratio
Compute the transmission ratio.
treewidth_min_fill
Compute an upper bound on treewidth via min-fill elimination.
treewidth_upper_bound
Compute an upper bound on treewidth via min-degree elimination.
triangle_density
Compute the triangle density of the graph.
triangle_participation
Compute the triangle participation ratio.
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.
variable_first_zagreb
Compute the variable first Zagreb index.
variable_sum_exdeg
Compute the variable sum exdeg index.
vertex_conn_ratio
Compute the vertex connectivity ratio.
vertex_connectivity_ratio
Compute the vertex connectivity ratio.
vertex_resilience
Compute vertex resilience κ(G) / n.
von_neumann_entropy
Approximate Von Neumann entropy of the graph.
walk_entropy
Compute the walk entropy of the graph.
walk_regularity
Compute the walk regularity index of the graph.
wiener_index
Compute the Wiener index of a connected graph.
wiener_polarity_index
Compute the Wiener polarity index of a graph.