Jump to content

Greedy algorithm

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 202.141.24.2 (talk) at 09:16, 22 September 2002. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

The greedy algorithm is a problem solving meta-heuristic which makes the locally optimum choice at each stage with the hope of finding the global optimum. For instance, applying the greedy stragtegy to the traveling salesman problem yields the following algorithm: "At each stage visit the city nearest to the current city". Greedy algorithms rarely find the optimal solution consistently, but they are fast and often give good approximations to the optimum.