SlideShare a Scribd company logo
Greedy Method
PRESENTED BY
JUBAIDA QUADER JERIN
COMPUTER SCIENCE AND ENGINEERING (DEPT.)
9/23/2021 1
CREATED BY JUBAIDA QUADER JERIN
Topics
• Definition
• Problem Statement
• Real Life Example
• Algorithm
• Fail Condition
• Examples
9/23/2021 2
CREATED BY JUBAIDA QUADER JERIN
Greedy Method/ Algorithm
• Algorithmic approach
• Best optimal choice at each small stages
• From Local Optimal Leading to Global Optimal Choice
A Greedy Algorithm always makes the choice that looks best at the moment
9/23/2021 3
CREATED BY JUBAIDA QUADER JERIN
Problem: I have to go from A to B with minimum Cost and within 12 Hours.
P: A B
12 hours
Minimum cost
S: Walk Car Train Plane Boat ……..
Feasible Solution
Optimal Solution
1. Multiple Solutions: walk, car etc.
2. Two Feasible Solutions: Train and Boat
3. One Optimal Solution: Train
Hence, Greedy Method is applied Optimization Problems
9/23/2021 4
CREATED BY JUBAIDA QUADER JERIN
Real Life Example
Job Recruitment Process
80% 70% 40% 20% 1%
Call Online Screening Viva Final
Written
Selected Candidate
What method are they using?
Ans: Greedy Method
9/23/2021 5
CREATED BY JUBAIDA QUADER JERIN
Greedy Algorithm (A, n)
{
Solution <- 0
for i in range 1 to n do
{
s<- select (A)
if (Feasible (Solution, s)) then
Solution <- Union (Solution, s)
}
return Solution
}
* A is Domain from which solution is to be obtained of size n
9/23/2021 6
CREATED BY JUBAIDA QUADER JERIN
When Greedy Algorithm fails?
Example:
10 7 1
• 3 coins
• Sums up to 15
• Minimum Number of Coins Coin 1 Coin 2 Coin 3
Greedy Method: 1x 10 + 5x 1 = 6 coins
Correct Answer: 2x 7 + 1x 1 = 3 coins
Why Greedy Algorithm failed?
Local optimal doesn’t always result in Global Optimal
9/23/2021 7
CREATED BY JUBAIDA QUADER JERIN
Greedy Algorithm Example:
1. Job Sequenced with Deadline
2. Knapsack Problem
3. Huffman Coding
4. MST
5. Dijkstra Algorithm
9/23/2021 8
CREATED BY JUBAIDA QUADER JERIN
Thank You
9/23/2021 9
CREATED BY JUBAIDA QUADER JERIN
Ad

Recommended

Chapter5[1]
Chapter5[1]
Hariharan Ponnusamy
 
Mb0048 operations research
Mb0048 operations research
consult4solutions
 
Greedy method
Greedy method
Dr Shashikant Athawale
 
Greedy algorithm
Greedy algorithm
CHANDAN KUMAR
 
Greedy method class 11
Greedy method class 11
Kumar
 
Daa chapter4
Daa chapter4
B.Kirron Reddi
 
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
MAJDABDALLAH3
 
Greedy algorithms
Greedy algorithms
Md. Shafiuzzaman Hira
 
Greedy algorithm activity selection fractional
Greedy algorithm activity selection fractional
Amit Kumar Rathi
 
Greedymethod
Greedymethod
Bansari Shah
 
Module 3_DAA (2).pptx
Module 3_DAA (2).pptx
AnkitaVerma776806
 
Greedy with Task Scheduling Algorithm.ppt
Greedy with Task Scheduling Algorithm.ppt
Ruchika Sinha
 
Greedy with Task Scheduling Algorithm.ppt
Greedy with Task Scheduling Algorithm.ppt
Ruchika Sinha
 
Greedy
Greedy
koralverma
 
Greedy aproach towards problem solution
Greedy aproach towards problem solution
Rashid Ansari
 
Greedy Algorithms WITH Activity Selection Problem.ppt
Greedy Algorithms WITH Activity Selection Problem.ppt
Ruchika Sinha
 
greedy method.pdf
greedy method.pdf
deepakjoshi29912
 
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Jay Patel
 
Greedy method by Dr. B. J. Mohite
Greedy method by Dr. B. J. Mohite
Zeal Education Society, Pune
 
Unit 3 - Greedy Method
Unit 3 - Greedy Method
MaryJacob24
 
Unit 3 greedy method
Unit 3 greedy method
MaryJacob24
 
Greedy_Backtracking graph coloring.ppt
Greedy_Backtracking graph coloring.ppt
SeethaDinesh
 
Greedy technique.
Greedy technique.
mohanrathod18
 
Greedy algorithm pptxe file for computer
Greedy algorithm pptxe file for computer
kerimu1235
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
22bcs058
 
Greedy Algorithms project presentation ppt.pptx
Greedy Algorithms project presentation ppt.pptx
ParasBhoite1
 
Greedy algorithm presentations final year.pptx
Greedy algorithm presentations final year.pptx
ParasBhoite1
 
Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptx
MaryJacob24
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
 
