Utility Algorithms
Graph manipulation and analysis tools that don’t fit into a specific algorithm family.
Graph transformations
| Algorithm | What it does |
|---|---|
Deep copy of a graph. |
|
Reverse all edges (creates a new graph, unlike |
|
Add edges so that if u reaches v through any path, edge (u,v) exists. |
|
Remove redundant transitive edges. The opposite of transitive closure. |
Analysis
| Algorithm | What it does |
|---|---|
Compute the dominator tree of a directed graph (used in compiler analysis). |
|
Visit vertices in order of connectivity to the already-visited set. |
|
Remove high-betweenness edges to partition a graph into clusters. |
|
2-approximation for the Travelling Salesman Problem on complete metric graphs. |
|
Degree distribution, duplicate edge count, weighted degree distribution. |
|
Vertex ordering by minimum degree. Good heuristic for graph coloring. |
Internal utilities
| Algorithm | What it does |
|---|---|
BFS that follows both in-edges and out-edges on directed graphs. |
|
Building block for Wilson’s random spanning tree algorithm. |
|
Union-find data structure used by Kruskal and incremental components. |
|
Returns both endpoints of an edge as a pair. |
|
Given an edge and one endpoint, returns the other. |