Solves
traversal
Articles
GRA
Algorithm
Breadth-first search
Walks a graph in layers and finds paths with the fewest edges in O(V + E).
O(V + E)
2 problems
GRA
Algorithm
Depth-first search
Goes deep, marks each vertex's entry and exit and finds cycles by them in O(V + E).
O(V + E)
2 problems
GRA
Algorithm
Bridges and articulation points
Streets and crossroads without which a graph falls apart: one depth-first search with the numbers tin and low, O(V + E).
O(V + E)
2 problems
GRA
Algorithm
Eulerian path
Go along every edge exactly once: the odd-vertex rule and Hierholzer's algorithm in O(E).
O(V + E)
3 problems
Problems
Often together
graph 4 classic 4 interviews 3 contests 3 stack 3 connectivity 2 maps and navigation 2 shortest path 1 queue 1 games 1 dependency order 1 recursion 1