Modern multi-proposer consensus implementations
Modern multi-proposer consensus implementations
François Garillot
 

More Related Content

Similar to Greedy Algorithm by Jerin (20)

Greedy algorithm activity selection fractional
Greedy algorithm activity selection fractional
Amit Kumar Rathi
 
Greedymethod
Greedymethod
Bansari Shah
 
Module 3_DAA (2).pptx
Module 3_DAA (2).pptx
AnkitaVerma776806
 
Greedy with Task Scheduling Algorithm.ppt
Greedy with Task Scheduling Algorithm.ppt
Ruchika Sinha
 
Greedy with Task Scheduling Algorithm.ppt
Greedy with Task Scheduling Algorithm.ppt
Ruchika Sinha
 
Greedy
Greedy
koralverma
 
Greedy aproach towards problem solution
Greedy aproach towards problem solution
Rashid Ansari
 
Greedy Algorithms WITH Activity Selection Problem.ppt
Greedy Algorithms WITH Activity Selection Problem.ppt
Ruchika Sinha
 
greedy method.pdf
greedy method.pdf
deepakjoshi29912
 
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Jay Patel
 
Greedy method by Dr. B. J. Mohite
Greedy method by Dr. B. J. Mohite
Zeal Education Society, Pune
 
Unit 3 - Greedy Method
Unit 3 - Greedy Method
MaryJacob24
 
Unit 3 greedy method
Unit 3 greedy method
MaryJacob24
 
Greedy_Backtracking graph coloring.ppt
Greedy_Backtracking graph coloring.ppt
SeethaDinesh
 
Greedy technique.
Greedy technique.
mohanrathod18
 
Greedy algorithm pptxe file for computer
Greedy algorithm pptxe file for computer
kerimu1235
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
22bcs058
 
Greedy Algorithms project presentation ppt.pptx
Greedy Algorithms project presentation ppt.pptx
ParasBhoite1
 
Greedy algorithm presentations final year.pptx
Greedy algorithm presentations final year.pptx
ParasBhoite1
 
Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptx
MaryJacob24
 
Greedy algorithm activity selection fractional
Greedy algorithm activity selection fractional
Amit Kumar Rathi
 
Greedy with Task Scheduling Algorithm.ppt
Greedy with Task Scheduling Algorithm.ppt
Ruchika Sinha
 
Greedy with Task Scheduling Algorithm.ppt
Greedy with Task Scheduling Algorithm.ppt
Ruchika Sinha
 
Greedy aproach towards problem solution
Greedy aproach towards problem solution
Rashid Ansari
 
Greedy Algorithms WITH Activity Selection Problem.ppt
Greedy Algorithms WITH Activity Selection Problem.ppt
Ruchika Sinha
 
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Jay Patel
 
Unit 3 - Greedy Method
Unit 3 - Greedy Method
MaryJacob24
 
Unit 3 greedy method
Unit 3 greedy method
MaryJacob24
 
Greedy_Backtracking graph coloring.ppt
Greedy_Backtracking graph coloring.ppt
SeethaDinesh
 
Greedy algorithm pptxe file for computer
Greedy algorithm pptxe file for computer
kerimu1235
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
22bcs058
 
Greedy Algorithms project presentation ppt.pptx
Greedy Algorithms project presentation ppt.pptx
ParasBhoite1
 
Greedy algorithm presentations final year.pptx
Greedy algorithm presentations final year.pptx
ParasBhoite1
 
Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptx
MaryJacob24
 

Recently uploaded (20)

362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
 
Modern multi-proposer consensus implementations
Modern multi-proposer consensus implementations
François Garillot
 
Impurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptx
dhanashree78
 
IntroSlides-June-GDG-Cloud-Munich community [email protected]
IntroSlides-June-GDG-Cloud-Munich community [email protected]
Luiz Carneiro
 
Water demand - Types , variations and WDS
Water demand - Types , variations and WDS
dhanashree78
 
Pavement and its types, Application of rigid and Flexible Pavements
Pavement and its types, Application of rigid and Flexible Pavements
Sakthivel M
 
60 Years and Beyond eBook 1234567891.pdf
60 Years and Beyond eBook 1234567891.pdf
waseemalazzeh
 
How Binning Affects LED Performance & Consistency.pdf
How Binning Affects LED Performance & Consistency.pdf
Mina Anis
 
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
KhadijaKhadijaAouadi
 
Industry 4.o the fourth revolutionWeek-2.pptx
Industry 4.o the fourth revolutionWeek-2.pptx
KNaveenKumarECE
 
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
João Esperancinha
 
最新版美国圣莫尼卡学院毕业证(SMC毕业证书)原版定制
最新版美国圣莫尼卡学院毕业证(SMC毕业证书)原版定制
Taqyea
 
Understanding Amplitude Modulation : A Guide
Understanding Amplitude Modulation : A Guide
CircuitDigest
 
COMPOSITE COLUMN IN STEEL CONCRETE COMPOSITES.ppt
COMPOSITE COLUMN IN STEEL CONCRETE COMPOSITES.ppt
ravicivil
 
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
ijab2
 
