Every programmer learns the greedy algorithm: at each step, make the locally best choice and never look back. Sometimes it works brilliantly — Kruskal's algorithm finds the cheapest spanning tree in a graph by always picking the shortest unused edge that doesn't create a cycle. But sometimes greedy fails spectacularly: for the knapsack problem, always grabbing the highest-value item can leave you far from the optimum.
For decades this distinction looked like accident. The truth, discovered by Richard Rado in 1957 and extended by Jack Edmonds in 1971, is deeply structural: there is a precise class of combinatorial objects — matroids — for which the greedy algorithm is always optimal, and for anything outside that class greedy can fail.
A matroid abstracts the key feature of linear independence from vectors: a collection of sets called independent sets, where every subset of an independent set is independent (the hereditary property) and where if you have two independent sets of different sizes you can always extend the smaller one by adding an element from the larger (the augmentation property). Those two rules are exactly what you need for greedy to reach the global best.
Comments
Loading comments...