1
Summary: Design Methods
for Algorithms
Andreas Klappenecker
Design Methods
We have discussed examples of the
following algorithm design principles:
• Dynamic Programming Paradigm
• Greedy Paradigm
• Divide-and-Conquer Paradigm
2
Main Question
When can one successfully use one of
these algorithm design paradigms to solve
a problem?
3
Dynamic Programming
4
Dynamic Programming
The development of a dynamic programming algorithm
can be subdivided into the following steps:
1. Characterize the structure of an optimal solution
2. Recursively define the value of an optimal solution
3. Compute the value of an optimal solution in a
bottom-up fashion
4. Construct an optimal solution from computed
information
5
Key Question
• When can we apply the dynamic
programming paradigm?
6
Optimal Substructure
A problem exhibits optimal substructure
if and only if an optimal solution to the
problem contains within it optimal
solutions to subproblems.
Whenever a problem exhibits optimal
substructure, it is an indication that a dynamic
programming or greedy strategy might apply.
7
Overlapping Subproblems
A second indication that dynamic programming
might be applicable is that the space of
subproblems must be small, meaning that a
recursive algorithm for the problem solves the
same subproblems over and over.
Typically, the total number of distinct
subproblems is a polynomial in the input size.
8
Overlapping Subproblems
When a recursive algorithm revisits the
same problem over and over again, then
we say that the optimization problem has
overlapping subproblems.
Here two subproblems are called
overlapping if and only if they really are
the same subproblem that occurs as a
subproblem of different problems. 9
Note
If a recursive algorithm solving the
problem creates always new subproblems,
then this is an indication that divide-and-
conquer methods rather than dynamic
programming might apply.
10
Greedy Algorithms
11
Greedy Algorithms
The development of a greedy algorithm can be separated
into the following steps:
1. Cast the optimization problem as one in which we make
a choice and are left with one subproblem to solve.
2. Prove that there is always an optimal solution to the
original problem that makes the greedy choice, so
that the greedy choice is always safe.
3. Demonstrate that, having made the greedy choice,
what remains is a subproblem with the property that
if we combine an optimal solution to the subproblem
with the greedy choice that we have made, we arrive
at an optimal solution to the original problem. 12
Greedy-Choice Property
The greedy choice property is that a
globally optimal solution can be arrived at
by making a locally optimal (=greedy)
choice.
13
Optimal Substructure
A problem exhibits optimal substructure
if and only if an optimal solution to the
problem contains within it optimal
solutions to subproblems.
14
Divide-and-Conquer
15
Divide-and-Conquer
A divide and conquer method can be used for problems
that can be solved by recursively breaking them down
into two or more sub-problems of the same (or related)
type, until these become simple enough to be solved
directly. The solutions to the sub-problems are then
combined to give a solution to the original problem.
This approach is particularly successful when the
number of subproblems remain small in each step and
combining the solutions is easily done.
16

More Related Content

PPT
Algorithm Design Presentation
PDF
PPTX
esign and Analysis of Algorithms Presentation.pptx
PPTX
Greedy algorithm for design and analysis
PDF
Algo Strategies and explaination ppt.pdf
PPTX
Algorithm paradigms
PPTX
Divide and Conquer / Greedy Techniques
PDF
Unit 4 of design and analysis of algorithms
Algorithm Design Presentation
esign and Analysis of Algorithms Presentation.pptx
Greedy algorithm for design and analysis
Algo Strategies and explaination ppt.pdf
Algorithm paradigms
Divide and Conquer / Greedy Techniques
Unit 4 of design and analysis of algorithms

Similar to csce411-set7.ppt (20)

