SlideShare a Scribd company logo
1 of 6
MODULE - 3GREEDY METHOD
๏‚ก The greedy method is the most straightforward design
technique.
๏‚ก Most of these problems have โ€˜nโ€™ inputs and require us to
obtain a subset that satisfies some constraint.
๏‚ก Any subset that satisfies these constraints is called A
FEASIBLE SOLUTION.
๏‚ก A feasible solution that maximizes/minimizes a given
function is called an OPTIMAL SOLUTON.
GENERAL METHOD
Algorithm: Greedy(a,n)
// a[1:n] contains n input
{
solution = 0;
for i = 1 to n do
x = select(a);
if Feasible(solution,x) then
soultion = Union(solution,x);
done
return solution;
}
GENERAL ALGORITHM
Selects an input from a[]. The selected
inputโ€™s value is assigned to x.
Is a Boolean valued function that determines
whether x can be included into the solution
vector
Combines x with the
solution and updates
the objective function.
KNAPSACK PROBLEM
Knapsack with โ€˜mโ€™
weight
โ€˜nโ€™ objects.
W1 , P1
W2 , P2
W3 , P3
W4 , P4
Select from
the given
objects that
will give
MAXIMUM
PROFIT
CASE 1 CASE 2
FRACTIONAL KNAPSACK 0 /1 KNAPSACK PROBLEM
If a fraction of an object is selected then it
is termed as โ€œFRACTIONAL KNAPSACK
PROBLEMโ€
If the decision is either taking an object
completely or rejecting it completely.
This is termed as, โ€œ0 /1 KNAPSACK
PROBLEMโ€
GREEDY APPROACH DYNAMIC PROGRAMMING
SELECTION OF OBJECTS
The problem can be stated as follows:-
Maximize 1โ‰ค๐‘–โ‰ค๐‘› ๐‘ ๐‘– ๐‘ฅ ๐‘– โ€ฆโ€ฆโ€ฆ (1)
Subject to 1โ‰ค๐‘–โ‰ค๐‘› ๐‘ค ๐‘– ๐‘ฅ ๐‘– โ‰ค ๐‘š โ€ฆ โ€ฆ . (2)
And 0 โ‰ค ๐‘ฅ ๐‘– โ‰ค 1 , 1 โ‰ค ๐‘ฅ ๐‘– โ‰ค n โ€ฆโ€ฆโ€ฆ (3)
A feasible solution is any set (x1,x2,โ€ฆ.,xn) satisfying
equation (2) and (3).
An optimal solution is a Feasible solution for which
equation (1) is maximized.
PROBLEM STATEMENT

More Related Content

What's hot

Introduction to dynamic programming
Introduction to dynamic programmingIntroduction to dynamic programming
Introduction to dynamic programmingAmisha Narsingani
ย 
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal'sGreedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal'sJay Patel
ย 
MM-OWG operator
MM-OWG operatorMM-OWG operator
MM-OWG operatorDragan Pamucar
ย 
Greedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemMadhu Bala
ย 
Greedy method1
Greedy method1Greedy method1
Greedy method1Rajendran
ย 
lecture 26
lecture 26lecture 26
lecture 26sajinsc
ย 
Duality in Linear Programming Problem
Duality in Linear Programming ProblemDuality in Linear Programming Problem
Duality in Linear Programming ProblemRAVI PRASAD K.J.
ย 
Unit.4.integer programming
Unit.4.integer programmingUnit.4.integer programming
Unit.4.integer programmingDagnaygebawGoshme
ย 
Unit.3. duality and sensetivity analisis
Unit.3. duality and sensetivity analisisUnit.3. duality and sensetivity analisis
Unit.3. duality and sensetivity analisisDagnaygebawGoshme
ย 
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
ย 
Penalty Function Method For Solving Fuzzy Nonlinear Programming Problem
Penalty Function Method For Solving Fuzzy Nonlinear Programming ProblemPenalty Function Method For Solving Fuzzy Nonlinear Programming Problem
Penalty Function Method For Solving Fuzzy Nonlinear Programming Problempaperpublications3
ย 
Unit.2. linear programming
Unit.2. linear programmingUnit.2. linear programming
Unit.2. linear programmingDagnaygebawGoshme
ย 
unit-4-dynamic programming
unit-4-dynamic programmingunit-4-dynamic programming
unit-4-dynamic programminghodcsencet
ย 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy AlgorithmWaqar Akram
ย 
Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityBhavin Darji
ย 
Recursion in Java
Recursion in JavaRecursion in Java
Recursion in JavaFulvio Corno
ย 
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...Simplilearn
ย 

What's hot (20)

