Expand description
Auto-generated module
🤖 Generated with SplitRS
Functions§
- adjacency_
matrix - Returns adjacency matrix as a flat
nĂ—nVecf64. - astar
- A* shortest path from
starttogoalwith a heuristich(node) -> f64. - average_
clustering - Average clustering coefficient across all nodes.
- bellman_
ford - Bellman-Ford shortest-path algorithm from
start. - betweenness_
centrality - Computes approximate betweenness centrality using Dijkstra for each source.
- bfs
- Returns nodes visited in BFS order starting from
start. - bfs_
distances - BFS distances from
start(unweighted).usize::MAX= unreachable. - bipartite_
coloring - Returns the 2-colouring as
Some(colors)if bipartite,Noneotherwise. - bipartite_
matching - Augmenting-path maximum bipartite matching.
- chromatic_
number_ upper_ bound - Returns the number of colours used by a colouring vector.
- closeness_
centrality - Computes closeness centrality for every node.
- connected_
components - Returns the connected components of the graph (treating all edges as undirected).
- contact_
graph_ from_ overlaps - Creates a contact graph from a list of overlapping body pairs.
- count_
back_ edges - Counts directed cycles (simple) in the graph using DFS coloring.
- degree_
centrality - Degree centrality: returns
degree(v) / (n-1)for each node. - dfs
- Returns nodes visited in DFS order starting from
start(iterative). - dijkstra
- Dijkstra’s shortest-path algorithm from
start. - dijkstra_
with_ path - Dijkstra with both distances and predecessor array.
- distance_
matrix_ to_ graph - Convert a distance matrix to a sparse graph (threshold edges).
- floyd_
warshall - Floyd-Warshall all-pairs shortest paths.
- graph_
density - Graph density:
|E| / (|V| * (|V| - 1))for directed graphs. - graph_
diameter_ bfs - Returns the diameter of the graph: the longest shortest path.
- greedy_
coloring - Greedy graph colouring.
- has_
eulerian_ circuit - Returns
trueif the (undirected) graph has an Eulerian circuit. - has_
eulerian_ path - Returns
trueif the (undirected) graph has an Eulerian path (but not a circuit). - is_
bipartite - Returns
trueif the undirected graph (edges treated as undirected) is bipartite. - is_
connected - Returns
trueif the graph is connected (treating all edges as undirected). - is_dag
- Returns
trueif the directed graph is a DAG (no directed cycles). - island_
count - Returns the number of connected components (physics “islands”).
- kahn_
topological_ sort - Kahn’s algorithm for topological sorting (BFS / in-degree approach).
- kosaraju_
scc - Kosaraju’s algorithm for strongly connected components (SCCs).
- kruskal_
mst - Kruskal’s MST algorithm for an undirected graph.
- laplacian_
matrix - Computes the graph Laplacian matrix
L = D - Afor an undirected graph. - local_
clustering - Local clustering coefficient for node
u(undirected interpretation). - max_
flow_ edmonds_ karp - Edmonds-Karp max-flow algorithm (BFS augmenting paths).
- mst_
total_ weight - Returns the total weight of an MST (or any edge list).
- path_
reconstruct - Reconstructs the path to
endfrom aprevarray produced by a shortest-path algorithm. - prim_
mst - Prim’s minimum spanning tree algorithm.
- tarjan_
scc - Tarjan’s algorithm for strongly connected components.
- topological_
sort - Topological sort using Kahn’s algorithm.