Concepts4
βοΈ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
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
ποΈData StructureIntermediate
Queue and Deque
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.
#queue#deque#fifo+12