Short answer: Borůvka’s algorithm contracts many pieces of a minimum spanning tree at once. In each round every component marks a cheapest edge that leaves it, and all of those edges are added together. The number of components at least halves, so there are O(log V) rounds and the…
Category: Graphs
How bidirectional BFS meets in the middle of a path
Short answer: Bidirectional breadth-first search grows one frontier from the source and one from the target on an unweighted graph. A shortest path has some meeting vertex, and the two searches together expand about O(b^{d/2}) vertices instead of O(b^d) when every vertex has about b unused edges and the…
How Bellman-Ford relaxes every edge V minus 1 times
Short answer: Bellman-Ford relaxes every edge once per round, for |V|−1 rounds. A shortest path is simple when no negative cycle is reachable, so it has at most |V|−1 edges, and round k has considered every path of k edges. One more round that still relaxes an edge is…
How A* orders expansion by f equals g plus h
Short answer: A* pops the frontier vertex with the smallest f = g + h, where g is the distance already walked and h estimates the distance still to go. If h never overestimates, it is admissible, and the first time the goal is dequeued under a consistent h…
How 0-1 BFS uses a deque for weights zero and one
Short answer: 0-1 BFS computes shortest paths when every edge weight is 0 or 1. A relaxation of weight 0 pushes the neighbor at the front of a deque, and a relaxation of weight 1 pushes it at the back. The front of the deque stays in distance order,…
