Groups
Category
Level
BellmanโFord finds single-source shortest paths even when some edge weights are negative.
Dijkstraโs algorithm can be adapted to track the second shortest path by keeping the best and second-best distances per vertex.
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 orders the nodes of a directed acyclic graph (DAG) so every edge points from left to right in the order.
Multi-source BFS explores an unweighted graph starting from several sources at once to compute the minimum distance to any source for every vertex.
A queue is a First-In-First-Out (FIFO) line where you add at the back and remove from the front in O(1) time.