I am a beginner in the topic of algorithms. I have a query about Greedy Algorithms.
From what I understand, if there is a function and we are supposed to find its maxima/minima, if we find the local maxima/minima, we become 'greedy' and declare that as the global maxima/minima.
I suppose that is wrong?
Asked By : Victor
Answered By : Sagnik
Greedy algorithms are those in which we construct the optimum solution piece by piece.
After identifying a part of the optimum solution (this is intuitive by nature and problem dependent), try to add or subtract elements from it to see whether it still remains optimum.
I guess you should study Matroid Theory and Linear Programming Duality if you are very interested in the mathematics of greedy algorithms.
Try going through these problems on your own and practicing other problems related to these: Maximal Independent Set in a Tree, Disjoint Set (Interval Scheduling), Interval partitioning, 0-1 Knapsack and Fractional Knapsack.
What you are asking is about the Hill Climbing problem specifically. The Wikipedia page provides enough discussion about it, but if you are a newcomer in the world of algorithms I suggest you start out with the above problems first.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/44710
0 comments:
Post a Comment
Let us know your responses and feedback