Implementation using greedy algorithms

As we discussed earlier, greedy algorithms make decisions to yield the best possible local solution, which in turn provides the optimal solution. It is the hope of this technique that by making the best possible choices at each step, the total path will lead to an overall optimal solution or end.

Examples of greedy algorithms include Prim's algorithm for finding a minimum spanning tree, the Knapsack problem, and the Traveling Salesman problem, to mention just a few.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset