Advanced Graph Algorithms

Advanced graph algorithms: strongly connected components (Tarjan's, Kosaraju's), max flow (Ford-Fulkerson, Edmonds-Karp, Dinic), matching, and graph coloring.

  • JSON8,248 B
  • YAML5,739 B · −30%
  • TOON5,138 B · −38%

Advanced graph algorithms: strongly connected components (Tarjan, Kosaraju), maximum flow (Ford-Fulkerson, Edmonds-Karp, Dinic), bipartite matching (Hopcroft-Karp), greedy coloring and negative-cycle detection, each with type, time, space, uses and notes.

Use it when

  • You need the right algorithm and complexity for a flow, matching or connectivity problem.
  • You are comparing max-flow algorithms.

Watch out for

  • Complexity depends on the graph representation and, for flow algorithms, on capacities; bounds are stated for common cases.
  • Greedy coloring does not give the minimum number of colors in general.

The data

Algorithms

NameTypeTimeSpaceDescriptionUse casesNotes
Tarjan's SCC AlgorithmStrongly Connected ComponentsO(V + E)O(V)Finds all strongly connected components in a directed graph using DFS with low-link values and a stack
  • Dependency resolution
  • Deadlock detection
  • Circuit analysis
  • 2-SAT solving
Single DFS pass; low-link value = lowest discovery time reachable from subtree
Kosaraju's SCC AlgorithmStrongly Connected ComponentsO(V + E)O(V)Two-pass algorithm: first DFS on original graph for finish times, second DFS on reversed graph in decreasing finish time order
  • SCC detection
  • Graph condensation
  • Course prerequisite analysis
Simpler to understand than Tarjan's but requires graph reversal and two passes
Ford-Fulkerson AlgorithmMaximum FlowO(E * max_flow)O(V + E)Repeatedly finds augmenting paths in residual graph and pushes flow until no path exists
  • Network flow
  • Bipartite matching
  • Baseball elimination
  • Image segmentation
May not terminate for irrational capacities; use BFS variant (Edmonds-Karp) for guaranteed termination
Edmonds-Karp AlgorithmMaximum FlowO(V * E^2)O(V + E)Ford-Fulkerson using BFS to find shortest augmenting path (by edges)
  • Network flow with guaranteed termination
  • Bipartite matching at scale
BFS ensures O(VE) augmentations; each augmentation found in O(E)
Dinic's AlgorithmMaximum FlowO(V^2 * E) or O(VE log U) with scalingO(V + E)Builds level graph via BFS, then finds blocking flow via DFS; repeats until no augmenting path
  • Large-scale network flow
  • Competitive programming
  • High-performance flow computation
O(V^2 E) worst case but O(E sqrt(V)) for unit networks; fastest practical max-flow algorithm
Hopcroft-Karp AlgorithmMaximum Bipartite MatchingO(E * sqrt(V))O(V + E)Finds maximum matching in bipartite graphs by repeatedly finding augmenting paths in batches
  • Job assignment
  • Ad matching
  • Student-course allocation
  • Dating apps matching
Much faster than simple augmenting path for dense bipartite graphs
Graph Coloring (Greedy)Vertex ColoringO(V + E)O(V)Assigns colors to vertices so no adjacent vertices share a color; greedy uses at most Δ+1 colors
  • Register allocation
  • Scheduling
  • Sudoku solving
  • Frequency assignment
Finding chromatic number is NP-hard; greedy gives approximation. Welsh-Powell orders by degree for better results
Bellman-Ford (Negative Cycles)Shortest Path with Negative WeightsO(V * E)O(V)Detects negative-weight cycles reachable from source while computing shortest paths
  • Arbitrage detection in currency exchange
  • Negative cycle detection
  • Shortest path with negative edges
After V-1 relaxations, one more pass: if any distance improves, negative cycle exists

Fields

The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.

SectionFieldTypeExample
algorithmsnamestringTarjan's SCC Algorithm
algorithmstypestringStrongly Connected Components
algorithmstimestringO(V + E)
algorithmsspacestringO(V)
algorithmsdescriptionstringFinds all strongly connected components in a di…
algorithmsuse_casesarray[4 items]
algorithmsnotesstringSingle DFS pass; low-link value = lowest discov…

Fetch the same bytes

The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.

curl "https://yjtoon.yunusemrevurgun.com/api/dataset/advanced-graph-algorithms?format=toon"
const res = await fetch(
  "https://yjtoon.yunusemrevurgun.com/static-data/dataset/advanced-graph-algorithms.toon"
);
const toon = await res.text();

Rate limit: 120 requests per minute per IP, no key and no signup. API reference →

Topics

  • graphs
  • algorithms
  • max-flow
  • matching
  • strongly-connected-components
  • graph-coloring
  • ford-fulkerson

Search the library

Search by a topic, title, or keyword.

Start with a collection

Browse all 205 datasets