Algorithms
Boost.Graph ships with ~80 generic graph algorithms, grouped into the categories below. Every algorithm is a function template and works against any graph type that models the required concepts (see Graph Concepts).
| Category | What it covers |
|---|---|
Breadth-first and depth-first search, with visitor-based customization points for tracking discovery, finish order, edge classification, and more. |
|
Dijkstra, Bellman-Ford, DAG shortest paths, Johnson all-pairs, Floyd-Warshall, A*, and resource-constrained shortest paths. |
|
Kruskal, Prim, random spanning trees (Wilson’s algorithm), and common spanning trees of two graphs. |
|
Connected, strongly connected (Tarjan), biconnected components with articulation points, and incremental/disjoint-sets variants. |
|
Max-flow (Edmonds-Karp, push-relabel, Boykov-Kolmogorov), min-cost-flow (cycle canceling, successive shortest paths), Stoer-Wagner min cut, Edmonds maximum matching. |
|
Topological ordering of a DAG via DFS. |
|
Sequential vertex coloring, edge coloring, bipartiteness test, odd-cycle extraction. |
|
Edge connectivity, s-t connectivity. |
|
PageRank, Brandes betweenness, degree / closeness / eccentricity, geodesic distance, clustering coefficient, core numbers, profile, wavefront, bandwidth. |
|
General isomorphism, VF2 subgraph isomorphism, McGregor common subgraphs. |
|
Boyer-Myrvold planarity test and embedding, Chrobak-Payne straight line drawing, Kuratowski subgraph extraction, face traversal, make-connected / biconnected / maximal-planar. |
|
Random, circle, Kamada-Kawai spring, Fruchterman-Reingold force-directed, Gürsoy-Atun layouts. |
|
Cuthill-McKee, King, minimum-degree, Sloan orderings for bandwidth and profile reduction. |
|
Hawick circuits (all elementary cycles), Tiernan all cycles, Howard cycle ratio. |
|
Bron-Kerbosch enumeration of maximal cliques. |
|
Copy, transpose, transitive closure / reduction, Lengauer-Tarjan dominators, metric-TSP approximation, maximum adjacency search, neighbor BFS, loop-erased random walk, graph statistics, and more. |