Source: wikibot/greedy-algorithm
= Greedy algorithm
{wiki=Greedy_algorithm}
A greedy algorithm is a computational method that makes the most optimal choice at each step with the hope of finding the global optimum. The fundamental principle behind greedy algorithms is to build up a solution piece by piece, always choosing the next piece that offers the most immediate benefit (i.e., the most "greedy" choice), without considering the long-term consequences.