Related Problems: graph-coloring Type: generic technique
Description: an algorithm that always takes the best immediate, or local, solution while finding an answer. Greedy algorithms find the overall, or globally, optimal solution for some optimization problems, but may find less-than-optimal solutions for some instances of other problems.

A greedy algorithm can be thought of as a backtracking algorithm where at each decision point "the best" option is already known and thus can be picked without having to recurse over any of the alternative options.

For example, applying the greedy strategy to the graph coloring problem yields the following algorithm:
"At each stage choose a a possible color to the given vertex".

Algorithm Steps:
1) Calculate the current local optimum
2) Apply this optimum
3) If there is more to do go to Step 1

The name "greedy" comes from the fact that the algorithms make decisions based on a single criterion, instead of a global analysis that would take into account the decision's effect on further steps.

See Greedy Algorithm at wolfram