Skip to content
Back to categories

Graph Traversal

Algorithms that visit nodes and edges in a graph.

Graph traversal algorithms explore connected data such as networks, dependency maps, trees, and state spaces.

Graph TraversalO(V + E)

Breadth-First Search

Explores a graph from a start node in increasing number of edges.

BeginnerFoundationNo formula25 links
GraphTraversalQueueClassic
Graph TraversalO(V + E)

Depth-First Search

Explores a graph by following one path as far as possible before backtracking.

BeginnerFoundationNo formula14 links
GraphTraversalStackRecursion
Graph TraversalO(V + E)

Topological Sort

Orders the nodes of a directed acyclic graph so every prerequisite appears before its dependents.

IntermediateFoundationNo formula9 links
GraphDirected Acyclic GraphTraversalClassic
Graph TraversalO(V + E)

Articulation Point Detection

Finds graph nodes whose removal would split a connected graph.

AdvancedSpecializedNo formula1 links
GraphArticulation PointGraph ConnectivityTraversal
Graph TraversalO(b^(d/2))

Bidirectional Search

Searches from both the start and goal until the frontiers meet.

IntermediateCoreNo formula4 links
GraphSearchBidirectional SearchTraversal
Graph TraversalO(V + E)

Connected Components

Groups graph nodes by which nodes can reach each other.

BeginnerCoreNo formula4 links
GraphGraph ConnectivityTraversal
Graph TraversalO(V + E)

Cycle Detection

Determines whether a graph contains a cycle.

BeginnerCoreNo formula3 links
GraphCycle DetectionTraversal
Graph TraversalO(b^d)

Iterative Deepening DFS

Runs depth-first search repeatedly with increasing depth limits.

IntermediateCoreNo formula2 links
GraphTraversalRecursionSearch
Graph TraversalO(V + E)

Kosaraju's Algorithm

Finds strongly connected components using two passes of depth-first search.

IntermediateSpecializedNo formula4 links
GraphStrongly Connected ComponentsTraversalRecursion
Graph TraversalO(V + E)

Tarjan's Strongly Connected Components

Finds strongly connected components in one depth-first search pass.

AdvancedSpecializedNo formula5 links
GraphStrongly Connected ComponentsStackTraversal
Graph TraversalDepends on algorithm

Minimum Spanning Tree

Connects all nodes in a weighted graph with the lowest total edge cost and no cycles.

IntermediateCoreFormula7 links
GraphWeighted GraphMinimum Spanning TreeGreedy
Graph TraversalO(E log E)

Kruskal's Algorithm

Builds a minimum spanning tree by adding the cheapest edges that do not create cycles.

IntermediateCoreFormula7 links
GraphWeighted GraphMinimum Spanning TreeGreedy
Graph TraversalO(E log V)

Prim's Algorithm

Builds a minimum spanning tree by repeatedly attaching the cheapest edge from the tree to a new node.

IntermediateCoreFormula5 links
GraphWeighted GraphMinimum Spanning TreePriority Queue
Graph TraversalO(V + E)

Dynamic Programming on DAGs

Solves graph problems by processing directed acyclic graph nodes in dependency order.

IntermediateCoreFormula3 links
GraphDirected Acyclic GraphDynamic ProgrammingTraversal
Graph TraversalO(V + E)

Kahn's Algorithm

Produces a topological ordering by repeatedly removing nodes with no incoming edges.

IntermediateCoreFormula3 links
GraphDirected Acyclic GraphTopological OrderQueue
Graph TraversalO(V + E)

Bridge Detection

Finds edges whose removal would disconnect an undirected graph.

IntermediateCoreFormula2 links
GraphGraph ConnectivityDepth First SearchArticulation Point
Graph TraversalO(E)

Hierholzer's Algorithm

Builds an Eulerian path or circuit by splicing cycles that consume every edge once.

IntermediateCoreNo formula3 links
GraphEulerian PathTraversalCircular Buffer
Graph TraversalO(V + E)

