SlideShare a Scribd company logo
3
Most read
4
Most read
7
Most read
DAA UNIT 2
BY:SURBHI SAROHA
SYLLABUS
• Dynamic programming
• Branch and bound algorithm
• Greedy algorithms
DYNAMIC PROGRAMMING
• The following are the steps that the dynamic programming follows:
• It breaks down the complex problem into simpler subproblems.
• It finds the optimal solution to these sub-problems.
• It stores the results of subproblems (memoization). The process of storing the results of subproblems is
known as memorization.
• It reuses them so that same sub-problem is calculated more than once.
• Finally, calculate the result of the complex problem.
CONT……
• Dynamic programming is a technique that breaks the problems into sub-problems, and saves the result
for future purposes so that we do not need to compute the result again.
• The subproblems are optimized to optimize the overall solution is known as optimal substructure
property.
• The main use of dynamic programming is to solve optimization problems.
• Here, optimization problems mean that when we are trying to find out the minimum or the maximum
solution of a problem.
• The dynamic programming guarantees to find the optimal solution of a problem if the solution exists.
APPLICATIONS OF DYNAMIC PROGRAMMING
APPROACH
• Matrix Chain Multiplication
• Longest Common Subsequence
• Travelling Salesman Problem
BRANCH AND BOUND ALGORITHM
• Branch and bound algorithms are used to find the optimal solution for combinatory, discrete, and
general mathematical optimization problems.
• In general, given an NP-Hard problem, a branch and bound algorithm explores the entire search
space of possible solutions and provides an optimal solution.
• A branch and bound algorithm consist of stepwise enumeration of possible candidate solutions by
exploring the entire search space. With all the possible solutions, we first build a rooted decision tree.
The root node represents the entire search space.
Dynamic programming, Branch and bound algorithm & Greedy algorithms
CONT…..
• Here, each child node is a partial solution and part of the solution set. Before constructing the rooted
decision tree, we set an upper and lower bound for a given problem based on the optimal solution. At
each level, we need to make a decision about which node to include in the solution set. At each level,
we explore the node with the best bound. In this way, we can find the best and optimal solution fast.
• Now it is crucial to find a good upper and lower bound in such cases. We can find an upper bound by
using any local optimization method or by picking any point in the search space. On the other hand, we
can obtain a lower bound from convex relaxation or duality.
• In general, we want to partition the solution set into smaller subsets of solution. Then we construct a
rooted decision tree, and finally, we choose the best possible subset (node) at each level to find the
best possible solution set.
GREEDY ALGORITHMS
• Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece
that offers the most obvious and immediate benefit. So the problems where choosing locally optimal also
leads to global solution are best fit for Greedy.
• For example consider the Fractional Knapsack Problem. The local optimal strategy is to choose the item that
has maximum value vs weight ratio. This strategy also leads to global optimal solution because we allowed to
take fractions of an item.
• A greedy algorithm is an approach for solving a problem by selecting the best option available at the moment.
It doesn't worry whether the current best result will bring the overall optimal result.
• The algorithm never reverses the earlier decision even if the choice is wrong. It works in a top-down approach.
• This algorithm may not produce the best result for all the problems. It's because it always goes for the local
best choice to produce the global best result.
Dynamic programming, Branch and bound algorithm & Greedy algorithms
ADVANTAGES OF GREEDY APPROACH
• The algorithm is easier to describe.
• This algorithm can perform better than other algorithms (but, not in all cases).
•
Drawback of Greedy Approach
• As mentioned earlier, the greedy algorithm doesn't always produce the optimal solution. This is the
major disadvantage of the algorithm
THANK YOU
Ad

Recommended

PPT
Parallel processing and pipelining
mahesh kumar prajapat
 
PDF
9. chapter 8 np hard and np complete problems
Jyotsna Suryadevara
 
PPTX
Signal
Mohammed Sikander
 
PPTX
daa-unit-3-greedy method
hodcsencet
 
PPTX
Tcp header/IP Header/Authentication header
Faizan Shaikh
 
PPT
Pipelining
AJAL A J
 
