Concepts2
⚙️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
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