Concepts3
βοΈ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
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
ποΈ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