Concepts80
Tarjan's SCC Algorithm
Tarjan’s algorithm finds all Strongly Connected Components (SCCs) of a directed graph in a single depth-first search using a stack.
Bridges and Articulation Points
A bridge is an edge whose removal increases the number of connected components; an articulation point is a vertex with the same property.
SPFA (Shortest Path Faster Algorithm)
SPFA is a queue-based optimization of Bellman–Ford that only relaxes edges from vertices whose distance just improved.
Lowest Common Ancestor (LCA)
The Lowest Common Ancestor (LCA) of two nodes in a rooted tree is the deepest node that is an ancestor of both.
MST Properties and Applications
An MST minimizes total edge weight over all spanning trees and has powerful properties such as the cut and cycle properties that guide correct, greedy construction.
Minimum Spanning Tree - Prim
Prim's algorithm builds a Minimum Spanning Tree (MST) by growing a tree from an arbitrary start vertex, always adding the lightest edge that connects the tree to a new vertex.
Johnson's Algorithm
Johnson's Algorithm computes all-pairs shortest paths on sparse graphs by first removing negative edges via reweighting, then running Dijkstra from every vertex.
Bellman-Ford Algorithm
Bellman–Ford finds single-source shortest paths even when some edge weights are negative.
Dijkstra - Variations and Applications
Dijkstra’s algorithm can be adapted to track the second shortest path by keeping the best and second-best distances per vertex.
Topological Sort - DP on DAG
Topological sort orders vertices of a directed acyclic graph (DAG) so every edge goes from earlier to later, which is perfect for dynamic programming (DP).
Breadth-First Search (BFS)
Breadth-First Search (BFS) explores a graph level by level, visiting all vertices at distance d from the source before any at distance d+1.
Multi-Source BFS
Multi-source BFS explores an unweighted graph starting from several sources at once to compute the minimum distance to any source for every vertex.