Keras Reinforcement Learning Projects
by Giuseppe Ciaburro, Sudharsan Ravichandiran, Suriyadeepan Ramamoorthy
Greedy algorithms
Before introducing a greedy algorithm to find an optimal solution to the problem of the knapsack, it is appropriate to recall the main characteristics of any greedy technique. Any greedy technique proceeds iteratively. Starting from an empty solution, an element A is added to the partial solution under construction at each iteration. Of all the possible candidates to be added, element A is the most promising one—that is, if chosen, element A leads to a greater improvement of the objective function. It is clear that not all problems can be solved with this strategy, but only those for which it is possible to show that making the best choice at the moment leads to an optimal solution globally.
Let's look at an algorithm that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access