Week 5 Discussion Forum

Components of greedy algorithm.

Components of greedy algorithm.

by MD. MINHAZUL ALAM 192-15-2877 -
Number of replies: 0


In general, greedy algorithms have five components:

  • 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

Greedy algorithms produce good solutions to some mathematical problems, but not on others.


85 words