0% found this document useful (0 votes)
3 views

Greedy_Algorithm_Introduction

The document explains the Greedy Algorithm, which makes the best possible choice at each step without reconsidering previous decisions, often leading to a global optimum. It outlines the characteristics, steps, advantages, and disadvantages of greedy algorithms, along with examples and suitable problem types. Greedy algorithms are effective for optimization problems, particularly in graph algorithms and scheduling, but may not always yield optimal solutions.

Uploaded by

bhuwneshwar00
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Greedy_Algorithm_Introduction

The document explains the Greedy Algorithm, which makes the best possible choice at each step without reconsidering previous decisions, often leading to a global optimum. It outlines the characteristics, steps, advantages, and disadvantages of greedy algorithms, along with examples and suitable problem types. Greedy algorithms are effective for optimization problems, particularly in graph algorithms and scheduling, but may not always yield optimal solutions.

Uploaded by

bhuwneshwar00
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Algorithm - Greedy Techniques

Introduction
Understanding the fundamentals of
the Greedy Algorithm
Your Name | Date | Institution
What is a Greedy Algorithm?
• - A greedy algorithm makes the best possible
choice at each step.
• - It does not reconsider previous choices.
• - Used when a local choice leads to a global
optimum.
• - Example: Coin Change Problem.
Characteristics of Greedy
Algorithms
• - Greedy Choice Property: Locally optimal
leads to globally optimal.
• - Optimal Substructure: Optimal solutions to
subproblems.
• - Non-revisiting Property: Decisions are final.
• - Examples: Prim’s, Kruskal’s, Huffman Coding.
Steps in a Greedy Algorithm
• 1. Identify optimal substructure.
• 2. Define objective function.
• 3. Make greedy choices.
• 4. Check correctness.
• 5. Derive final solution.
Advantages & Disadvantages
• Advantages:
• - Fast execution.
• - Simple implementation.
• - Works well for optimization problems.

• Disadvantages:
• - May not always be optimal.
• - Fails when future choices matter.
• - Not suitable for all problems.
Examples of Greedy Algorithms
• 1. Activity Selection Problem
• 2. Huffman Encoding
• 3. Dijkstra’s Algorithm
• 4. Fractional Knapsack Problem
When to Use a Greedy Algorithm?
• - Works for problems with optimal
substructure & greedy choice property.
• - Best for:
• - Graph algorithms (Prim’s, Kruskal’s,
Dijkstra’s)
• - Scheduling problems
• - Resource allocation
• - Not suitable for backtracking problems.
Conclusion & Summary
• - Greedy algorithms make locally optimal
choices.
• - Suitable for problems with optimal
substructure.
• - Common in graph problems, scheduling, and
optimization.
• - Not all problems can be solved optimally
using a greedy approach.

• Thank you! Questions?

You might also like