|
Greedy algorithm - Definition and Overview |
| Related Words: Algorism, Attack, Course, Fashion, Figures, Form, Guise, Line, Lines, Math, Mathematic, Mathematics, Means, Method, Methodology |
|
|
|
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 usually 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.
The theory of matroids provides a whole class of such algorithms.
In general, greedy algorithms have five pillars:
- A candidate set, from which a solution is created
- A selection function, which chooses the best candidate to be added to the solution
- A feasibility function, that is used to determine if a candidate can be used to contribute to a solution
- An objective function, which assigns a value to a solution, or a partial solution, and
- A solution function, which will indicate when we have discovered a complete solution.
|
|
Example Usage of algorithm |
 |
icestorm77: Only an accountant could come up with a way to value a movie star. Introducing the "Winslet algorithm" - http://tiny.cc/c7jCV. |
 |
aggie12thman: @aggieredhead Good. Then I will remove that column. Sounds like they need a new algorithm to figure out what people really like. |
 |
harvfml: "My crush is a total computer nerd. Maybe if I were an algorithm he’d actually do me. FML" http://tumblr.com/xsl3xir81 |
|