Introduction to dynamic programming
Introduction to dynamic programmingIntroduction to dynamic programming
Introduction to dynamic programming
ย 
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal'sGreedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
ย 
MM-OWG operator
MM-OWG operatorMM-OWG operator
MM-OWG operator
ย 
Greedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack Problem
ย 
Greedy method1
Greedy method1Greedy method1
Greedy method1
ย 
lecture 26
lecture 26lecture 26
lecture 26
ย 
Duality in Linear Programming Problem
Duality in Linear Programming ProblemDuality in Linear Programming Problem
Duality in Linear Programming Problem
ย 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
ย 
Unit.4.integer programming
Unit.4.integer programmingUnit.4.integer programming
Unit.4.integer programming
ย 
Unit.3. duality and sensetivity analisis
Unit.3. duality and sensetivity analisisUnit.3. duality and sensetivity analisis
Unit.3. duality and sensetivity analisis
ย 
Analysis and Design of Algorithms notes
Analysis and Design of Algorithms  notesAnalysis and Design of Algorithms  notes
Analysis and Design of Algorithms notes
ย 
Chapter 17
Chapter 17Chapter 17
Chapter 17
ย 
Penalty Function Method For Solving Fuzzy Nonlinear Programming Problem
Penalty Function Method For Solving Fuzzy Nonlinear Programming ProblemPenalty Function Method For Solving Fuzzy Nonlinear Programming Problem
Penalty Function Method For Solving Fuzzy Nonlinear Programming Problem
ย 
Unit.2. linear programming
Unit.2. linear programmingUnit.2. linear programming
Unit.2. linear programming
ย 
unit-4-dynamic programming
unit-4-dynamic programmingunit-4-dynamic programming
unit-4-dynamic programming
ย 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
ย 
Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of Optimality
ย 
Recursion in Java
Recursion in JavaRecursion in Java
Recursion in Java
ย 
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
ย 
Introduction to optimization Problems
Introduction to optimization ProblemsIntroduction to optimization Problems
Introduction to optimization Problems
ย 

Viewers also liked

Algorithm chapter 9
Algorithm chapter 9Algorithm chapter 9
Algorithm chapter 9chidabdu
ย 
Lecture#9
Lecture#9Lecture#9
Lecture#9Ali Shah
ย 
Algorithm Design and Complexity - Course 5
Algorithm Design and Complexity - Course 5Algorithm Design and Complexity - Course 5
Algorithm Design and Complexity - Course 5Traian Rebedea
ย 
Greedy method class 11
Greedy method class 11Greedy method class 11
Greedy method class 11Kumar
ย 
Greedy Algoritham
Greedy AlgorithamGreedy Algoritham
Greedy AlgorithamRJ Mehul Gadhiya
ย 
Application of greedy method
Application  of  greedy methodApplication  of  greedy method
Application of greedy methodTech_MX
ย 
Greedy
GreedyGreedy
Greedykoralverma
ย 
Greedy Algorithms
Greedy AlgorithmsGreedy Algorithms
Greedy AlgorithmsAmrinder Arora
ย 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithmCaisar Oentoro
ย 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic ProgrammingSahil Kumar
ย 
Knapsack Problem
Knapsack ProblemKnapsack Problem
Knapsack ProblemJenny Galino
ย 

Viewers also liked (15)

Algorithm chapter 9
Algorithm chapter 9Algorithm chapter 9
Algorithm chapter 9
ย 
05. greedy method
05. greedy method05. greedy method
05. greedy method
ย 
12 Greeddy Method
12 Greeddy Method12 Greeddy Method
12 Greeddy Method
ย 
Lecture#9
Lecture#9Lecture#9
Lecture#9
ย 
Algorithm Design and Complexity - Course 5
Algorithm Design and Complexity - Course 5Algorithm Design and Complexity - Course 5
Algorithm Design and Complexity - Course 5
ย 
Greedy method class 11
Greedy method class 11Greedy method class 11
Greedy method class 11
ย 
Greedy Algoritham
Greedy AlgorithamGreedy Algoritham
Greedy Algoritham
ย 
Lec30
Lec30Lec30
Lec30
ย 
Application of greedy method
Application  of  greedy methodApplication  of  greedy method
Application of greedy method
ย 
Greedy
GreedyGreedy
Greedy
ย 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
ย 
Greedy Algorithms
Greedy AlgorithmsGreedy Algorithms
Greedy Algorithms
ย 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
ย 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
ย 
Knapsack Problem
Knapsack ProblemKnapsack Problem
Knapsack Problem
ย 

Similar to Lec 11 general greedy and fractional

