Concepts108

⚙️AlgorithmIntermediate

Minimum Spanning Tree - Kruskal

Kruskal’s algorithm builds a minimum spanning tree (MST) by sorting all edges by weight and greedily picking the next lightest edge that does not form a cycle.

#kruskal#minimum spanning tree#mst+11
⚙️AlgorithmIntermediate

Floyd-Warshall Algorithm

Floyd–Warshall computes the shortest distances between all pairs of vertices in O(n^3) time using dynamic programming.

#floyd-warshall#all pairs shortest path#apsp+12
⚙️AlgorithmIntermediate

Dijkstra's Algorithm

Dijkstra's algorithm finds shortest path distances from one source to all vertices when all edge weights are non-negative.

#dijkstra#shortest path#greedy+11
⚙️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

DFS - Tree and Graph Properties

Depth-First Search (DFS) assigns each vertex a discovery time and a finish time that capture a neat nesting structure of recursion.

#dfs#timestamps#discovery time+11
⚙️AlgorithmIntermediate

Topological Sort

Topological sort orders the nodes of a directed acyclic graph (DAG) so every edge points from left to right in the order.

#topological sort#kahn algorithm#dfs topological order+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
⚙️AlgorithmIntermediate

0-1 BFS

0-1 BFS is a shortest path algorithm specialized for graphs whose edge weights are only 0 or 1.

#0-1 bfs#binary weights#shortest path+12
⚙️AlgorithmIntermediate

Depth-First Search (DFS)

Depth-First Search (DFS) explores a graph by going as deep as possible along each path before backtracking.

#depth-first search#dfs#graph traversal+12