INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

Post on 09-Jan-2022

1 views 0 download

Transcript of INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

INTRODUCTION TO RECURSIVEFORMULATIONS FOR ALGORITHM DESIGN: IV

Partha P ChakrabartiIndian Institute of Technology Kharagpur

Algorithm Design by Recursion Transformation1. Initial Solution

a. Recursive Definition – A set of Solutionsb. Inductive Proof of Correctnessc. Analysis Using Recurrence Relations

2. Exploration of Possibilitiesa. Decomposition or Unfolding of the Recursion Treeb. Examination of Structures formedc. Re-composition Properties

3. Choice of Solution & Complexity Analysisa. Balancing the Split, Choosing Pathsb. Identical Sub-problems

4. Data Structures & Complexity Analysisa. Remembering Past Computation for Futureb. Space Complexity

5. Final Algorithm & Complexity Analysisa. Traversal of the Recursion Treeb. Pruning

6. Implementationa. Available Memory, Time, Quality of Solution, etc

Algorithms and Programs Pseudo-Code Algorithms + Data Structures = Programs Initial Solutions + Analysis + Solution

Refinement + Data Structures = FinalAlgorithm

Use of Recursive Definitions as InitialSolutions

Recurrence Equations for Proofs andAnalysis

Solution Refinement through RecursionTransformation and Traversal

Data Structures for saving pastcomputation for future use

Coin Selection Problem

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P

First Recursive Definition

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P

Example

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P

Improved Recursive Definition

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P

Alternative Recursive Definition

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P

Example

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P

Traversal and Potential Pruning

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P

Finalizing the Algorithm

Partha P
Partha P
Partha P
Partha P

Special Case

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P

Summary

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P

Overview of Algorithm Design 1. Initial Solution

a. Recursive Definition – A set of Solutionsb. Inductive Proof of Correctnessc. Analysis Using Recurrence Relations

2. Exploration of Possibilitiesa. Decomposition or Unfolding of the Recursion Treeb. Examination of Structures formedc. Re-composition Properties

3. Choice of Solution & Complexity Analysisa. Balancing the Split, Choosing Pathsb. Identical Sub-problems

4. Data Structures & Complexity Analysisa. Remembering Past Computation for Futureb. Space Complexity

5. Final Algorithm & Complexity Analysisa. Traversal of the Recursion Treeb. Pruning

6. Implementationa. Available Memory, Time, Quality of Solution, etc

1. Core Methodsa. Divide and Conquerb. Greedy Algorithmsc. Dynamic Programmingd. Branch-and-Bounde. Analysis using Recurrencesf. Advanced Data Structuring

2. Important Problems to be addresseda. Sorting and Searchingb. Strings and Patternsc. Trees and Graphsd. Combinatorial Optimization

3. Complexity & Advanced Topicsa. Time and Space Complexityb. Lower Boundsc. Polynomial Time, NP-Hardd. Parallelizability, Randomization

Partha P

Thank you

Any Questions?