Explanations, pseudocode, an embedded interactive visualization, implementations in JavaScript, Python, Java and Go, complexity and interview variations.
Explores the graph level by level using a queue. Because vertices are discovered in order of distance, BFS also finds the shortest path (fewest edges) from the start in an unweighted graph.
Goes as deep as possible along each branch before backtracking. This recursive version uses the call stack as its implicit stack.
Shortest paths with non-negative weights using a min-priority queue.
Relax every edge V−1 times; detects negative cycles.
All-pairs shortest paths by dynamic programming over intermediate vertices.
Linear order of a DAG respecting every edge (Kahn's algorithm / DFS).
Minimum spanning tree by adding cheapest edges with Union-Find.
Grow a minimum spanning tree from one vertex with a priority queue.