Encyclopedia > Greedy algorithm

  Article Content

Greedy algorithm

Greedy algorithms are algorithms which follow the problem solving meta-heuristic of making the locally optimum choice at each stage with the hope of finding the global optimum. For instance, applying the greedy strategy to the traveling salesman problem yields the following algorithm: "At each stage visit the nearest unvisited city to the current city".

Greedy algorithms rarely find the globally optimal solution consistently, since they usally don't operate exhaustively on all the data. Nevertheless they are useful because they are quick to think up and often give good approximations to the optimum. If a greedy algorithm can be proven to yield the global optimum for a given problem class, it typically becomes the method of choice. Examples of such greedy algorithms are Kruskal's algorithm and Prim's algorithm.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Northampton, Suffolk County, New York

... out with 29.3% under the age of 18, 9.6% from 18 to 24, 30.3% from 25 to 44, 20.9% from 45 to 64, and 9.8% who are 65 years of age or older. The median age is 34 ...

 
 
 
This page was created in 38.8 ms