Concepts80

Category

Level

Filtering by:
#competitive programming
⚙️AlgorithmIntermediate

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.

#tarjan scc#strongly connected components#low link+12
⚙️AlgorithmIntermediate

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.

#bridges#articulation points#cut vertex+12
⚙️AlgorithmIntermediate

SPFA (Shortest Path Faster Algorithm)

SPFA is a queue-based optimization of Bellman–Ford that only relaxes edges from vertices whose distance just improved.

#spfa#bellman-ford#shortest path+12
⚙️AlgorithmIntermediate

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.

#lowest common ancestor#binary lifting#euler tour+12
⚙️AlgorithmIntermediate

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#kruskal#prim+12
⚙️AlgorithmIntermediate

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.

#prim#minimum spanning tree#mst+12
⚙️AlgorithmAdvanced

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.

#johnson's algorithm#all pairs shortest paths#apsp+12
⚙️AlgorithmIntermediate

Bellman-Ford Algorithm

Bellman–Ford finds single-source shortest paths even when some edge weights are negative.

#bellman-ford#single-source shortest paths#negative weights+12
⚙️AlgorithmIntermediate

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.

#dijkstra#second shortest path#k shortest paths+12
⚙️AlgorithmIntermediate

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).

#topological sort#dag dp#longest path dag+12
⚙️AlgorithmIntermediate

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.

#bfs#breadth first search#graph traversal+12
⚙️AlgorithmIntermediate

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.

#multi-source bfs#graph algorithms#shortest path+11