Greedymethod
GreedymethodGreedymethod
GreedymethodBansari Shah
ย 
UNIT-II.pptx
UNIT-II.pptxUNIT-II.pptx
UNIT-II.pptxJyoReddy9
ย 
Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptxUnit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptxMaryJacob24
ย 
Unit 3 - Greedy Method
Unit 3  - Greedy MethodUnit 3  - Greedy Method
Unit 3 - Greedy MethodMaryJacob24
ย 
Unit 3 greedy method
Unit 3  greedy methodUnit 3  greedy method
Unit 3 greedy methodMaryJacob24
ย 
Unit 3-Greedy Method
Unit 3-Greedy MethodUnit 3-Greedy Method
Unit 3-Greedy MethodDevaKumari Vijay
ย 
4optmizationtechniques-150308051251-conversion-gate01.pdf
4optmizationtechniques-150308051251-conversion-gate01.pdf4optmizationtechniques-150308051251-conversion-gate01.pdf
4optmizationtechniques-150308051251-conversion-gate01.pdfBechanYadav4
ย 
Optmization techniques
Optmization techniquesOptmization techniques
Optmization techniquesDeepshika Reddy
ย 
optmizationtechniques.pdf
optmizationtechniques.pdfoptmizationtechniques.pdf
optmizationtechniques.pdfSantiagoGarridoBulln
ย 
9 Multi criteria Operation Decision Making - Nov 16 2020. pptx (ver2).pptx
9 Multi criteria Operation Decision Making - Nov 16 2020. pptx (ver2).pptx9 Multi criteria Operation Decision Making - Nov 16 2020. pptx (ver2).pptx
9 Multi criteria Operation Decision Making - Nov 16 2020. pptx (ver2).pptxdnbtraniemyu
ย 
9. chapter 8 np hard and np complete problems
9. chapter 8   np hard and np complete problems9. chapter 8   np hard and np complete problems
9. chapter 8 np hard and np complete problemsJyotsna Suryadevara
ย 
L20 Simplex Method
L20 Simplex MethodL20 Simplex Method
L20 Simplex MethodQuoc Bao Nguyen
ย 
Basic linear programming
Basic linear programmingBasic linear programming
Basic linear programmingMuhammad ALI RAZA
ย 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptBinayakMukherjee4
ย 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptdakccse
ย 
Optimization problems
Optimization problemsOptimization problems
Optimization problemsRuchika Sinha
ย 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy methodhodcsencet
ย 
Lecture5-7_12946_Linear Programming The Graphical Method.pptx
Lecture5-7_12946_Linear Programming The Graphical Method.pptxLecture5-7_12946_Linear Programming The Graphical Method.pptx
Lecture5-7_12946_Linear Programming The Graphical Method.pptxhlKh4
ย 
MLHEP Lectures - day 2, basic track
MLHEP Lectures - day 2, basic trackMLHEP Lectures - day 2, basic track
MLHEP Lectures - day 2, basic trackarogozhnikov
ย 
A New Lagrangian Relaxation Approach To The Generalized Assignment Problem
A New Lagrangian Relaxation Approach To The Generalized Assignment ProblemA New Lagrangian Relaxation Approach To The Generalized Assignment Problem
A New Lagrangian Relaxation Approach To The Generalized Assignment ProblemKim Daniels
ย 

Similar to Lec 11 general greedy and fractional (20)

Greedymethod
GreedymethodGreedymethod
Greedymethod
ย 
UNIT-II.pptx
UNIT-II.pptxUNIT-II.pptx
UNIT-II.pptx
ย 
Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptxUnit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptx
ย 
Unit 3 - Greedy Method
Unit 3  - Greedy MethodUnit 3  - Greedy Method
Unit 3 - Greedy Method
ย 
Unit 3 greedy method
Unit 3  greedy methodUnit 3  greedy method
Unit 3 greedy method
ย 
Unit 3-Greedy Method
Unit 3-Greedy MethodUnit 3-Greedy Method
Unit 3-Greedy Method
ย 
4optmizationtechniques-150308051251-conversion-gate01.pdf
4optmizationtechniques-150308051251-conversion-gate01.pdf4optmizationtechniques-150308051251-conversion-gate01.pdf
4optmizationtechniques-150308051251-conversion-gate01.pdf
ย 
Optmization techniques
Optmization techniquesOptmization techniques
Optmization techniques
ย 
optmizationtechniques.pdf
optmizationtechniques.pdfoptmizationtechniques.pdf
optmizationtechniques.pdf
ย 
9 Multi criteria Operation Decision Making - Nov 16 2020. pptx (ver2).pptx
9 Multi criteria Operation Decision Making - Nov 16 2020. pptx (ver2).pptx9 Multi criteria Operation Decision Making - Nov 16 2020. pptx (ver2).pptx
9 Multi criteria Operation Decision Making - Nov 16 2020. pptx (ver2).pptx
ย 
9. chapter 8 np hard and np complete problems
9. chapter 8   np hard and np complete problems9. chapter 8   np hard and np complete problems
9. chapter 8 np hard and np complete problems
ย 
L20 Simplex Method
L20 Simplex MethodL20 Simplex Method
L20 Simplex Method
ย 
Basic linear programming
Basic linear programmingBasic linear programming
Basic linear programming
ย 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
ย 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
ย 
Optimization problems
Optimization problemsOptimization problems
Optimization problems
ย 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
ย 
Lecture5-7_12946_Linear Programming The Graphical Method.pptx
Lecture5-7_12946_Linear Programming The Graphical Method.pptxLecture5-7_12946_Linear Programming The Graphical Method.pptx
Lecture5-7_12946_Linear Programming The Graphical Method.pptx
ย 
MLHEP Lectures - day 2, basic track
MLHEP Lectures - day 2, basic trackMLHEP Lectures - day 2, basic track
MLHEP Lectures - day 2, basic track
ย 
A New Lagrangian Relaxation Approach To The Generalized Assignment Problem
A New Lagrangian Relaxation Approach To The Generalized Assignment ProblemA New Lagrangian Relaxation Approach To The Generalized Assignment Problem
A New Lagrangian Relaxation Approach To The Generalized Assignment Problem
ย 

