Skip to main content

rust_igraph/
lib.rs

1//! # rust-igraph
2//!
3//! **Pure-Rust, high-performance graph and network analysis library.**
4//!
5//! A faithful port of [igraph](https://igraph.org) with 1,297 public APIs,
6//! zero `unsafe`, and no C/C++ FFI. Built for researchers, data scientists,
7//! and systems engineers who need production-grade graph algorithms in the
8//! Rust ecosystem.
9//!
10//! ## Feature overview
11//!
12//! | Category | Highlights |
13//! |----------|-----------|
14//! | **Traversal** | BFS, DFS, topological sort, random walks |
15//! | **Shortest paths** | Dijkstra, Bellman-Ford, A\*, Johnson, all-pairs, widest paths |
16//! | **Centrality** | betweenness, closeness, eigenvector, `PageRank`, HITS, Katz |
17//! | **Community** | Louvain, Leiden, Infomap, Spinglass, label propagation, Walktrap, fast greedy |
18//! | **Connectivity** | components, articulation points, bridges, separators, percolation |
19//! | **Flow** | max-flow, min-cut, Gomory-Hu tree, disjoint paths |
20//! | **Isomorphism** | VF2, LAD, BLISS canonical labeling, isoclass |
21//! | **Generators** | Erdos-Renyi, Barabasi-Albert, SBM, lattices, 40+ more |
22//! | **Properties** | 60+ structural recognizers, degree stats, transitivity, graphlets |
23//! | **Eigenvalues** | Lanczos (symmetric), Arnoldi (general), adjacency |
24//! | **Layout** | Fruchterman-Reingold, Kamada-Kawai, `DrL`, MDS, LGL, circle, tree |
25//! | **I/O** | GML, `GraphML`, Pajek, DOT, LEDA, DL, DIMACS, NCOL, LGL |
26//! | **Similarity** | Jaccard, Dice, inverse-log-weighted |
27//!
28//! ## Quick start
29//!
30//! ```
31//! use rust_igraph::{Graph, bfs};
32//!
33//! let mut g = Graph::with_vertices(4);
34//! g.add_edge(0, 1).unwrap();
35//! g.add_edge(0, 2).unwrap();
36//! g.add_edge(1, 3).unwrap();
37//!
38//! let order = bfs(&g, 0).unwrap();
39//! assert_eq!(order, vec![0, 1, 2, 3]);
40//! ```
41//!
42//! Or with the fluent builder:
43//!
44//! ```
45//! use rust_igraph::GraphBuilder;
46//!
47//! let g = GraphBuilder::undirected()
48//!     .edges(&[(0, 1), (1, 2), (2, 3), (3, 0)])
49//!     .build()
50//!     .unwrap();
51//! assert_eq!(g.vcount(), 4);
52//! ```
53//!
54//! Methods are available directly on [`Graph`] for the most common operations:
55//!
56//! ```
57//! use rust_igraph::Graph;
58//!
59//! let g = Graph::from_edges(&[(0,1), (1,2), (2,0)], false, None).unwrap();
60//! assert!(g.is_connected().unwrap());
61//! assert!(g.is_simple().unwrap());
62//! let pr = g.pagerank().unwrap();
63//! assert_eq!(pr.len(), 3);
64//! ```
65//!
66//! Random graph generators are one method call away:
67//!
68//! ```
69//! use rust_igraph::Graph;
70//!
71//! let er = Graph::erdos_renyi(1000, 0.01, 42).unwrap();
72//! let ba = Graph::barabasi_albert(1000, 3, 42).unwrap();
73//! let ws = Graph::watts_strogatz(1000, 6, 0.1, 42).unwrap();
74//! assert_eq!(er.vcount(), 1000);
75//! assert_eq!(ba.vcount(), 1000);
76//! assert_eq!(ws.vcount(), 1000);
77//! ```
78//!
79//! ## Complete workflow
80//!
81//! A typical analysis pipeline — load, explore, analyze, in just a few lines:
82//!
83//! ```
84//! use rust_igraph::Graph;
85//!
86//! // Build a small network
87//! let g = Graph::from_edges(
88//!     &[(0,1),(1,2),(2,3),(3,4),(4,0),(0,2),(2,4)],
89//!     false, None
90//! ).unwrap();
91//!
92//! // Structural overview
93//! assert!(g.is_connected().unwrap());
94//! assert!(g.is_simple().unwrap());
95//! let apl = g.average_path_length().unwrap().unwrap();
96//! assert!(apl < 2.0);
97//!
98//! // Centrality
99//! let pr = g.pagerank().unwrap();
100//! let bc = g.betweenness().unwrap();
101//!
102//! // Community structure
103//! let communities = g.louvain().unwrap();
104//! assert!(communities.modularity >= 0.0);
105//!
106//! // Single-pair shortest path
107//! let path = g.shortest_path_to(0, 3, None).unwrap();
108//! assert!(!path.vertices.is_empty());
109//!
110//! // Random walk
111//! let (walk, _edges) = g.random_walk(0, 20, 42).unwrap();
112//! assert_eq!(walk[0], 0);
113//! ```
114//!
115//! ## Import style
116//!
117//! All algorithms are also re-exported as free functions at the crate root:
118//!
119//! ```rust,no_run
120//! use rust_igraph::{Graph, pagerank, betweenness, louvain};
121//! ```
122//!
123//! For minimal imports, use the [`prelude`] module:
124//!
125//! ```rust,no_run
126//! use rust_igraph::prelude::*;
127//! ```
128//!
129//! ## License
130//!
131//! GPL-2.0-or-later, matching upstream igraph.
132
133pub mod algorithms;
134pub(crate) mod core;
135pub mod prelude;
136
137// Top-level re-exports for the common case.
138// IMPORTANT: when a function name collides with the file/module it
139// lives in (e.g. `is_simple` in `is_simple.rs`), `pub use
140// crate::algorithms::properties::is_simple` resolves ambiguously to
141// **both** the module and the function, and rustdoc renders the
142// re-export twice on the crate-root page. To suppress that, every
143// re-export below points at the inner module path explicitly so the
144// resolution is unambiguously the function. The submodules
145// themselves are `pub(crate)` (see each algorithm-group `mod.rs`),
146// so the deep paths stay crate-internal at the type-checker level
147// while rustdoc only renders the function entry.
148pub use crate::algorithms::chordality::{
149    ChordalResult, McsResult, is_chordal, maximum_cardinality_search,
150};
151pub use crate::algorithms::cliques::{
152    clique_number, clique_size_hist, cliques, independence_number, independent_vertex_sets,
153    largest_cliques, largest_independent_vertex_sets, largest_weighted_cliques, maximal_cliques,
154    maximal_cliques_count, maximal_cliques_hist, maximal_cliques_subset,
155    maximal_independent_vertex_sets, weighted_clique_number, weighted_cliques,
156};
157pub use crate::algorithms::coloring::{
158    BipartiteColoringResult, BipartiteEdgeDirection, GreedyColoringHeuristic,
159    chromatic_number_upper_bound, edge_chromatic_number, edge_coloring_greedy,
160    is_bipartite_coloring, is_edge_coloring, is_vertex_coloring, vertex_chromatic_number,
161    vertex_coloring_greedy,
162};
163pub use crate::algorithms::community::community_to_membership::{
164    CommunityToMembershipResult, community_to_membership, le_community_to_membership,
165};
166pub use crate::algorithms::community::community_voronoi::{
167    CommunityVoronoiResult, community_voronoi,
168};
169pub use crate::algorithms::community::compare_communities::{
170    CommunityComparison, compare_communities,
171};
172pub use crate::algorithms::community::edge_betweenness_community::{
173    EdgeBetweennessResult, edge_betweenness_community,
174};
175pub use crate::algorithms::community::edge_betweenness_community_weighted::edge_betweenness_community_weighted;
176pub use crate::algorithms::community::fast_greedy_modularity::{
177    FastGreedyResult, fast_greedy_modularity, fast_greedy_modularity_weighted,
178};
179pub use crate::algorithms::community::fluid_communities::{
180    FLUID_DEFAULT_MAX_ITERATIONS, FluidOptions, FluidResult, fluid_communities,
181    fluid_communities_with_options,
182};
183pub use crate::algorithms::community::infomap::{
184    InfomapResult, infomap, infomap_weighted, infomap_with_options,
185};
186pub use crate::algorithms::community::label_propagation::{
187    LpaOptions, LpaResult, LpaVariant, label_propagation, label_propagation_weighted,
188    label_propagation_with_options,
189};
190pub use crate::algorithms::community::leading_eigenvector::{
191    LeadingEigenvectorResult, leading_eigenvector, leading_eigenvector_weighted,
192};
193pub use crate::algorithms::community::leiden::{
194    LEIDEN_DEFAULT_BETA, LEIDEN_DEFAULT_ITERATIONS, LeidenObjective, LeidenOptions, LeidenResult,
195    leiden, leiden_weighted, leiden_with_options,
196};
197pub use crate::algorithms::community::louvain::{
198    LouvainResult, louvain, louvain_weighted, louvain_with_options,
199};
200pub use crate::algorithms::community::modularity::{
201    modularity, modularity_directed, modularity_weighted, modularity_weighted_directed,
202};
203pub use crate::algorithms::community::modularity_matrix::modularity_matrix;
204pub use crate::algorithms::community::reindex_membership::{
205    ReindexMembershipResult, reindex_membership,
206};
207pub use crate::algorithms::community::spinglass::{
208    SPINGLASS_DEFAULT_SPINS, SpinglassOptions, SpinglassResult, SpinglassUpdateRule, spinglass,
209    spinglass_weighted, spinglass_with_options,
210};
211pub use crate::algorithms::community::split_join_distance::{
212    SplitJoinDistance, split_join_distance,
213};
214pub use crate::algorithms::community::walktrap::{
215    WALKTRAP_DEFAULT_STEPS, WalktrapOptions, WalktrapResult, walktrap, walktrap_weighted,
216    walktrap_with_options,
217};
218pub use crate::algorithms::connectivity::articulation::articulation_points;
219pub use crate::algorithms::connectivity::biconnected::{
220    BiconnectedComponents, biconnected_components,
221};
222pub use crate::algorithms::connectivity::bridges::bridges;
223pub use crate::algorithms::connectivity::cohesive_blocks::{CohesiveBlocks, cohesive_blocks};
224pub use crate::algorithms::connectivity::components::{ConnectedComponents, connected_components};
225pub use crate::algorithms::connectivity::decompose::decompose;
226pub use crate::algorithms::connectivity::is_biconnected::is_biconnected;
227pub use crate::algorithms::connectivity::is_connected::{ConnectednessMode, is_connected};
228pub use crate::algorithms::connectivity::percolation::{
229    EdgelistPercolation, SitePercolation, bond_percolation, edgelist_percolation, site_percolation,
230};
231pub use crate::algorithms::connectivity::reachability::count_reachable;
232pub use crate::algorithms::connectivity::reachability_matrix::reachability_matrix;
233pub use crate::algorithms::connectivity::reachability_scc::{
234    ReachabilityMode, ReachabilityResult, reachability,
235};
236pub use crate::algorithms::connectivity::separators::{
237    all_minimal_st_separators, is_minimal_separator, is_separator, minimum_size_separators,
238};
239pub use crate::algorithms::connectivity::strong::strongly_connected_components;
240pub use crate::algorithms::connectivity::subcomponent::{SubcomponentMode, subcomponent};
241pub use crate::algorithms::connectivity::transitive_closure::transitive_closure;
242pub use crate::algorithms::constructors::adjacency::{AdjacencyMode, LoopsMode, adjacency};
243pub use crate::algorithms::constructors::atlas::{ATLAS_SIZE, atlas};
244pub use crate::algorithms::constructors::biadjacency::{BiadjacencyResult, biadjacency};
245pub use crate::algorithms::constructors::circulant::circulant;
246pub use crate::algorithms::constructors::create::create;
247pub use crate::algorithms::constructors::create_bipartite::create_bipartite;
248pub use crate::algorithms::constructors::de_bruijn::de_bruijn;
249pub use crate::algorithms::constructors::extended_chordal_ring::extended_chordal_ring;
250pub use crate::algorithms::constructors::famous::{famous, famous_names};
251pub use crate::algorithms::constructors::full::full_graph;
252pub use crate::algorithms::constructors::full_bipartite::{FullBipartite, full_bipartite};
253pub use crate::algorithms::constructors::full_citation::full_citation;
254pub use crate::algorithms::constructors::full_multipartite::{
255    FullMultipartite, MultipartiteMode, full_multipartite,
256};
257pub use crate::algorithms::constructors::generalized_petersen::generalized_petersen;
258pub use crate::algorithms::constructors::hamming::hamming;
259pub use crate::algorithms::constructors::hexagonal_lattice::hexagonal_lattice;
260pub use crate::algorithms::constructors::hypercube::{MAX_HYPERCUBE_DIMENSION, hypercube};
261pub use crate::algorithms::constructors::kary_tree::{TreeMode, kary_tree};
262pub use crate::algorithms::constructors::kautz::kautz;
263pub use crate::algorithms::constructors::lcf::lcf;
264pub use crate::algorithms::constructors::linegraph::linegraph;
265pub use crate::algorithms::constructors::mycielskian::{mycielski_graph, mycielskian};
266pub use crate::algorithms::constructors::prufer::{from_prufer, to_prufer};
267pub use crate::algorithms::constructors::realize_bipartite_degree_sequence::realize_bipartite_degree_sequence;
268pub use crate::algorithms::constructors::realize_degree_sequence::{
269    RealizeDegseqMethod, realize_degree_sequence,
270};
271pub use crate::algorithms::constructors::realize_directed_degree_sequence::realize_directed_degree_sequence;
272pub use crate::algorithms::constructors::regular_tree::regular_tree;
273pub use crate::algorithms::constructors::ring::{cycle_graph, path_graph, ring_graph};
274pub use crate::algorithms::constructors::square_lattice::square_lattice;
275pub use crate::algorithms::constructors::star::{StarMode, star_graph};
276pub use crate::algorithms::constructors::symmetric_tree::symmetric_tree;
277pub use crate::algorithms::constructors::tree_from_parent_vector::tree_from_parent_vector;
278pub use crate::algorithms::constructors::triangular_lattice::triangular_lattice;
279pub use crate::algorithms::constructors::turan::turan;
280pub use crate::algorithms::constructors::weighted_adjacency::weighted_adjacency;
281pub use crate::algorithms::constructors::weighted_biadjacency::{
282    WeightedBiadjacencyResult, weighted_biadjacency,
283};
284pub use crate::algorithms::constructors::wheel::{WheelMode, wheel_graph};
285pub use crate::algorithms::cycles::{CycleMode, CycleResult, find_cycle};
286pub use crate::algorithms::dominating_set::{is_dominating_set, minimum_dominating_set};
287pub use crate::algorithms::edge_cover::{is_edge_cover, minimum_edge_cover};
288pub use crate::algorithms::eigen::adjacency::eigen_adjacency;
289pub use crate::algorithms::eigen::general::{
290    GeneralEigenDecomposition, GeneralEigenWhich, eigen_matrix,
291};
292pub use crate::algorithms::eigen::symmetric::{
293    EigenDecomposition, EigenWhich, eigen_matrix_symmetric,
294};
295pub use crate::algorithms::embedding::adjacency_spectral_embedding::{
296    AdjacencySpectralEmbeddingResult, SpectralWhich, adjacency_spectral_embedding,
297};
298pub use crate::algorithms::embedding::dim_select::dim_select;
299pub use crate::algorithms::embedding::laplacian_spectral_embedding::{
300    LaplacianSpectralEmbeddingResult, LaplacianType, laplacian_spectral_embedding,
301};
302pub use crate::algorithms::epidemics::{Sir, sir};
303pub use crate::algorithms::feedback_arc_set::{FasAlgorithm, feedback_arc_set};
304pub use crate::algorithms::feedback_vertex_set::{FvsAlgorithm, feedback_vertex_set};
305pub use crate::algorithms::flow::all_st_cuts::{StCuts, all_st_cuts};
306pub use crate::algorithms::flow::all_st_mincuts::{StMinCuts, all_st_mincuts};
307pub use crate::algorithms::flow::dominator_tree::{DominatorMode, DominatorTree, dominator_tree};
308pub use crate::algorithms::flow::edge_connectivity::{adhesion, edge_connectivity};
309pub use crate::algorithms::flow::edge_disjoint_paths::edge_disjoint_paths;
310pub use crate::algorithms::flow::gomory_hu_tree::{GomoryHuTree, gomory_hu_tree};
311pub use crate::algorithms::flow::max_flow::{MaxFlow, max_flow, max_flow_value};
312pub use crate::algorithms::flow::mincut::{Mincut, mincut};
313pub use crate::algorithms::flow::mincut_value::mincut_value;
314pub use crate::algorithms::flow::st_edge_connectivity::st_edge_connectivity;
315pub use crate::algorithms::flow::st_mincut::{StMincut, st_mincut, st_mincut_value};
316pub use crate::algorithms::flow::st_vertex_connectivity::{VconnNei, st_vertex_connectivity};
317pub use crate::algorithms::flow::vertex_connectivity::{cohesion, vertex_connectivity};
318pub use crate::algorithms::flow::vertex_disjoint_paths::vertex_disjoint_paths;
319pub use crate::algorithms::fundamental_cycles::fundamental_cycles;
320pub use crate::algorithms::games::barabasi::barabasi_game_bag;
321pub use crate::algorithms::games::barabasi_aging::barabasi_aging_game;
322pub use crate::algorithms::games::barabasi_psumtree::{
323    barabasi_game_psumtree, barabasi_game_psumtree_multiple,
324};
325pub use crate::algorithms::games::bipartite::{
326    BipartiteGraph, BipartiteMode, bipartite_game_gnm, bipartite_game_gnp, bipartite_iea_game,
327};
328pub use crate::algorithms::games::callaway_traits::callaway_traits_game;
329pub use crate::algorithms::games::chung_lu::{ChungLuVariant, chung_lu_game};
330pub use crate::algorithms::games::cited_type::cited_type_game;
331pub use crate::algorithms::games::citing_cited_type::citing_cited_type_game;
332pub use crate::algorithms::games::correlated::{correlated_game, correlated_pair_game};
333pub use crate::algorithms::games::degree_sequence::degree_sequence_game_configuration;
334pub use crate::algorithms::games::degree_sequence_configuration_simple::degree_sequence_game_configuration_simple;
335pub use crate::algorithms::games::degree_sequence_fast_heur::degree_sequence_game_fast_heur_simple;
336pub use crate::algorithms::games::degree_sequence_vl::degree_sequence_game_vl;
337pub use crate::algorithms::games::dotproduct::{
338    DotProductWarnings, dot_product_game, dot_product_game_with_warnings,
339};
340pub use crate::algorithms::games::edge_switching_simple::degree_sequence_game_edge_switching_simple;
341pub use crate::algorithms::games::erdos_renyi::{erdos_renyi_gnm, erdos_renyi_gnp};
342pub use crate::algorithms::games::establishment::establishment_game;
343pub use crate::algorithms::games::forestfire::forest_fire_game;
344pub use crate::algorithms::games::grg::{grg_game, grg_game_with_coords};
345pub use crate::algorithms::games::growing_random::growing_random_game;
346pub use crate::algorithms::games::hsbm::{hsbm_game, hsbm_list_game};
347pub use crate::algorithms::games::iea_game::iea_game;
348pub use crate::algorithms::games::islands::simple_interconnected_islands_game;
349pub use crate::algorithms::games::k_regular::k_regular_game;
350pub use crate::algorithms::games::lastcit::lastcit_game;
351pub use crate::algorithms::games::preference::{asymmetric_preference_game, preference_game};
352pub use crate::algorithms::games::recent_degree::recent_degree_game;
353pub use crate::algorithms::games::recent_degree_aging::recent_degree_aging_game;
354pub use crate::algorithms::games::sbm::sbm_game;
355pub use crate::algorithms::games::static_fitness::{static_fitness_game, static_power_law_game};
356pub use crate::algorithms::games::tree::{tree_game_lerw, tree_game_prufer};
357pub use crate::algorithms::games::watts::watts_strogatz_game;
358pub use crate::algorithms::graphlets::{
359    GraphletBasis, GraphletDecomposition, graphlets, graphlets_candidate_basis, graphlets_project,
360};
361pub use crate::algorithms::hrg::{
362    HrgDendrogram, HrgTree, from_hrg_dendrogram, hrg_consensus, hrg_create, hrg_fit, hrg_game,
363    hrg_predict, hrg_sample, hrg_sample_many,
364};
365pub use crate::algorithms::independent_set::maximum_independent_set;
366pub use crate::algorithms::io::dimacs::{
367    DimacsGraph, DimacsProblem, read_dimacs, write_dimacs_flow,
368};
369pub use crate::algorithms::io::dl::{DlGraph, read_dl, write_dl};
370pub use crate::algorithms::io::dot::{DotGraph, read_dot, write_dot};
371pub use crate::algorithms::io::edgelist::{read_edgelist, write_edgelist};
372pub use crate::algorithms::io::gml::{read_gml, write_gml};
373pub use crate::algorithms::io::graphdb::read_graphdb;
374pub use crate::algorithms::io::graphml::{GraphmlGraph, read_graphml, write_graphml};
375pub use crate::algorithms::io::leda::{LedaGraph, read_leda, write_leda};
376pub use crate::algorithms::io::lgl::{LglGraph, read_lgl, write_lgl};
377pub use crate::algorithms::io::ncol::{NcolGraph, read_ncol, write_ncol};
378pub use crate::algorithms::io::pajek::{PajekGraph, read_pajek, write_pajek};
379pub use crate::algorithms::isomorphism::canonical::automorphism_group::automorphism_group;
380pub use crate::algorithms::isomorphism::canonical::canonical_permutation::canonical_permutation;
381pub use crate::algorithms::isomorphism::canonical::count_automorphisms::count_automorphisms;
382pub use crate::algorithms::isomorphism::canonical::isomorphic_bliss::isomorphic_bliss;
383pub use crate::algorithms::isomorphism::lad::{
384    LadSubisomorphism, get_subisomorphisms_lad, subisomorphic_lad,
385};
386pub use crate::algorithms::isomorphism::queries::{isomorphic, subisomorphic};
387pub use crate::algorithms::isomorphism::simplify_and_colorize::{
388    SimplifyAndColorize, simplify_and_colorize,
389};
390pub use crate::algorithms::isomorphism::subiso::{
391    Vf2Subisomorphism, count_subisomorphisms_vf2, get_subisomorphisms_vf2, subisomorphic_vf2,
392};
393pub use crate::algorithms::isomorphism::vf2::{
394    Vf2Isomorphism, count_isomorphisms_vf2, get_isomorphisms_vf2, isomorphic_vf2,
395};
396pub use crate::algorithms::layout::align::layout_align;
397pub use crate::algorithms::layout::bipartite::layout_bipartite;
398pub use crate::algorithms::layout::davidson_harel::{DhParams, layout_davidson_harel};
399pub use crate::algorithms::layout::drl::{DrlOptions, DrlTemplate, layout_drl, layout_drl_3d};
400pub use crate::algorithms::layout::fruchterman_reingold::{
401    FrBounds, FrBounds3d, FrGrid, FrParams, FrParams3d, layout_fruchterman_reingold,
402    layout_fruchterman_reingold_3d,
403};
404pub use crate::algorithms::layout::gem::{GemParams, layout_gem};
405pub use crate::algorithms::layout::graphopt::{GraphoptParams, layout_graphopt};
406pub use crate::algorithms::layout::kamada_kawai::{
407    KkBounds, KkBounds3d, KkParams, KkParams3d, layout_kamada_kawai, layout_kamada_kawai_3d,
408};
409pub use crate::algorithms::layout::lgl::{LglParams, layout_lgl};
410pub use crate::algorithms::layout::mds::layout_mds;
411pub use crate::algorithms::layout::merge_dla::layout_merge_dla;
412pub use crate::algorithms::layout::reingold_tilford::{
413    RootChoice, RtMode, layout_reingold_tilford, layout_reingold_tilford_circular,
414    roots_for_tree_layout,
415};
416pub use crate::algorithms::layout::simple::{
417    layout_circle, layout_grid, layout_grid_3d, layout_random, layout_random_3d, layout_sphere,
418    layout_star,
419};
420pub use crate::algorithms::layout::sugiyama::{SugiyamaParams, SugiyamaResult, layout_sugiyama};
421pub use crate::algorithms::layout::umap::{
422    UmapParams, layout_umap, layout_umap_3d, umap_compute_weights,
423};
424pub use crate::algorithms::matching::{
425    MatchingResult, is_matching, is_maximal_matching, maximum_bipartite_matching,
426    maximum_bipartite_matching_weighted,
427};
428pub use crate::algorithms::matching_lsap::solve_lsap;
429pub use crate::algorithms::max_cut::{MaxCutResult, cut_value, maximum_cut};
430pub use crate::algorithms::minimum_cycle_basis::minimum_cycle_basis;
431pub use crate::algorithms::motifs::{
432    DyadCensus, TriadCensus, TriadType, dyad_census, graph_count, isoclass, isoclass_create,
433    isoclass_subgraph, motifs_randesu, motifs_randesu_callback, motifs_randesu_estimate,
434    motifs_randesu_no, triad_census,
435};
436pub use crate::algorithms::nongraph::random_sample::random_sample;
437pub use crate::algorithms::nongraph::sampling::{
438    sample_dirichlet, sample_sphere_surface, sample_sphere_volume,
439};
440pub use crate::algorithms::operators::bipartite_projection::{
441    BipartiteProjection, bipartite_projection,
442};
443pub use crate::algorithms::operators::bipartite_projection_size::{
444    BipartiteProjectionSize, bipartite_projection_size,
445};
446pub use crate::algorithms::operators::complementer::complementer;
447pub use crate::algorithms::operators::compose::compose;
448pub use crate::algorithms::operators::connect_neighborhood::{connect_neighborhood, graph_power};
449pub use crate::algorithms::operators::contract_vertices::contract_vertices;
450pub use crate::algorithms::operators::difference::difference;
451pub use crate::algorithms::operators::disjoint_union::{disjoint_union, disjoint_union_many};
452pub use crate::algorithms::operators::even_tarjan::{EvenTarjanResult, even_tarjan_reduction};
453pub use crate::algorithms::operators::induced_subgraph::{InducedSubgraphResult, induced_subgraph};
454pub use crate::algorithms::operators::induced_subgraph_edges::induced_subgraph_edges;
455pub use crate::algorithms::operators::intersection::{intersection, intersection_many};
456pub use crate::algorithms::operators::is_same_graph::is_same_graph;
457pub use crate::algorithms::operators::join::join;
458pub use crate::algorithms::operators::line_graph::line_graph;
459pub use crate::algorithms::operators::permute_vertices::{invert_permutation, permute_vertices};
460pub use crate::algorithms::operators::products::{
461    GraphProductType, cartesian_product, graph_product, lexicographic_product, modular_product,
462    rooted_product, strong_product, tensor_product,
463};
464pub use crate::algorithms::operators::residual_graph::{
465    ResidualGraphResult, residual_graph, reverse_residual_graph,
466};
467pub use crate::algorithms::operators::reverse::{reverse, reverse_edges};
468pub use crate::algorithms::operators::rewire::rewire;
469pub use crate::algorithms::operators::rewire_edges::{
470    RewireDirectedMode, rewire_directed_edges, rewire_edges,
471};
472pub use crate::algorithms::operators::simplify::simplify;
473pub use crate::algorithms::operators::subgraph_from_edges::{
474    SubgraphFromEdgesResult, subgraph_from_edges,
475};
476pub use crate::algorithms::operators::to_directed::{ToDirectedMode, to_directed};
477pub use crate::algorithms::operators::to_undirected::{ToUndirectedMode, to_undirected};
478pub use crate::algorithms::operators::union::{union, union_many};
479pub use crate::algorithms::paths::all_shortest_paths::{
480    AllShortestPaths, AllShortestPathsMode, get_all_shortest_paths,
481    get_all_shortest_paths_with_mode,
482};
483pub use crate::algorithms::paths::astar::a_star_path;
484pub use crate::algorithms::paths::bellman_ford::{
485    BellmanFordPathEntry, bellman_ford_distances, bellman_ford_distances_with_mode,
486    bellman_ford_path_to, bellman_ford_path_to_with_mode, bellman_ford_paths,
487    bellman_ford_paths_with_mode,
488};
489pub use crate::algorithms::paths::dijkstra::{
490    DijkstraAllPaths, DijkstraMode, DijkstraPaths, dijkstra_all_shortest_paths, dijkstra_distances,
491    dijkstra_distances_cutoff, dijkstra_distances_cutoff_with_mode, dijkstra_distances_multi,
492    dijkstra_distances_multi_with_mode, dijkstra_distances_with_mode, dijkstra_path_to,
493    dijkstra_path_to_with_mode, dijkstra_paths, dijkstra_paths_with_mode,
494};
495pub use crate::algorithms::paths::distances::distances;
496pub use crate::algorithms::paths::distances_all::{
497    DistancesMode, distances_all, distances_all_with_mode,
498};
499pub use crate::algorithms::paths::distances_cutoff::{
500    DistancesCutoffMode, distances_cutoff, distances_cutoff_multi, distances_cutoff_with_mode,
501};
502pub use crate::algorithms::paths::distances_from::{
503    DistancesFromMode, distances_from, distances_from_with_mode,
504};
505pub use crate::algorithms::paths::edge_path_to_vertex_path::{
506    WalkMode, vertex_path_from_edge_path,
507};
508pub use crate::algorithms::paths::eulerian::{EulerianClassification, is_eulerian};
509pub use crate::algorithms::paths::eulerian_construct::{eulerian_cycle, eulerian_path};
510pub use crate::algorithms::paths::floyd_warshall::floyd_warshall_distances;
511pub use crate::algorithms::paths::get_all_shortest_paths_dijkstra::{
512    AllShortestPathsDijkstra, get_all_shortest_paths_dijkstra,
513    get_all_shortest_paths_dijkstra_with_mode,
514};
515pub use crate::algorithms::paths::get_shortest_path::{ShortestPath, get_shortest_path};
516pub use crate::algorithms::paths::get_shortest_path_astar::{
517    AstarHeuristic, get_shortest_path_astar,
518};
519pub use crate::algorithms::paths::get_shortest_paths_dijkstra::{
520    ShortestPathsDijkstra, get_shortest_paths_dijkstra, get_shortest_paths_dijkstra_with_mode,
521};
522pub use crate::algorithms::paths::graph_center::{
523    PseudoDiameterResult, graph_center, pseudo_diameter,
524};
525pub use crate::algorithms::paths::histogram::{PathLengthHistResult, path_length_hist};
526pub use crate::algorithms::paths::johnson::johnson_distances;
527pub use crate::algorithms::paths::k_shortest_paths::{KShortestPath, k_shortest_paths};
528pub use crate::algorithms::paths::radii::{
529    EccMode, diameter, diameter_weighted, diameter_weighted_with_mode, diameter_with_mode,
530    eccentricity, eccentricity_weighted, eccentricity_weighted_with_mode, eccentricity_with_mode,
531    radius, radius_weighted, radius_weighted_with_mode, radius_with_mode,
532};
533pub use crate::algorithms::paths::random_walk::random_walk;
534pub use crate::algorithms::paths::shortest_paths::{
535    ShortestPathMode, get_shortest_paths, get_shortest_paths_with_mode,
536};
537pub use crate::algorithms::paths::simple_paths::{SimplePathMode, all_simple_paths};
538pub use crate::algorithms::paths::spanner::spanner;
539pub use crate::algorithms::paths::voronoi::{VoronoiPartition, VoronoiTiebreaker, voronoi};
540pub use crate::algorithms::paths::widest_path::{
541    WidestPathResult, WidestPaths, widest_path, widest_path_widths,
542    widest_path_widths_floyd_warshall, widest_path_widths_floyd_warshall_with_mode,
543    widest_path_widths_with_mode, widest_path_with_mode, widest_paths, widest_paths_to,
544    widest_paths_to_with_mode, widest_paths_with_mode,
545};
546pub use crate::algorithms::properties::adjacency::{AdjacencyType, LoopHandling, get_adjacency};
547pub use crate::algorithms::properties::are_adjacent::are_adjacent;
548pub use crate::algorithms::properties::assortativity::{
549    assortativity_degree, assortativity_degree_directed,
550};
551pub use crate::algorithms::properties::assortativity_nominal::assortativity_nominal;
552pub use crate::algorithms::properties::assortativity_values::assortativity;
553pub use crate::algorithms::properties::assortativity_weighted::{
554    assortativity_degree_directed_weighted, assortativity_degree_weighted,
555};
556pub use crate::algorithms::properties::basic::{density, mean_degree, mean_distance};
557pub use crate::algorithms::properties::betweenness::betweenness;
558pub use crate::algorithms::properties::betweenness_cutoff::betweenness_cutoff;
559pub use crate::algorithms::properties::betweenness_subset::betweenness_subset;
560pub use crate::algorithms::properties::betweenness_weighted::betweenness_weighted;
561pub use crate::algorithms::properties::centralization::{
562    CentralizationMode, CentralizationResult, LoopMode, centralization,
563    centralization_betweenness_tmax, centralization_betweenness_wrapper,
564    centralization_closeness_tmax, centralization_closeness_wrapper, centralization_degree_tmax,
565    centralization_degree_wrapper, centralization_eigenvector_tmax,
566    centralization_eigenvector_wrapper,
567};
568pub use crate::algorithms::properties::closeness::closeness;
569pub use crate::algorithms::properties::closeness_cutoff::{
570    ClosenessCutoffResult, closeness_cutoff,
571};
572pub use crate::algorithms::properties::closeness_weighted::closeness_weighted;
573pub use crate::algorithms::properties::constraint::constraint;
574pub use crate::algorithms::properties::convergence_degree::{
575    convergence_degree, convergence_degree_full,
576};
577pub use crate::algorithms::properties::coreness::{CorenessMode, coreness, coreness_with_mode};
578pub use crate::algorithms::properties::degree::{
579    DegreeMode, degree_sequence, max_degree, max_degree_vertex, min_degree,
580};
581pub use crate::algorithms::properties::degree_correlation::degree_correlation_vector;
582pub use crate::algorithms::properties::degree_distribution::degree_distribution;
583pub use crate::algorithms::properties::ecc::ecc;
584pub use crate::algorithms::properties::edge_betweenness::edge_betweenness;
585pub use crate::algorithms::properties::edge_betweenness_cutoff::edge_betweenness_cutoff;
586pub use crate::algorithms::properties::edge_betweenness_subset::edge_betweenness_subset;
587pub use crate::algorithms::properties::edge_betweenness_weighted::edge_betweenness_weighted;
588pub use crate::algorithms::properties::edgelist::get_edgelist;
589pub use crate::algorithms::properties::efficiency::{
590    average_local_efficiency, global_efficiency, local_efficiency,
591};
592pub use crate::algorithms::properties::eigenvector::{
593    EigenvectorMode, EigenvectorScores, eigenvector_centrality, eigenvector_centrality_directed,
594    eigenvector_centrality_directed_weighted, eigenvector_centrality_full,
595    eigenvector_centrality_weighted,
596};
597pub use crate::algorithms::properties::get_biadjacency::{
598    GetBiadjacencyResult, get_biadjacency_matrix,
599};
600pub use crate::algorithms::properties::get_biadjacency_weighted::{
601    GetBiadjacencyWeightedResult, get_biadjacency_weighted,
602};
603pub use crate::algorithms::properties::get_eids::get_eids;
604pub use crate::algorithms::properties::girth::girth;
605pub use crate::algorithms::properties::graphicality::{
606    EdgeTypeFilter, is_bigraphical, is_graphical,
607};
608pub use crate::algorithms::properties::harmonic::harmonic_centrality;
609pub use crate::algorithms::properties::harmonic_cutoff::harmonic_centrality_cutoff;
610pub use crate::algorithms::properties::harmonic_weighted::harmonic_centrality_weighted;
611pub use crate::algorithms::properties::hits::{
612    HitsScores, hub_and_authority_scores, hub_and_authority_scores_weighted,
613};
614pub use crate::algorithms::properties::is_acyclic::is_acyclic;
615pub use crate::algorithms::properties::is_apex_forest::is_apex_forest;
616pub use crate::algorithms::properties::is_apex_tree::is_apex_tree;
617pub use crate::algorithms::properties::is_banner_free::is_banner_free;
618pub use crate::algorithms::properties::is_biclique::is_biclique;
619pub use crate::algorithms::properties::is_bipartite::{BipartiteResult, is_bipartite};
620pub use crate::algorithms::properties::is_biregular::is_biregular;
621pub use crate::algorithms::properties::is_block::is_block_graph;
622pub use crate::algorithms::properties::is_bowtie_free::is_bowtie_free;
623pub use crate::algorithms::properties::is_bull_free::is_bull_free;
624pub use crate::algorithms::properties::is_c4_free::is_c4_free;
625pub use crate::algorithms::properties::is_c5_free::is_c5_free;
626pub use crate::algorithms::properties::is_cactus::is_cactus_graph;
627pub use crate::algorithms::properties::is_caterpillar::is_caterpillar;
628pub use crate::algorithms::properties::is_chain_graph::is_chain_graph;
629pub use crate::algorithms::properties::is_chordal_bipartite::is_chordal_bipartite;
630pub use crate::algorithms::properties::is_claw_free::is_claw_free;
631pub use crate::algorithms::properties::is_clique::{is_clique, is_independent_vertex_set};
632pub use crate::algorithms::properties::is_cluster::is_cluster_graph;
633pub use crate::algorithms::properties::is_co_bipartite::is_co_bipartite;
634pub use crate::algorithms::properties::is_co_chordal::is_co_chordal;
635pub use crate::algorithms::properties::is_cograph::is_cograph;
636pub use crate::algorithms::properties::is_complete::is_complete;
637pub use crate::algorithms::properties::is_complete_bipartite::is_complete_bipartite;
638pub use crate::algorithms::properties::is_complete_multipartite::is_complete_multipartite;
639pub use crate::algorithms::properties::is_cricket_free::is_cricket_free;
640pub use crate::algorithms::properties::is_cubic::is_cubic;
641pub use crate::algorithms::properties::is_cycle::is_cycle;
642pub use crate::algorithms::properties::is_dag::is_dag;
643pub use crate::algorithms::properties::is_dart_free::is_dart_free;
644pub use crate::algorithms::properties::is_diamond_free::is_diamond_free;
645pub use crate::algorithms::properties::is_distance_hereditary::is_distance_hereditary;
646pub use crate::algorithms::properties::is_forest::is_forest;
647pub use crate::algorithms::properties::is_fork_free::is_fork_free;
648pub use crate::algorithms::properties::is_gem_free::is_gem_free;
649pub use crate::algorithms::properties::is_geodetic::is_geodetic;
650pub use crate::algorithms::properties::is_house_free::is_house_free;
651pub use crate::algorithms::properties::is_k_degenerate::{degeneracy, is_k_degenerate};
652pub use crate::algorithms::properties::is_lobster::is_lobster;
653pub use crate::algorithms::properties::is_net_free::is_net_free;
654pub use crate::algorithms::properties::is_outerplanar::is_outerplanar;
655pub use crate::algorithms::properties::is_p5_free::is_p5_free;
656pub use crate::algorithms::properties::is_path::is_path;
657pub use crate::algorithms::properties::is_paw_free::is_paw_free;
658pub use crate::algorithms::properties::is_planar::is_planar;
659pub use crate::algorithms::properties::is_proper_interval::is_proper_interval;
660pub use crate::algorithms::properties::is_pseudo_forest::is_pseudo_forest;
661pub use crate::algorithms::properties::is_ptolemaic::is_ptolemaic;
662pub use crate::algorithms::properties::is_regular::{is_regular, regularity};
663pub use crate::algorithms::properties::is_self_complementary::is_self_complementary;
664pub use crate::algorithms::properties::is_semicomplete::is_semicomplete;
665pub use crate::algorithms::properties::is_series_parallel::is_series_parallel;
666pub use crate::algorithms::properties::is_simple::{SimpleMode, is_simple, is_simple_with_mode};
667pub use crate::algorithms::properties::is_spider::is_spider;
668pub use crate::algorithms::properties::is_split::is_split_graph;
669pub use crate::algorithms::properties::is_star::is_star;
670pub use crate::algorithms::properties::is_strongly_chordal::is_strongly_chordal;
671pub use crate::algorithms::properties::is_strongly_regular::{
672    StronglyRegularParams, is_strongly_regular,
673};
674pub use crate::algorithms::properties::is_threshold::is_threshold_graph;
675pub use crate::algorithms::properties::is_tournament::is_tournament;
676pub use crate::algorithms::properties::is_tree::is_tree;
677pub use crate::algorithms::properties::is_triangle_free::is_triangle_free;
678pub use crate::algorithms::properties::is_trivially_perfect::is_trivially_perfect;
679pub use crate::algorithms::properties::is_unicyclic::is_unicyclic;
680pub use crate::algorithms::properties::is_weakly_chordal::is_weakly_chordal;
681pub use crate::algorithms::properties::is_well_covered::is_well_covered;
682pub use crate::algorithms::properties::is_wheel::is_wheel;
683pub use crate::algorithms::properties::is_windmill::is_windmill;
684pub use crate::algorithms::properties::joint_degree_distribution::joint_degree_distribution;
685pub use crate::algorithms::properties::joint_degree_matrix::joint_degree_matrix;
686pub use crate::algorithms::properties::joint_type_distribution::joint_type_distribution;
687pub use crate::algorithms::properties::katz_centrality::katz_centrality;
688pub use crate::algorithms::properties::knn::{
689    avg_nearest_neighbor_degree, avg_nearest_neighbor_degree_weighted, knnk, knnk_weighted,
690};
691pub use crate::algorithms::properties::laplacian::{LaplacianNormalization, get_laplacian};
692pub use crate::algorithms::properties::list_triangles::list_triangles;
693pub use crate::algorithms::properties::local_scan::{
694    local_scan_0, local_scan_0_them, local_scan_1, local_scan_1_ecount, local_scan_1_ecount_them,
695    local_scan_subset_ecount,
696};
697pub use crate::algorithms::properties::local_scan_k::{
698    local_scan_k, local_scan_k_ecount, local_scan_k_ecount_them,
699};
700pub use crate::algorithms::properties::mean_distance_weighted::mean_distance_weighted;
701pub use crate::algorithms::properties::multiplicity::{
702    count_loops, count_multiple, count_multiple_1, has_loop, has_multiple, is_loop, is_multiple,
703};
704pub use crate::algorithms::properties::mutual::{count_mutual, has_mutual, is_mutual};
705pub use crate::algorithms::properties::neighborhood::{
706    NeighborhoodMode, neighborhood, neighborhood_graphs, neighborhood_graphs_with_mode,
707    neighborhood_size, neighborhood_size_with_mode, neighborhood_with_mode,
708};
709pub use crate::algorithms::properties::pagerank::pagerank;
710pub use crate::algorithms::properties::pagerank_linsys::pagerank_linsys;
711pub use crate::algorithms::properties::pagerank_weighted::pagerank_weighted;
712pub use crate::algorithms::properties::perfect::is_perfect;
713pub use crate::algorithms::properties::personalized_pagerank::{
714    personalized_pagerank, personalized_pagerank_default, personalized_pagerank_vs,
715};
716pub use crate::algorithms::properties::power_law_fit::{PowerLawFitResult, power_law_fit};
717pub use crate::algorithms::properties::reciprocity::{
718    ReciprocityMode, reciprocity, reciprocity_with_mode,
719};
720pub use crate::algorithms::properties::rich_club::rich_club_sequence;
721pub use crate::algorithms::properties::running_mean::{expand_path_to_pairs, running_mean};
722pub use crate::algorithms::properties::satisfies_dirac::satisfies_dirac;
723pub use crate::algorithms::properties::satisfies_ore::satisfies_ore;
724pub use crate::algorithms::properties::similarity::{
725    bibcoupling, cocitation, similarity_dice, similarity_dice_es, similarity_dice_pairs,
726    similarity_inverse_log_weighted, similarity_inverse_log_weighted_pairs, similarity_jaccard,
727    similarity_jaccard_es, similarity_jaccard_pairs,
728};
729pub use crate::algorithms::properties::sort_by_degree::{SortOrder, sort_vertices_by_degree};
730pub use crate::algorithms::properties::stochastic::get_stochastic;
731pub use crate::algorithms::properties::strength::{
732    StrengthMode, diversity, strength, strength_with_mode,
733};
734pub use crate::algorithms::properties::summary::{
735    GraphSummary, graph_summary, graph_summary_string,
736};
737pub use crate::algorithms::properties::topological_sorting::topological_sorting;
738pub use crate::algorithms::properties::triangles::{
739    TransitivityMode, count_adjacent_triangles, count_triangles, transitivity_avglocal_undirected,
740    transitivity_barrat, transitivity_local_undirected, transitivity_undirected,
741};
742pub use crate::algorithms::properties::trussness::trussness;
743pub use crate::algorithms::properties::unfold_tree::{UnfoldTreeResult, unfold_tree};
744pub use crate::algorithms::simple_cycles::{SimpleCycle, SimpleCycleMode, simple_cycles};
745pub use crate::algorithms::spanning::mst::{MstAlgorithm, minimum_spanning_tree};
746pub use crate::algorithms::spanning::random_spanning_tree::random_spanning_tree;
747pub use crate::algorithms::spatial::beta_weighted_gabriel_graph::{
748    BetaWeightedGabriel, beta_weighted_gabriel_graph,
749};
750pub use crate::algorithms::spatial::circle_beta_skeleton::circle_beta_skeleton;
751pub use crate::algorithms::spatial::convex_hull::{ConvexHullResult, convex_hull_2d};
752pub use crate::algorithms::spatial::delaunay::delaunay_graph;
753pub use crate::algorithms::spatial::edge_lengths::{DistanceMetric, spatial_edge_lengths};
754pub use crate::algorithms::spatial::gabriel_graph::gabriel_graph;
755pub use crate::algorithms::spatial::lune_beta_skeleton::lune_beta_skeleton;
756pub use crate::algorithms::spatial::nearest_neighbor_graph::nearest_neighbor_graph;
757pub use crate::algorithms::spatial::relative_neighborhood_graph::relative_neighborhood_graph;
758pub use crate::algorithms::traversal::bfs::{
759    BfsMode, BfsSimple, BfsTree, bfs, bfs_simple, bfs_tree,
760};
761pub use crate::algorithms::traversal::dfs::{
762    DfsMode, DfsSimple, DfsTree, dfs, dfs_simple, dfs_tree,
763};
764pub use crate::algorithms::vertex_cover::{is_vertex_cover, minimum_vertex_cover};
765pub use crate::core::attributes::AttributeValue;
766pub use crate::core::builder::GraphBuilder;
767pub use crate::core::cache::CachedProperty;
768pub use crate::core::error::{IgraphError, IgraphResult};
769pub use crate::core::graph::{EdgeIter, Graph, NeighborsIter, VertexId};