2. J. T. Mahajan College Of Engineering, Faizpur
Guide By
Prof. M. S. Chaudhari
Presented By
Sanika Nandkishor Katole
Department of Computer Engineering
Second Year
3. Contents
Introduction
What is Greedy Algorithm ?
Application of Greedy Algorithm
Advantages of Greedy Algorithm
Disadvantages of Greedy Algorithm
Conclusion
Reference
4. Introduction
Greedy algorithm defined as a method for
solving optimization problems by taking
decisions that result in the most evident
and immediate benefit irrespective of the
final outcome. It works for cases where
minimization or maximization leads to the
required solution.
5. What is Greedy Algorithm ?
Greedy Algorithm is a simple yet
powerful algorithmic technique
that makes the locally optimal
choice at each stage with the
hope of finding a global
optimum.
6. Applications of Greedy Algorithm
It is used in finding the shortest path.
It is used to find the minimum spanning tree using the prim’s algorithm
or the Kruskal’s algorithm.
It is used in a job sequencing with a deadline.
This algorithm is also used to solve the fractional knapsack problem.
7. Advantages of Greedy Algorithm
Simplicity – Greedy algorithms are often simple and easy to understand, making
them accessible to programmers of all skill levels.
Efficiency – Greedy algorithms can be very efficient in terms of time and space
complexity. They typically involve iterating through a problem’s inputs once, and
their solutions often have linear or logarithmic time complexity.
Flexibility – Greedy algorithms can be applied to a wide range of problems, from
scheduling to graph traversal to data compression. They are a versatile tool that
can be used in many different contexts.
8. Disadvantages of Greedy Algorithm
Local Optimality – Greedy algorithms make locally optimal choices at each step,
without considering the larger context. This means that they may not always lead to the
globally optimal solution.
Lack of Backtracking – Once a greedy algorithm makes a decision, it can be difficult or
impossible to backtrack and undo that decision. This can lead to suboptimal solutions or
even incorrect results.
Sensitivity to Input – Greedy algorithms are often sensitive to the order and structure of
the input data. Changing the input can result in significantly different output, making
it difficult to generalize the algorithm to new contexts.
9. Conclusion
In conclusion, greedy algorithms offer a straightforward and efficient
approach to solving optimization problems by making locally optimal
choices at each step. Their simplicity, ease of implementation, and low
time complexity make them valuable in various applications across
different domains.
10. Reference
Black, Paul E. (2 February 2005). “greedy algorithm”. Dictionary of
Algorithms and Data Structures. U.S. National Institute of Standards
and Technology (NIST). Retrieved 17 August 2012.
Cormen et al. 2001, Ch. 16
Gutin, Gregory; Yeo, Anders; Zverovich, Alexey (2002). “Traveling
salesman should not be greedy: Domination analysis of greedy-
type heuristics for the TSP”. Discrete Applied Mathematics.