SlideShare a Scribd company logo
1 of 22
GREEDY APROACH TOWARDS
PROBLEM SOLUTION
RASHID ANSARI
170847980002
MTECH (ACDS)
GREEDY ALGORITHM
Definition-:
A greedy algorithm is an algorithm that follows the problem
solving approach of making the locally optimal choice at each
stage with the hope of finding a global optimum.
GREEDY ALGORITHM
Simply……
A greedy algorithm always makes the choice that looks
best at the moment
Everyday examples:
Playing cards
Invest on stocks
Choose a university
The hope: a locally optimal choice will lead to a globally
optimal solution
MIN No. Of Coins Problem
 Given a value V, we want to make change for V Rs. We have
infinite supply of each of the denominations in Indian
currency.
{1,2,5,10,20,50,100,200,500,2000}coins/notes
 Example-
Input: value = 70
We need a 50 Rs note and a 20 Rs note.
Output:2
PROPERTIES OF OPTIMAL GREEDY
ALGORITHM
Two ingredients that are exhibited by most problems
that lend themselves to a greedy strategy
Greedy-choice property
Optimal substructure
Greedy-Choice Property : A global optimum can
be arrived at by selecting a local optimum.
Optimal Substructure : An optimal solution to
the problem contains an optimal solution to
subproblems
Applications
Activity Selection Problem
Minimum spanning tree
Knapsack Problem
Optimal Merging
Traveling Salesman Problem
Huffman Coding
Kruskal’s Alogorithm For Minimum
Spanning Tree
This is minimum spanning tree
ACTIVITY SELECTION PROBLEM
 Problem -: given n activities with their start and finish times.
Select the maximum number of activites that can be
performed by a single person, assuming that a person can
only work on a single activity at a time
ACTIVITY SELECTION PROBLEM
Solution
Greedy Approcah
 Sort the activities according to their finishing time
 Select the first activity from the sorted array and print it.
 DO the following for remaining activities in the sorted array.
 If the start time of this activity is greater than or equal to the finish
time of previously selected activity then select this activity and print it.
ACTIVITY SELECTION PROBLEM
ACTIVITY A1 A2 A3 A4 A5 A6
START 0 3 1 5 5 8
FINISH 6 4 2 9 7 9
ACTIVITY A3 A2 A1 A5 A6 A4
START 1 3 0 5 8 5
FINISH 2 4 6 7 9 9
SORTED
Step 1:
ACTIVITY SELECTION PROBLEM
 Step 2
A3
Step 3
A3->A2
A3->A2->A5
A3->A2->A5->A6
TOTAL = 4 ACTIVITES
ACTIVITY A3 A2 A1 A5 A6 A4
START 1 3 0 5 8 5
FINISH 2 4 6 7 9 9
ADVANTAGE
SIMPLE
EASY TO IMPLEMENT
RUN FAST
DRAWBACK
Very often they don’t provide a globally optimum
solution
Hard to verify: Showing a greedy algorithm is
correct often requires a nuanced argument.
THANKYOU!

More Related Content

Similar to Greedy aproach towards problem solution

19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdfGOWTHAMR721887
 
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdfLec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdfMAJDABDALLAH3
 
Dynamic programming, Branch and bound algorithm & Greedy algorithms
Dynamic programming, Branch and bound algorithm & Greedy algorithms Dynamic programming, Branch and bound algorithm & Greedy algorithms
Dynamic programming, Branch and bound algorithm & Greedy algorithms SURBHI SAROHA
 
2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdfishan743441
 
Basics of Algorithm Unit 1 part 1 algorithm
Basics of Algorithm Unit 1 part 1  algorithmBasics of Algorithm Unit 1 part 1  algorithm
Basics of Algorithm Unit 1 part 1 algorithmJIMS LAJPAT NAGAR
 
Analysis and Design of Algorithms notes
Analysis and Design of Algorithms  notesAnalysis and Design of Algorithms  notes
Analysis and Design of Algorithms notesProf. Dr. K. Adisesha
 
Week1 programming challenges
Week1 programming challengesWeek1 programming challenges
Week1 programming challengesDhanu Srikar
 