Euler Tour

Records entry and exit order while traversing a tree or graph.

IntermediateCoreFormula5 links
TreeTraversalLCADepth First Search
Graph TraversalO((n + q) alpha(n))

Tarjan's Offline LCA

Answers lowest-common-ancestor queries in a tree using DFS and union-find.

AdvancedExtendedFormula1 links
TreeLCAUnion FindOffline Query
Graph TraversalO(log n)

Binary Lifting LCA

Answers tree ancestor queries by precomputing powers-of-two jumps.

IntermediateCoreFormula1 links
TreeLCADynamic ProgrammingBinary Lifting
Graph TraversalO(E * max_flow)

Ford-Fulkerson

Computes maximum flow by repeatedly augmenting along residual paths.

AdvancedCoreFormula6 links
GraphNetwork FlowMaximum FlowGraph Flow
Graph TraversalO(V E^2)

Edmonds-Karp

Computes maximum flow by choosing shortest augmenting paths with BFS.

AdvancedCoreFormula5 links
GraphNetwork FlowMaximum FlowBreadth First Search
Graph TraversalO(E V^2)

Dinic's Algorithm

Computes maximum flow using level graphs and blocking flows.

AdvancedCoreFormula5 links
GraphNetwork FlowMaximum FlowBreadth First Search
Graph TraversalO(E sqrt(V))

Hopcroft-Karp

Finds maximum bipartite matching by augmenting many shortest paths per phase.

AdvancedCoreFormula3 links
GraphMatchingBreadth First SearchDepth First Search
Graph TraversalO(V + E)

Bron-Kerbosch Algorithm

Bron-Kerbosch Algorithm extracts structure such as components, tours, rankings, or closures from a graph.

IntermediateCoreNo formula3 links
Graph
Graph TraversalO(V + E)

PageRank

PageRank scores graph nodes by repeatedly propagating rank through directed links.

IntermediateCoreFormula4 links
Graph
Graph TraversalO(V + E)

HITS Algorithm

HITS Algorithm scores or groups graph nodes by link structure.

IntermediateCoreFormula2 links
Graph
Graph TraversalO(V + E)

Label Propagation Community Detection

Label Propagation Community Detection scores or groups graph nodes by link structure.

IntermediateCoreNo formula1 links
Graph
Graph TraversalO(V + E)

Louvain Method

Louvain Method extracts structure such as components, tours, rankings, or closures from a graph.

IntermediateCoreNo formula1 links
Graph
Graph TraversalO(V + E)

Girvan-Newman Algorithm

Girvan-Newman Algorithm extracts structure such as components, tours, rankings, or closures from a graph.

IntermediateCoreNo formula1 links
Graph
Graph TraversalO(V + E)

Tarjan Bridge-Finding Algorithm

Tarjan Bridge-Finding Algorithm extracts structure such as components, tours, rankings, or closures from a graph.

IntermediateCoreNo formula1 links
Graph
Graph TraversalO(V + E)

Chu-Liu-Edmonds Algorithm

Chu-Liu-Edmonds Algorithm extracts structure such as components, tours, rankings, or closures from a graph.

IntermediateSpecializedNo formula1 links
Graph
Graph TraversalO(V + E)

Gabow SCC Algorithm

Gabow SCC Algorithm extracts structure such as components, tours, rankings, or closures from a graph.

IntermediateSpecializedNo formula1 links
Graph
Graph TraversalO(V + E)

Lexicographic Breadth-First Search

Lexicographic Breadth-First Search extracts structure such as components, tours, rankings, or closures from a graph.

IntermediateCoreNo formula2 links
Graph
Graph TraversalO(V + E)

Maximum Cardinality Search

Maximum Cardinality Search extracts structure such as components, tours, rankings, or closures from a graph.

IntermediateCoreNo formula2 links
Graph
Graph TraversalO(V + E)

Transitive Closure

Transitive Closure extracts structure such as components, tours, rankings, or closures from a graph.

