Expand description
Graph algorithms.
It is a goal to gradually migrate the algorithms to be based on graph traits
so that they are generally applicable. For now, some of these still require
the Graph
type.
Modules§
- articulation_
points - astar
- bellman_
ford - Bellman-Ford algorithms.
- bridges
- coloring
- dijkstra
- dominators
- Compute dominators of a control-flow graph.
- feedback_
arc_ set - floyd_
warshall - ford_
fulkerson - isomorphism
- johnson
- Johnson’s algorithm implementation.
- k_
shortest_ path - matching
- maximal_
cliques - min_
spanning_ tree - Minimum Spanning Tree algorithms.
- page_
rank - simple_
paths - spfa
- Shortest Path Faster Algorithm.
- tred
- Compute the transitive reduction and closure of a directed acyclic graph
Structs§
- Cycle
- An algorithm error: a cycle was found in the graph.
- DfsSpace
- Workspace for a graph traversal.
- Matching
- Computed matching of the graph.
- Negative
Cycle - An algorithm error: a cycle of negative weights was found in the graph.
- Tarjan
Scc - A reusable state for computing the strongly connected components using Tarjan’s algorithm.
Traits§
- Bounded
Measure - Float
Measure - A floating-point measure.
- Measure
- Associated data that can be used for measures (such as length).
- Positive
Measure - Some measure of positive numbers, assuming positive float-pointing numbers
- Unit
Measure - A floating-point measure that can be computed from
usize
and with a default measure of proximity.
Functions§
- all_
simple_ paths - Calculate all simple paths with specified constraints from node
from
to nodeto
. - astar
- [Generic] A* shortest path algorithm.
- bellman_
ford - [Generic] Compute shortest paths from node
source
to all other. - bridges
- Find all bridges in a simple undirected graph.
- condensation
- Graph Condense every strongly connected component into a single node and return the result.
- connected_
components - [Generic] Return the number of connected components of the graph.
- dijkstra
- [Generic] Dijkstra’s shortest path algorithm.
- dsatur_
coloring - [Generic] DStatur algorithm to properly color a non weighted undirected graph.
- find_
negative_ cycle - [Generic] Find the path of a negative cycle reachable from node
source
. - floyd_
warshall - [Generic] Floyd–Warshall algorithm is an algorithm for all pairs shortest path problem
- ford_
fulkerson - [Generic] Ford-Fulkerson algorithm in the Edmonds-Karp variation.
- greedy_
feedback_ arc_ set - [Generic] Finds a feedback arc set: a set of edges in the given directed graph, which when removed, make the graph acyclic.
- greedy_
matching - [Generic] Compute a matching using a greedy heuristic.
- has_
path_ connecting - [Generic] Check if there exists a path starting at
from
and reachingto
. - is_
bipartite_ undirected - Return
true
if the graph* is bipartite. - is_
cyclic_ directed - [Generic] Return
true
if the input directed graph contains a cycle. - is_
cyclic_ undirected - [Generic] Return
true
if the input graph contains a cycle. - is_
isomorphic - [Generic] Return
true
if the graphsg0
andg1
are isomorphic. - is_
isomorphic_ matching - [Generic] Return
true
if the graphsg0
andg1
are isomorphic. - is_
isomorphic_ subgraph - [Generic] Return
true
ifg0
is isomorphic to a subgraph ofg1
. - is_
isomorphic_ subgraph_ matching - [Generic] Return
true
ifg0
is isomorphic to a subgraph ofg1
. - johnson
- [Generic] Johnson algorithm for all pairs shortest path problem.
- k_
shortest_ path - [Generic] k’th shortest path algorithm.
- kosaraju_
scc - [Generic] Compute the strongly connected components using Kosaraju’s algorithm.
- maximal_
cliques - Find all maximal cliques in an undirected graph using Bron–Kerbosch algorithm with pivoting. Also works on symmetric directed graphs, see the note below.
- maximum_
matching - [Generic] Compute the maximum matching using Gabow’s algorithm.
- min_
spanning_ tree - [Generic] Compute a minimum spanning tree of a graph.
- min_
spanning_ tree_ prim - [Generic] Compute a minimum spanning tree of a graph using Prim’s algorithm.
- page_
rank - [Generic] Page Rank algorithm.
- scc
Deprecated - Renamed to
kosaraju_scc
. - spfa
- [Generic] Compute shortest paths from node
source
to all other. - subgraph_
isomorphisms_ iter - Using the VF2 algorithm, examine both syntactic and semantic graph
isomorphism (graph structure and matching node and edge weights) and,
if
g0
is isomorphic to a subgraph ofg1
, return the mappings between them. - tarjan_
scc - [Generic] Compute the strongly connected components using Tarjan’s algorithm.
- toposort
- [Generic] Perform a topological sort of a directed graph.