Ic lecture6 architecture and algo
Ic lecture6 architecture and algoIc lecture6 architecture and algo
Ic lecture6 architecture and algoAttaullahRahimoon
 
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptracha49
 
Introduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.pptIntroduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.pptBhargaviDalal4
 
Algorithm types performance steps working
Algorithm types performance steps workingAlgorithm types performance steps working
Algorithm types performance steps workingSaurabh846965
 
Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design PatternsAshwin Shiv
 
Ds03 part i algorithms by jyoti lakhani
Ds03 part i algorithms   by jyoti lakhaniDs03 part i algorithms   by jyoti lakhani
Ds03 part i algorithms by jyoti lakhanijyoti_lakhani
 
Architecture Algorithm Definition
Architecture Algorithm DefinitionArchitecture Algorithm Definition
Architecture Algorithm DefinitionGaditek
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy AlgorithmWaqar Akram
 

Similar to Greedy aproach towards problem solution (20)

19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf
 
Daa chapter4
Daa chapter4Daa chapter4
Daa chapter4
 
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdfLec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
 
Dynamic programming, Branch and bound algorithm & Greedy algorithms
Dynamic programming, Branch and bound algorithm & Greedy algorithms Dynamic programming, Branch and bound algorithm & Greedy algorithms
Dynamic programming, Branch and bound algorithm & Greedy algorithms
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf
 
Basics of Algorithm Unit 1 part 1 algorithm
Basics of Algorithm Unit 1 part 1  algorithmBasics of Algorithm Unit 1 part 1  algorithm
Basics of Algorithm Unit 1 part 1 algorithm
 
Analysis and Design of Algorithms notes
Analysis and Design of Algorithms  notesAnalysis and Design of Algorithms  notes
Analysis and Design of Algorithms notes
 
Week1 programming challenges
Week1 programming challengesWeek1 programming challenges
Week1 programming challenges
 
Ic lecture6 architecture and algo
Ic lecture6 architecture and algoIc lecture6 architecture and algo
Ic lecture6 architecture and algo
 
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
 
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
 
Introduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.pptIntroduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.ppt
 
Algorithm types performance steps working
Algorithm types performance steps workingAlgorithm types performance steps working
Algorithm types performance steps working
 
Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design Patterns
 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
 
Integer programming
Integer programmingInteger programming
Integer programming
 
Ds03 part i algorithms by jyoti lakhani
Ds03 part i algorithms   by jyoti lakhaniDs03 part i algorithms   by jyoti lakhani
Ds03 part i algorithms by jyoti lakhani
 
Architecture Algorithm Definition
Architecture Algorithm DefinitionArchitecture Algorithm Definition
Architecture Algorithm Definition
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
 

More from Rashid Ansari

Spatial computing and social media in the context of disaster management
Spatial computing and social media in the context of disaster managementSpatial computing and social media in the context of disaster management
Spatial computing and social media in the context of disaster managementRashid Ansari
 
Random forest algorithm
Random forest algorithmRandom forest algorithm
Random forest algorithmRashid Ansari
 
Predicting students performance in final examination
Predicting students performance in final examinationPredicting students performance in final examination
Predicting students performance in final examinationRashid Ansari
 
Heterogeneous computing
Heterogeneous computingHeterogeneous computing
Heterogeneous computingRashid Ansari
 
Affective color in visualization
Affective color in visualizationAffective color in visualization
Affective color in visualizationRashid Ansari
 
Divide and Conquer aproach towards problem solution
Divide and Conquer aproach towards problem solutionDivide and Conquer aproach towards problem solution
Divide and Conquer aproach towards problem solutionRashid Ansari
 
Big data visualization
Big data visualizationBig data visualization
Big data visualizationRashid Ansari
 
Structured query language
Structured query languageStructured query language
Structured query languageRashid Ansari
 

More from Rashid Ansari (13)

Fog Computing
Fog ComputingFog Computing
Fog Computing
 
