Greedy algorithms always go for the seemingly best next thing, without any regard for the future, and never change your mind about the past. The greedy paradigm is generally used for optimization problems. In this section, we first consider a scheduling problem and second the construction of optimal codes.
A greedy algorithm makes the decision based on available data at that moment, and the decision is not reconsidered in the future.
This algorithm consists of four functions.
- Firstly, check whether the chosen set of items provides a solution
- Secondly, verify the feasibility of a set.
- Next, the selection of the most promising candidate
- And the objective function is to give the value of a solution
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.