Recently uploaded

Top Rated Call Girls In chittoor ๐Ÿ“ฑ {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor ๐Ÿ“ฑ {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor ๐Ÿ“ฑ {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor ๐Ÿ“ฑ {7001035870} VIP Escorts chittoordharasingh5698
ย 
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...Call Girls in Nagpur High Profile
ย 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
ย 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
ย 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsArindam Chakraborty, Ph.D., P.E. (CA, TX)
ย 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
ย 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
ย 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
ย 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
ย 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Standamitlee9823
ย 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
ย 
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
ย 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfrs7054576148
ย 

Recently uploaded (20)

Top Rated Call Girls In chittoor ๐Ÿ“ฑ {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor ๐Ÿ“ฑ {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor ๐Ÿ“ฑ {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor ๐Ÿ“ฑ {7001035870} VIP Escorts chittoor
ย 
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
ย 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
ย 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
ย 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
ย 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
ย 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
ย 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
ย 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
ย 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
ย 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
ย 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
ย 
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
ย 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
ย 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
ย 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
ย 

Lec 11 general greedy and fractional

  • 2. ๏‚ก The greedy method is the most straightforward design technique. ๏‚ก Most of these problems have โ€˜nโ€™ inputs and require us to obtain a subset that satisfies some constraint. ๏‚ก Any subset that satisfies these constraints is called A FEASIBLE SOLUTION. ๏‚ก A feasible solution that maximizes/minimizes a given function is called an OPTIMAL SOLUTON. GENERAL METHOD
  • 3. Algorithm: Greedy(a,n) // a[1:n] contains n input { solution = 0; for i = 1 to n do x = select(a); if Feasible(solution,x) then soultion = Union(solution,x); done return solution; } GENERAL ALGORITHM Selects an input from a[]. The selected inputโ€™s value is assigned to x. Is a Boolean valued function that determines whether x can be included into the solution vector Combines x with the solution and updates the objective function.
  • 4. KNAPSACK PROBLEM Knapsack with โ€˜mโ€™ weight โ€˜nโ€™ objects. W1 , P1 W2 , P2 W3 , P3 W4 , P4 Select from the given objects that will give MAXIMUM PROFIT
  • 5. CASE 1 CASE 2 FRACTIONAL KNAPSACK 0 /1 KNAPSACK PROBLEM If a fraction of an object is selected then it is termed as โ€œFRACTIONAL KNAPSACK PROBLEMโ€ If the decision is either taking an object completely or rejecting it completely. This is termed as, โ€œ0 /1 KNAPSACK PROBLEMโ€ GREEDY APPROACH DYNAMIC PROGRAMMING SELECTION OF OBJECTS
  • 6. The problem can be stated as follows:- Maximize 1โ‰ค๐‘–โ‰ค๐‘› ๐‘ ๐‘– ๐‘ฅ ๐‘– โ€ฆโ€ฆโ€ฆ (1) Subject to 1โ‰ค๐‘–โ‰ค๐‘› ๐‘ค ๐‘– ๐‘ฅ ๐‘– โ‰ค ๐‘š โ€ฆ โ€ฆ . (2) And 0 โ‰ค ๐‘ฅ ๐‘– โ‰ค 1 , 1 โ‰ค ๐‘ฅ ๐‘– โ‰ค n โ€ฆโ€ฆโ€ฆ (3) A feasible solution is any set (x1,x2,โ€ฆ.,xn) satisfying equation (2) and (3). An optimal solution is a Feasible solution for which equation (1) is maximized. PROBLEM STATEMENT