Spatial computing and social media in the context of disaster management
Spatial computing and social media in the context of disaster managementSpatial computing and social media in the context of disaster management
Spatial computing and social media in the context of disaster management
 
Random forest algorithm
Random forest algorithmRandom forest algorithm
Random forest algorithm
 
Predicting students performance in final examination
Predicting students performance in final examinationPredicting students performance in final examination
Predicting students performance in final examination
 
Heterogeneous computing
Heterogeneous computingHeterogeneous computing
Heterogeneous computing
 
Affective color in visualization
Affective color in visualizationAffective color in visualization
Affective color in visualization
 
Divide and Conquer aproach towards problem solution
Divide and Conquer aproach towards problem solutionDivide and Conquer aproach towards problem solution
Divide and Conquer aproach towards problem solution
 
Linear Programming
Linear  ProgrammingLinear  Programming
Linear Programming
 
Big data visualization
Big data visualizationBig data visualization
Big data visualization
 
Riot games
Riot gamesRiot games
Riot games
 
BI in Enterprise
BI in EnterpriseBI in Enterprise
BI in Enterprise
 
Modern database
Modern databaseModern database
Modern database
 
Structured query language
Structured query languageStructured query language
Structured query language
 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Greedy aproach towards problem solution

  • 1. GREEDY APROACH TOWARDS PROBLEM SOLUTION RASHID ANSARI 170847980002 MTECH (ACDS)
  • 2. GREEDY ALGORITHM Definition-: A greedy algorithm is an algorithm that follows the problem solving approach of making the locally optimal choice at each stage with the hope of finding a global optimum.
  • 3. GREEDY ALGORITHM Simply…… A greedy algorithm always makes the choice that looks best at the moment Everyday examples: Playing cards Invest on stocks Choose a university The hope: a locally optimal choice will lead to a globally optimal solution
  • 4. MIN No. Of Coins Problem  Given a value V, we want to make change for V Rs. We have infinite supply of each of the denominations in Indian currency. {1,2,5,10,20,50,100,200,500,2000}coins/notes  Example- Input: value = 70 We need a 50 Rs note and a 20 Rs note. Output:2
  • 5. PROPERTIES OF OPTIMAL GREEDY ALGORITHM Two ingredients that are exhibited by most problems that lend themselves to a greedy strategy Greedy-choice property Optimal substructure
  • 6. Greedy-Choice Property : A global optimum can be arrived at by selecting a local optimum. Optimal Substructure : An optimal solution to the problem contains an optimal solution to subproblems
  • 7. Applications Activity Selection Problem Minimum spanning tree Knapsack Problem Optimal Merging Traveling Salesman Problem Huffman Coding
  • 8. Kruskal’s Alogorithm For Minimum Spanning Tree
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. This is minimum spanning tree
  • 16. ACTIVITY SELECTION PROBLEM  Problem -: given n activities with their start and finish times. Select the maximum number of activites that can be performed by a single person, assuming that a person can only work on a single activity at a time
  • 17. ACTIVITY SELECTION PROBLEM Solution Greedy Approcah  Sort the activities according to their finishing time  Select the first activity from the sorted array and print it.  DO the following for remaining activities in the sorted array.  If the start time of this activity is greater than or equal to the finish time of previously selected activity then select this activity and print it.
  • 18. ACTIVITY SELECTION PROBLEM ACTIVITY A1 A2 A3 A4 A5 A6 START 0 3 1 5 5 8 FINISH 6 4 2 9 7 9 ACTIVITY A3 A2 A1 A5 A6 A4 START 1 3 0 5 8 5 FINISH 2 4 6 7 9 9 SORTED Step 1:
  • 19. ACTIVITY SELECTION PROBLEM  Step 2 A3 Step 3 A3->A2 A3->A2->A5 A3->A2->A5->A6 TOTAL = 4 ACTIVITES ACTIVITY A3 A2 A1 A5 A6 A4 START 1 3 0 5 8 5 FINISH 2 4 6 7 9 9
  • 21. DRAWBACK Very often they don’t provide a globally optimum solution Hard to verify: Showing a greedy algorithm is correct often requires a nuanced argument.