Graph algorithms: shortest paths, SCC, LCA
SCC decomposition, bridges, and articulation points in a single O(V+E) DFS pass.
Minimum spanning tree using priority queue — greedy cut-based approach in O(E log V).
LCA with path aggregate queries (sum/max/min) on weighted trees using binary lifting in O(log n).
Binary lifting for LCA, distance, and k-th ancestor queries on unweighted trees in O(log n).
Maximum bipartite matching via augmenting paths in O(V*E).
DFS and BFS with bipartite check, cycle detection, topological sort, and path reconstruction.
Linked-list (head array) adjacency — cache-friendly graph representation for contests.
All-pairs shortest paths via O(V^3) dynamic programming on the adjacency matrix.
Shortest path in non-negative weighted graphs using priority queue relaxation in O((V+E) log V).
Divide-and-conquer on trees via centroid selection for O(n log n) path processing.
Shortest path with negative edge weights and negative cycle detection in O(V*E).