ElysiumPro Company Profile 2025-2026.pdf
ElysiumPro Company Profile 2025-2026.pdf
info751436
 
chemistry investigatory project for class 12
chemistry investigatory project for class 12
Susis10
 
4th International Conference on Computer Science and Information Technology (...
4th International Conference on Computer Science and Information Technology (...
ijait
 
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Alexandra N. Martinez
 
Great power lithium iron phosphate cells
Great power lithium iron phosphate cells
salmankhan835951
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
 
Modern multi-proposer consensus implementations
Modern multi-proposer consensus implementations
François Garillot
 
Impurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptx
dhanashree78
 
Water demand - Types , variations and WDS
Water demand - Types , variations and WDS
dhanashree78
 
Pavement and its types, Application of rigid and Flexible Pavements
Pavement and its types, Application of rigid and Flexible Pavements
Sakthivel M
 
60 Years and Beyond eBook 1234567891.pdf
60 Years and Beyond eBook 1234567891.pdf
waseemalazzeh
 
How Binning Affects LED Performance & Consistency.pdf
How Binning Affects LED Performance & Consistency.pdf
Mina Anis
 
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
KhadijaKhadijaAouadi
 
Industry 4.o the fourth revolutionWeek-2.pptx
Industry 4.o the fourth revolutionWeek-2.pptx
KNaveenKumarECE
 
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
João Esperancinha
 
最新版美国圣莫尼卡学院毕业证(SMC毕业证书)原版定制
最新版美国圣莫尼卡学院毕业证(SMC毕业证书)原版定制
Taqyea
 
Understanding Amplitude Modulation : A Guide
Understanding Amplitude Modulation : A Guide
CircuitDigest
 
COMPOSITE COLUMN IN STEEL CONCRETE COMPOSITES.ppt
COMPOSITE COLUMN IN STEEL CONCRETE COMPOSITES.ppt
ravicivil
 
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
ijab2
 
ElysiumPro Company Profile 2025-2026.pdf
ElysiumPro Company Profile 2025-2026.pdf
info751436
 
chemistry investigatory project for class 12
chemistry investigatory project for class 12
Susis10
 
4th International Conference on Computer Science and Information Technology (...
4th International Conference on Computer Science and Information Technology (...
ijait
 
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Alexandra N. Martinez
 
Great power lithium iron phosphate cells
Great power lithium iron phosphate cells
salmankhan835951
 
Ad

Greedy Algorithm by Jerin

  • 1. Greedy Method PRESENTED BY JUBAIDA QUADER JERIN COMPUTER SCIENCE AND ENGINEERING (DEPT.) 9/23/2021 1 CREATED BY JUBAIDA QUADER JERIN
  • 2. Topics • Definition • Problem Statement • Real Life Example • Algorithm • Fail Condition • Examples 9/23/2021 2 CREATED BY JUBAIDA QUADER JERIN
  • 3. Greedy Method/ Algorithm • Algorithmic approach • Best optimal choice at each small stages • From Local Optimal Leading to Global Optimal Choice A Greedy Algorithm always makes the choice that looks best at the moment 9/23/2021 3 CREATED BY JUBAIDA QUADER JERIN
  • 4. Problem: I have to go from A to B with minimum Cost and within 12 Hours. P: A B 12 hours Minimum cost S: Walk Car Train Plane Boat …….. Feasible Solution Optimal Solution 1. Multiple Solutions: walk, car etc. 2. Two Feasible Solutions: Train and Boat 3. One Optimal Solution: Train Hence, Greedy Method is applied Optimization Problems 9/23/2021 4 CREATED BY JUBAIDA QUADER JERIN
  • 5. Real Life Example Job Recruitment Process 80% 70% 40% 20% 1% Call Online Screening Viva Final Written Selected Candidate What method are they using? Ans: Greedy Method 9/23/2021 5 CREATED BY JUBAIDA QUADER JERIN
  • 6. Greedy Algorithm (A, n) { Solution <- 0 for i in range 1 to n do { s<- select (A) if (Feasible (Solution, s)) then Solution <- Union (Solution, s) } return Solution } * A is Domain from which solution is to be obtained of size n 9/23/2021 6 CREATED BY JUBAIDA QUADER JERIN
  • 7. When Greedy Algorithm fails? Example: 10 7 1 • 3 coins • Sums up to 15 • Minimum Number of Coins Coin 1 Coin 2 Coin 3 Greedy Method: 1x 10 + 5x 1 = 6 coins Correct Answer: 2x 7 + 1x 1 = 3 coins Why Greedy Algorithm failed? Local optimal doesn’t always result in Global Optimal 9/23/2021 7 CREATED BY JUBAIDA QUADER JERIN
  • 8. Greedy Algorithm Example: 1. Job Sequenced with Deadline 2. Knapsack Problem 3. Huffman Coding 4. MST 5. Dijkstra Algorithm 9/23/2021 8 CREATED BY JUBAIDA QUADER JERIN
  • 9. Thank You 9/23/2021 9 CREATED BY JUBAIDA QUADER JERIN