PPTX
Data Hazard and Solution for Data Hazard
COMSATS Institute of Information Technology
 
PPT
Pipelining & All Hazards Solution
.AIR UNIVERSITY ISLAMABAD
 
PPTX
Email HTTP And FTP
Shishpal Vishnoi
 
PPT
Backtracking
Vikas Sharma
 
PPTX
Interconnect timing model
Prachi Pandey
 
PPT
Divide and conquer
Dr Shashikant Athawale
 
PDF
Session 6 sv_randomization
Nirav Desai
 
PDF
UVM Methodology Tutorial
Arrow Devices
 
PPT
Operating System - Monitors (Presentation)
Experts Desk
 
PPTX
Round Robin Algorithm.pptx
Sanad Bhowmik
 
PPTX
Specification-of-tokens
Dattatray Gandhmal
 
PPTX
System verilog coverage
Pushpa Yakkala
 
PPTX
8 queens problem using back tracking
Tech_MX
 
PPTX
Directed Acyclic Graph Representation of basic blocks
Mohammad Vaseem Akaram
 
PPTX
Deadlocks in operating system
Sara Ali
 
PPTX
Computer architecture instruction formats
Mazin Alwaaly
 
PPTX
Signed Addition And Subtraction
Keyur Vadodariya
 
PDF
Xilinx lca and altera flex
anishgoel
 
PPT
Time andspacecomplexity
LAKSHMITHARUN PONNAM
 
PPTX
Webinar : P, NP, NP-Hard , NP - Complete problems
Ziyauddin Shaik
 
PDF
ARM Architecture Instruction Set
Dwight Sabio
 
PPTX
esign and Analysis of Algorithms Presentation.pptx
Niraj759370
 
PPTX
algo classification.pptx
ShivaniSharma335055
 

More Related Content

What's hot (20)

PPTX
Email HTTP And FTP
Shishpal Vishnoi
 
PPT
Backtracking
Vikas Sharma
 
PPTX
Interconnect timing model
Prachi Pandey
 
PPT
Divide and conquer
Dr Shashikant Athawale
 
PDF
Session 6 sv_randomization
Nirav Desai
 
PDF
UVM Methodology Tutorial
Arrow Devices
 
PPT
Operating System - Monitors (Presentation)
Experts Desk
 
PPTX
Round Robin Algorithm.pptx
Sanad Bhowmik
 
PPTX
Specification-of-tokens
Dattatray Gandhmal
 
PPTX
System verilog coverage
Pushpa Yakkala
 
PPTX
8 queens problem using back tracking
Tech_MX
 
PPTX
Directed Acyclic Graph Representation of basic blocks
Mohammad Vaseem Akaram
 
PPTX
Deadlocks in operating system
Sara Ali
 
PPTX
Computer architecture instruction formats
Mazin Alwaaly
 
PPTX
Signed Addition And Subtraction
Keyur Vadodariya
 
PDF
Xilinx lca and altera flex
anishgoel
 
PPT
Time andspacecomplexity
LAKSHMITHARUN PONNAM
 
PPTX
Webinar : P, NP, NP-Hard , NP - Complete problems
Ziyauddin Shaik
 
PDF
ARM Architecture Instruction Set
Dwight Sabio
 
Email HTTP And FTP
Shishpal Vishnoi
 
Backtracking
Vikas Sharma
 
Interconnect timing model
Prachi Pandey
 
Divide and conquer
Dr Shashikant Athawale
 
Session 6 sv_randomization
Nirav Desai
 
UVM Methodology Tutorial
Arrow Devices
 
Operating System - Monitors (Presentation)
Experts Desk
 
Round Robin Algorithm.pptx
Sanad Bhowmik
 
Specification-of-tokens
Dattatray Gandhmal
 
System verilog coverage
Pushpa Yakkala
 
8 queens problem using back tracking
Tech_MX
 
Directed Acyclic Graph Representation of basic blocks
Mohammad Vaseem Akaram
 
Deadlocks in operating system
Sara Ali
 
Computer architecture instruction formats
Mazin Alwaaly
 
Signed Addition And Subtraction
Keyur Vadodariya
 