IntermediateCoreNo formula1 links
Graph
Graph TraversalO((V + E) log V)

Boruvka's Algorithm

Builds a minimum spanning tree by repeatedly adding each component's cheapest outgoing edge.

IntermediateCoreNo formula4 links
GraphTraversalPriority Queue
Graph TraversalO((V + E) log V)

Reverse-Delete Algorithm

Builds a minimum spanning tree by deleting expensive edges that are not needed for connectivity.

IntermediateCoreNo formula4 links
GraphTraversal
Graph TraversalO((V + E) log V)

Transitive Reduction

Removes directed edges that are implied by alternate paths while preserving reachability.

IntermediateCoreNo formula3 links
GraphTraversal
Graph TraversalO(n log n)

Warshall's Algorithm

Computes transitive closure by repeatedly allowing each vertex as an intermediate step.

IntermediateCoreNo formula3 links
GraphTraversal
Graph TraversalO(V^2 E)

Push-Relabel

Computes maximum flow by pushing excess flow from active vertices and raising vertex heights.

IntermediateCoreFormula7 links
GraphTraversalNetwork Flow
Graph TraversalO(V^2 E)

Capacity Scaling Max Flow

Capacity Scaling Max Flow addresses maximum flow by solving flow on large-capacity edges first and lowering the scale threshold.

IntermediateExtendedNo formula6 links
GraphTraversalNetwork Flow
Graph TraversalO((V + E) log V)

Gomory-Hu Tree

Gomory-Hu Tree addresses all-pairs minimum cuts by building a cut-equivalent tree from repeated minimum cut computations.

AdvancedSpecializedNo formula5 links
GraphTraversal
Graph TraversalO((V + E) log V)

Stoer-Wagner Min Cut

Stoer-Wagner Min Cut uses merging weighted vertices while tracking the cheapest phase cut for global minimum cut.

IntermediateCoreNo formula4 links
GraphTraversalPriority Queue
Graph TraversalO((V + E) log V)

Karger's Min Cut

Karger's Min Cut addresses global minimum cut by randomly contracting edges until only two supernodes remain.

IntermediateExtendedNo formula3 links
GraphTraversalRandomness
Graph TraversalO(V^2 E)

Edmonds' Blossom Algorithm

Edmonds' Blossom Algorithm uses shrinking odd cycles so augmenting paths can be found in non-bipartite graphs for general graph matching.

IntermediateCoreNo formula7 links
GraphTraversalMatching
Graph TraversalO(V^2 E)

Bipartite Matching DFS

Bipartite Matching DFS uses searching for augmenting paths from unmatched left-side vertices for bipartite matching.

IntermediateCoreNo formula6 links
GraphTraversalMatching
Graph TraversalO(V^2 E)

Gale-Shapley Algorithm

Gale-Shapley Algorithm uses letting one side propose while the other side keeps its best current proposal for stable matching.

IntermediateCoreNo formula5 links
GraphTraversalMatching
Graph TraversalO((V + E) log V)

Fleury's Algorithm

Fleury's Algorithm uses walking unused edges while avoiding bridges unless no alternative remains for eulerian cycle construction.

IntermediateCoreNo formula4 links
GraphTraversal
Graph TraversalO((V + E) log V)

Hopcroft-Tarjan Planarity Test

Hopcroft-Tarjan Planarity Test addresses planarity detection by using depth-first search lowpoint structure to detect planarity obstructions.

AdvancedSpecializedNo formula4 links
GraphTraversal
Graph TraversalO((V + E) log V)

Boyer-Myrvold Planarity Test

Boyer-Myrvold Planarity Test addresses planarity embedding by incrementally maintaining embedding constraints during depth-first traversal.

AdvancedSpecializedNo formula4 links
GraphTraversalConstraint Solving
Graph TraversalO((V + E) log V)

Planar Embedding

Planar Embedding addresses planar embedding construction by ordering edges around vertices so a planar graph can be drawn without crossings.

