Greedy Method
Greedy Method
Greedy Algorithm
The greedy method is one of the strategies like Divide and conquer used to solve
the problems. This method is used for solving optimization problems. An
optimization problem is a problem that demands either maximum or minimum
results. Let's understand through some terms.
This technique is basically used to determine the feasible solution that may or may
not be optimal. The feasible solution is a subset that satisfies the given criteria. The
optimal solution is the solution which is the best and the most favorable solution in
the subset. In the case of feasible, if more than one solution satisfies the given
criteria then those solutions will be considered as the feasible, whereas the optimal
solution is the best solution among all the solutions.
1. To construct the solution in an optimal way, this algorithm creates two sets
where one set contains all the chosen items, and another set contains the
rejected items.
2. A Greedy algorithm makes good local choices in the hope that the solution
should be either feasible or optimal.
Disadvantages