Xilinx lca and altera flex
anishgoel
 
Time andspacecomplexity
LAKSHMITHARUN PONNAM
 
Webinar : P, NP, NP-Hard , NP - Complete problems
Ziyauddin Shaik
 
ARM Architecture Instruction Set
Dwight Sabio
 

Similar to Dynamic programming, Branch and bound algorithm & Greedy algorithms (20)

PPTX
esign and Analysis of Algorithms Presentation.pptx
Niraj759370
 
PPTX
algo classification.pptx
ShivaniSharma335055
 
PDF
heuristic search Techniques and game playing.pdf
vijeta3feb
 
PDF
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
MAJDABDALLAH3
 
PPTX
Greedy method class 11
Kumar
 
PPTX
Greedy Method unit-2(Design and analysis of algorithms).pptx
shivani366010
 
PPT
Dynamic programming 2
Roy Thomas
 
PPTX
Introduction to dynamic programming
Amisha Narsingani
 
PPTX
Analysis and Design of Algorithms
Bulbul Agrawal
 
PDF
Linear Models for Engineering applications
KalinduDilanjan
 
PDF
L21_L27_Unit_5_Dynamic_Programming Computer Science
priyanshukumarbt23cs
 
PPTX
Module 2ppt.pptx divid and conquer method
JyoReddy9
 
PPTX
7. Algorithm Design and analysis ppt.pptx
deivasigamani9
 
PPTX
Greedy algorithm for design and analysis
JavedKhan524377
 
PPTX
CH-1.1 Introduction (1).pptx
satvikkushwaha1
 
PPT
Greedy algorithm
CHANDAN KUMAR
 
PDF
Algo Strategies and explaination ppt.pdf
sayalishivarkar1
 
PPTX
Introduction to Dynamic Programming, Principle of Optimality
Bhavin Darji
 
PPTX
Introductions to Problem solvings.pptx
Guna Dhondwad
 
PDF
Unit V.pdf
KPRevathiAsstprofITD
 
esign and Analysis of Algorithms Presentation.pptx
Niraj759370
 
algo classification.pptx
ShivaniSharma335055
 
heuristic search Techniques and game playing.pdf
vijeta3feb
 
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
MAJDABDALLAH3
 
Greedy method class 11
Kumar
 
Greedy Method unit-2(Design and analysis of algorithms).pptx
shivani366010
 
Dynamic programming 2
Roy Thomas
 
Introduction to dynamic programming
Amisha Narsingani
 
Analysis and Design of Algorithms
Bulbul Agrawal
 
Linear Models for Engineering applications
KalinduDilanjan
 
L21_L27_Unit_5_Dynamic_Programming Computer Science
priyanshukumarbt23cs
 
Module 2ppt.pptx divid and conquer method
JyoReddy9
 
7. Algorithm Design and analysis ppt.pptx
deivasigamani9
 
Greedy algorithm for design and analysis
JavedKhan524377
 
CH-1.1 Introduction (1).pptx
satvikkushwaha1
 
Greedy algorithm
CHANDAN KUMAR
 
Algo Strategies and explaination ppt.pdf
sayalishivarkar1
 
Introduction to Dynamic Programming, Principle of Optimality
Bhavin Darji
 
Introductions to Problem solvings.pptx
Guna Dhondwad
 
Unit V.pdf
KPRevathiAsstprofITD
 
Ad

More from Dr. SURBHI SAROHA (20)

PPTX
Deep learning(UNIT 3) BY Ms SURBHI SAROHA
Dr. SURBHI SAROHA
 
PPTX
MOBILE COMPUTING UNIT 2 by surbhi saroha
Dr. SURBHI SAROHA
 
PPTX
Mobile Computing UNIT 1 by surbhi saroha
Dr. SURBHI SAROHA
 
PPTX
DEEP LEARNING (UNIT 2 ) by surbhi saroha
Dr. SURBHI SAROHA
 
PPTX
Introduction to Deep Leaning(UNIT 1).pptx
Dr. SURBHI SAROHA
 
PPTX
Cloud Computing (Infrastructure as a Service)UNIT 2
Dr. SURBHI SAROHA
 