PDF
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
PPT
Greedymethod
PDF
L21_L27_Unit_5_Dynamic_Programming Computer Science
PPTX
Dynamic programming
PPTX
Applied Algorithms Introduction to Algorithms.pptx
PPTX
data structure and algorithm (Advanced algorithm Stretegies)
PPT
35 algorithm-types
PPTX
algorithm design.pptx
PPTX
Algorithm strategies in c++
PPTX
Design and Analysis of Algorithm-Lecture.pptx
PPTX
algo classification.pptx
PDF
Analysis and Design of Algorithms notes
PPTX
Greedy Method unit-2(Design and analysis of algorithms).pptx
PPTX
Chapter 5.pptx
PPTX
Introduction to dynamic programming
PPTX
ADA Unit 2.pptx
PPTX
DynamicProgramming.pptx
PDF
Divide and Conquer Case Study
PPT
ADT(Algorithm Design Technique Backtracking algorithm).ppt
PPT
Algorithm designs and its technique.ppt
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Greedymethod
L21_L27_Unit_5_Dynamic_Programming Computer Science
Dynamic programming
Applied Algorithms Introduction to Algorithms.pptx
data structure and algorithm (Advanced algorithm Stretegies)
35 algorithm-types
algorithm design.pptx
Algorithm strategies in c++
Design and Analysis of Algorithm-Lecture.pptx
algo classification.pptx
Analysis and Design of Algorithms notes
Greedy Method unit-2(Design and analysis of algorithms).pptx
Chapter 5.pptx
Introduction to dynamic programming
ADA Unit 2.pptx
DynamicProgramming.pptx
Divide and Conquer Case Study
ADT(Algorithm Design Technique Backtracking algorithm).ppt
Algorithm designs and its technique.ppt
Ad

More from JoshCasas1 (19)

PPTX
Imaging and-design-for-online-environment-170327044139.pptx
PPTX
CALENDAR OF ACTIVITIES LABORATORY HIGH SCHOOL.pptx
PPTX
EDITED ENROLLMENT INFOGRAPHICS final SY24-25.pptx
PPTX
Computer viruses and its advantages.pptx
PPTX
LESSON ABOUT COMPUTER DESKTOP FOR GRADE 7.pptx
PPTX
basiccomputeroperation-140809103113-phpapp01 (1).pptx
PPTX
Understanding Technologies In Education for the Third Quarter
PPTX
MOST SUCCESSFUL ENTREPRENEURS PRESENTATION (1).pptx
PPT
Combined 2nd Section 4900 Slides.ppt
PPT
Chapters_1_2.ppt
PPTX
JOSHUA A. CASAS (FILIPINO VALUES SYSTEM AND CHANGE).pptx
PPTX
L2 COMPUTER ETHICS PPT [Autosaved].pptx
PDF
Essential Access Exercises week 1-4.pdf
PPT
MS ACCESS DEFINING DESIGN VIEW AND DATASHEET VIEW.ppt
PDF
M0DULE 1-MS ACCESS Databases and Database Objects.pdf
PPT
Microsoft Access ppt.ppt
PDF
MICROSOFT ACCESS 2016Basics-Handouts and LESSON Introduction.pdf
PPT
Introduction to Microsoft Access2.ppt
PDF
LESSON 1- MICROSOFT ACCESS CREATING DATABASE.pdf
Imaging and-design-for-online-environment-170327044139.pptx
CALENDAR OF ACTIVITIES LABORATORY HIGH SCHOOL.pptx
EDITED ENROLLMENT INFOGRAPHICS final SY24-25.pptx
Computer viruses and its advantages.pptx
LESSON ABOUT COMPUTER DESKTOP FOR GRADE 7.pptx
basiccomputeroperation-140809103113-phpapp01 (1).pptx
Understanding Technologies In Education for the Third Quarter
MOST SUCCESSFUL ENTREPRENEURS PRESENTATION (1).pptx
Combined 2nd Section 4900 Slides.ppt
Chapters_1_2.ppt
JOSHUA A. CASAS (FILIPINO VALUES SYSTEM AND CHANGE).pptx
L2 COMPUTER ETHICS PPT [Autosaved].pptx
Essential Access Exercises week 1-4.pdf
MS ACCESS DEFINING DESIGN VIEW AND DATASHEET VIEW.ppt
M0DULE 1-MS ACCESS Databases and Database Objects.pdf
Microsoft Access ppt.ppt
MICROSOFT ACCESS 2016Basics-Handouts and LESSON Introduction.pdf
Introduction to Microsoft Access2.ppt
LESSON 1- MICROSOFT ACCESS CREATING DATABASE.pdf
Ad

Recently uploaded (20)