IntermediateExtendedNo formula5 links
GraphTraversal
Graph TraversalO((V + E) log V)

Fruchterman-Reingold Layout

Fruchterman-Reingold Layout uses balancing attractive edge forces and repulsive vertex forces for force-directed graph drawing.

IntermediateCoreNo formula5 links
GraphTraversal
Graph TraversalO((V + E) log V)

Sugiyama Layered Drawing

Draws directed graphs in layers by ranking vertices, reducing crossings, and assigning coordinates.

IntermediateCoreNo formula6 links
GraphTraversal
Graph TraversalO((V + E) log V)

Reingold-Tilford Tree Layout

Draws tidy rooted trees by positioning subtrees recursively while separating their contours.

IntermediateCoreNo formula6 links
GraphTraversalDivide and Conquer
Graph TraversalO((V + E) log V)

Walker Tree Layout

Walker Tree Layout addresses tree drawing by extending tidy tree placement to variable-size nodes and general rooted trees.

IntermediateExtendedNo formula5 links
GraphTraversalRoot Finding
Graph TraversalO((V + E) log V)

Greedy Graph Coloring

Greedy Graph Coloring uses assigning each vertex the smallest available color in an ordering for vertex coloring.

IntermediateCoreNo formula6 links
GraphTraversal
Graph TraversalO(2^n)

DSATUR

DSATUR uses choosing the uncolored vertex with the highest saturation degree for vertex coloring.

IntermediateCoreNo formula6 links
GraphTraversalConstraint Solving
Graph TraversalO((V + E) log V)

Welsh-Powell Coloring

Welsh-Powell Coloring uses coloring vertices in descending degree order with the first available color for vertex coloring.

IntermediateCoreNo formula5 links
GraphTraversal
Graph TraversalO((V + E) log V)

Misra-Gries Edge Coloring

Misra-Gries Edge Coloring addresses edge coloring by rotating fans around vertices to color edges with bounded extra colors.

AdvancedSpecializedNo formula5 links
GraphTraversal
Graph TraversalO((V + E) log V)

Weisfeiler-Lehman Refinement

Refines graph vertex colors by repeatedly encoding each vertex's neighborhood color multiset.

IntermediateCoreNo formula4 links
GraphTraversal
Graph TraversalO((V + E) log V)

VF2 Graph Isomorphism

Tests graph or subgraph isomorphism by backtracking over node mappings with feasibility pruning.

IntermediateCoreNo formula4 links
GraphTraversal
Graph TraversalO((V + E) log V)

Nauty Canonical Labeling

Nauty Canonical Labeling addresses canonical graph labeling by partitioning and refining vertex sets to produce canonical graph forms.

AdvancedSpecializedNo formula4 links
GraphTraversal
Graph TraversalO((V + E) log V)

Greedy Maximal Independent Set

Greedy Maximal Independent Set uses selecting a vertex and deleting its neighbors until no vertices remain for independent set approximation.

IntermediateCoreNo formula8 links
GraphTraversalApproximation
Graph TraversalO((V + E) log V)

Biconnected Components

Finds maximal graph regions that stay connected after removing any one vertex.

IntermediateCoreNo formula2 links
GraphTraversal
Graph TraversalO((V + E) log V)

Lengauer-Tarjan Dominators

Lengauer-Tarjan Dominators addresses dominator tree construction by combining DFS numbering with union-find style ancestor queries.

AdvancedSpecializedNo formula2 links
GraphTraversal
Graph TraversalO((V + E) log V)

Johnson's Cycle Enumeration

Johnson's Cycle Enumeration addresses simple cycle enumeration by blocking and unblocking vertices to enumerate elementary directed cycles.

IntermediateExtendedNo formula4 links
GraphTraversal
Graph TraversalO((V + E) log V)

Chordal Graph Recognition

Chordal Graph Recognition addresses chordal graph recognition by checking whether maximum cardinality search produces a perfect elimination ordering.

IntermediateExtendedNo formula3 links
GraphTraversal