PPTX
Management Information System(Unit 2).pptx
Dr. SURBHI SAROHA
 
PPTX
Searching in Data Structure(Linear search and Binary search)
Dr. SURBHI SAROHA
 
PPTX
Management Information System(UNIT 1).pptx
Dr. SURBHI SAROHA
 
PPTX
Introduction to Cloud Computing(UNIT 1).pptx
Dr. SURBHI SAROHA
 
PPTX
JAVA (UNIT 5)
Dr. SURBHI SAROHA
 
PPTX
DBMS (UNIT 5)
Dr. SURBHI SAROHA
 
PPTX
DBMS UNIT 4
Dr. SURBHI SAROHA
 
PPTX
JAVA(UNIT 4)
Dr. SURBHI SAROHA
 
PPTX
OOPs & C++(UNIT 5)
Dr. SURBHI SAROHA
 
PPTX
OOPS & C++(UNIT 4)
Dr. SURBHI SAROHA
 
PPTX
DBMS UNIT 3
Dr. SURBHI SAROHA
 
PPTX
JAVA (UNIT 3)
Dr. SURBHI SAROHA
 
PPTX
Keys in dbms(UNIT 2)
Dr. SURBHI SAROHA
 
PPTX
DBMS (UNIT 2)
Dr. SURBHI SAROHA
 
Deep learning(UNIT 3) BY Ms SURBHI SAROHA
Dr. SURBHI SAROHA
 
MOBILE COMPUTING UNIT 2 by surbhi saroha
Dr. SURBHI SAROHA
 
Mobile Computing UNIT 1 by surbhi saroha
Dr. SURBHI SAROHA
 
DEEP LEARNING (UNIT 2 ) by surbhi saroha
Dr. SURBHI SAROHA
 
Introduction to Deep Leaning(UNIT 1).pptx
Dr. SURBHI SAROHA
 
Cloud Computing (Infrastructure as a Service)UNIT 2
Dr. SURBHI SAROHA
 
Management Information System(Unit 2).pptx
Dr. SURBHI SAROHA
 
Searching in Data Structure(Linear search and Binary search)
Dr. SURBHI SAROHA
 
Management Information System(UNIT 1).pptx
Dr. SURBHI SAROHA
 
Introduction to Cloud Computing(UNIT 1).pptx
Dr. SURBHI SAROHA
 
JAVA (UNIT 5)
Dr. SURBHI SAROHA
 
DBMS (UNIT 5)
Dr. SURBHI SAROHA
 
DBMS UNIT 4
Dr. SURBHI SAROHA
 
JAVA(UNIT 4)
Dr. SURBHI SAROHA
 
OOPs & C++(UNIT 5)
Dr. SURBHI SAROHA
 
OOPS & C++(UNIT 4)
Dr. SURBHI SAROHA
 
DBMS UNIT 3
Dr. SURBHI SAROHA
 
JAVA (UNIT 3)
Dr. SURBHI SAROHA
 
Keys in dbms(UNIT 2)
Dr. SURBHI SAROHA
 
DBMS (UNIT 2)
Dr. SURBHI SAROHA
 
Ad

Recently uploaded (20)

PDF
English 3 Quarter 1_LEwithLAS_Week 1.pdf
DeAsisAlyanajaneH
 
PPTX
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
 
PPTX
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
PPTX
June 2025 Progress Update With Board Call_In process.pptx
International Society of Service Innovation Professionals
 
PPTX
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
PPTX
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
PDF
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
PDF
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
Kweku Zurek
 
PDF
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
 
PPTX
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
PPTX
INDUCTIVE EFFECT slide for first prof pharamacy students
SHABNAM FAIZ
 
PDF
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
PPTX
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
Mayvel Nadal
 
PPT
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 
PPTX
Photo chemistry Power Point Presentation
mprpgcwa2024
 
PDF
VCE Literature Section A Exam Response Guide
jpinnuck
 
PPTX
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT Kharagpur Quiz Club
 
PPTX
List View Components in Odoo 18 - Odoo Slides
Celine George
 