PPT
250152213-Excitation-SystemWERRT (1).ppt
PDF
Course Overview and Agenda cloud security
PDF
Alethe Consulting Corporate Profile and Solution Aproach
PPTX
artificialintelligenceai1-copy-210604123353.pptx
PDF
BIOCHEM CH2 OVERVIEW OF MICROBIOLOGY.pdf
PDF
The Evolution of Traditional to New Media .pdf
PDF
si manuel quezon at mga nagawa sa bansang pilipinas
PDF
Exploring The Internet Of Things(IOT).ppt
PPT
Ethics in Information System - Management Information System
PDF
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
DOCX
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
PDF
Containerization lab dddddddddddddddmanual.pdf
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PPTX
newyork.pptxirantrafgshenepalchinachinane
PDF
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
PDF
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
PPTX
The-Importance-of-School-Sanitation.pptx
PDF
Uptota Investor Deck - Where Africa Meets Blockchain
PPTX
module 1-Part 1.pptxdddddddddddddddddddddddddddddddddddd
PPTX
Mathew Digital SEO Checklist Guidlines 2025
250152213-Excitation-SystemWERRT (1).ppt
Course Overview and Agenda cloud security
Alethe Consulting Corporate Profile and Solution Aproach
artificialintelligenceai1-copy-210604123353.pptx
BIOCHEM CH2 OVERVIEW OF MICROBIOLOGY.pdf
The Evolution of Traditional to New Media .pdf
si manuel quezon at mga nagawa sa bansang pilipinas
Exploring The Internet Of Things(IOT).ppt
Ethics in Information System - Management Information System
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
Containerization lab dddddddddddddddmanual.pdf
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
newyork.pptxirantrafgshenepalchinachinane
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
The-Importance-of-School-Sanitation.pptx
Uptota Investor Deck - Where Africa Meets Blockchain
module 1-Part 1.pptxdddddddddddddddddddddddddddddddddddd
Mathew Digital SEO Checklist Guidlines 2025

csce411-set7.ppt

  • 1. 1 Summary: Design Methods for Algorithms Andreas Klappenecker
  • 2. Design Methods We have discussed examples of the following algorithm design principles: • Dynamic Programming Paradigm • Greedy Paradigm • Divide-and-Conquer Paradigm 2
  • 3. Main Question When can one successfully use one of these algorithm design paradigms to solve a problem? 3
  • 5. Dynamic Programming The development of a dynamic programming algorithm can be subdivided into the following steps: 1. Characterize the structure of an optimal solution 2. Recursively define the value of an optimal solution 3. Compute the value of an optimal solution in a bottom-up fashion 4. Construct an optimal solution from computed information 5
  • 6. Key Question • When can we apply the dynamic programming paradigm? 6
  • 7. Optimal Substructure A problem exhibits optimal substructure if and only if an optimal solution to the problem contains within it optimal solutions to subproblems. Whenever a problem exhibits optimal substructure, it is an indication that a dynamic programming or greedy strategy might apply. 7
  • 8. Overlapping Subproblems A second indication that dynamic programming might be applicable is that the space of subproblems must be small, meaning that a recursive algorithm for the problem solves the same subproblems over and over. Typically, the total number of distinct subproblems is a polynomial in the input size. 8
  • 9. Overlapping Subproblems When a recursive algorithm revisits the same problem over and over again, then we say that the optimization problem has overlapping subproblems. Here two subproblems are called overlapping if and only if they really are the same subproblem that occurs as a subproblem of different problems. 9
  • 10. Note If a recursive algorithm solving the problem creates always new subproblems, then this is an indication that divide-and- conquer methods rather than dynamic programming might apply. 10
  • 12. Greedy Algorithms The development of a greedy algorithm can be separated into the following steps: 1. Cast the optimization problem as one in which we make a choice and are left with one subproblem to solve. 2. Prove that there is always an optimal solution to the original problem that makes the greedy choice, so that the greedy choice is always safe. 3. Demonstrate that, having made the greedy choice, what remains is a subproblem with the property that if we combine an optimal solution to the subproblem with the greedy choice that we have made, we arrive at an optimal solution to the original problem. 12
  • 13. Greedy-Choice Property The greedy choice property is that a globally optimal solution can be arrived at by making a locally optimal (=greedy) choice. 13
  • 14. Optimal Substructure A problem exhibits optimal substructure if and only if an optimal solution to the problem contains within it optimal solutions to subproblems. 14
  • 16. Divide-and-Conquer A divide and conquer method can be used for problems that can be solved by recursively breaking them down into two or more sub-problems of the same (or related) type, until these become simple enough to be solved directly. The solutions to the sub-problems are then combined to give a solution to the original problem. This approach is particularly successful when the number of subproblems remain small in each step and combining the solutions is easily done. 16