Expand description
Advanced graph algorithm implementations.
Functions§
- bellman_
ford - Bellman-Ford algorithm for single-source shortest paths (allows negative weights).
- bipartite_
matching - Hopcroft-Karp bipartite matching.
- chromatic_
number_ approx - Greedy approximation of the chromatic number (treats graph as undirected).
- dijkstra
- Dijkstra’s algorithm for single-source shortest paths (non-negative weights).
- floyd_
warshall - Floyd-Warshall all-pairs shortest paths with path reconstruction.
- is_
bipartite - Check if the graph is bipartite using BFS 2-coloring.
- kruskal_
mst - Kruskal’s MST algorithm on an undirected weighted graph given as an edge list.
- max_
flow_ bfs - Edmonds-Karp max-flow (BFS-based Ford-Fulkerson on
FlowNetwork). - min_cut
- Compute the S/T partition (min-cut) after running
max_flow_bfs. - prim_
mst - Prim’s MST algorithm on a weighted directed graph.
- tarjan_
scc - Tarjan’s strongly connected components algorithm.
- topological_
sort_ dag - Topological sort of a DAG using Kahn’s algorithm (BFS).