PPTX
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
PPTX
Wage and Salary Computation.ppt.......,x
JosalitoPalacio
 
English 3 Quarter 1_LEwithLAS_Week 1.pdf
DeAsisAlyanajaneH
 
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
June 2025 Progress Update With Board Call_In process.pptx
International Society of Service Innovation Professionals
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
Kweku Zurek
 
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
 
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
INDUCTIVE EFFECT slide for first prof pharamacy students
SHABNAM FAIZ
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
Mayvel Nadal
 
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 
Photo chemistry Power Point Presentation
mprpgcwa2024
 
VCE Literature Section A Exam Response Guide
jpinnuck
 
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT Kharagpur Quiz Club
 
List View Components in Odoo 18 - Odoo Slides
Celine George
 
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
Wage and Salary Computation.ppt.......,x
JosalitoPalacio
 

Dynamic programming, Branch and bound algorithm & Greedy algorithms

  • 2. SYLLABUS • Dynamic programming • Branch and bound algorithm • Greedy algorithms
  • 3. DYNAMIC PROGRAMMING • The following are the steps that the dynamic programming follows: • It breaks down the complex problem into simpler subproblems. • It finds the optimal solution to these sub-problems. • It stores the results of subproblems (memoization). The process of storing the results of subproblems is known as memorization. • It reuses them so that same sub-problem is calculated more than once. • Finally, calculate the result of the complex problem.
  • 4. CONT…… • Dynamic programming is a technique that breaks the problems into sub-problems, and saves the result for future purposes so that we do not need to compute the result again. • The subproblems are optimized to optimize the overall solution is known as optimal substructure property. • The main use of dynamic programming is to solve optimization problems. • Here, optimization problems mean that when we are trying to find out the minimum or the maximum solution of a problem. • The dynamic programming guarantees to find the optimal solution of a problem if the solution exists.
  • 5. APPLICATIONS OF DYNAMIC PROGRAMMING APPROACH • Matrix Chain Multiplication • Longest Common Subsequence • Travelling Salesman Problem
  • 6. BRANCH AND BOUND ALGORITHM • Branch and bound algorithms are used to find the optimal solution for combinatory, discrete, and general mathematical optimization problems. • In general, given an NP-Hard problem, a branch and bound algorithm explores the entire search space of possible solutions and provides an optimal solution. • A branch and bound algorithm consist of stepwise enumeration of possible candidate solutions by exploring the entire search space. With all the possible solutions, we first build a rooted decision tree. The root node represents the entire search space.
  • 8. CONT….. • Here, each child node is a partial solution and part of the solution set. Before constructing the rooted decision tree, we set an upper and lower bound for a given problem based on the optimal solution. At each level, we need to make a decision about which node to include in the solution set. At each level, we explore the node with the best bound. In this way, we can find the best and optimal solution fast. • Now it is crucial to find a good upper and lower bound in such cases. We can find an upper bound by using any local optimization method or by picking any point in the search space. On the other hand, we can obtain a lower bound from convex relaxation or duality. • In general, we want to partition the solution set into smaller subsets of solution. Then we construct a rooted decision tree, and finally, we choose the best possible subset (node) at each level to find the best possible solution set.
  • 9. GREEDY ALGORITHMS • Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. So the problems where choosing locally optimal also leads to global solution are best fit for Greedy. • For example consider the Fractional Knapsack Problem. The local optimal strategy is to choose the item that has maximum value vs weight ratio. This strategy also leads to global optimal solution because we allowed to take fractions of an item. • A greedy algorithm is an approach for solving a problem by selecting the best option available at the moment. It doesn't worry whether the current best result will bring the overall optimal result. • The algorithm never reverses the earlier decision even if the choice is wrong. It works in a top-down approach. • This algorithm may not produce the best result for all the problems. It's because it always goes for the local best choice to produce the global best result.
  • 11. ADVANTAGES OF GREEDY APPROACH • The algorithm is easier to describe. • This algorithm can perform better than other algorithms (but, not in all cases). • Drawback of Greedy Approach • As mentioned earlier, the greedy algorithm doesn't always produce the optimal solution. This is the major disadvantage of the algorithm