1

INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

INTRODUCTION TO RECURSIVEFORMULATIONS FOR ALGORITHM DESIGN: IV

Partha P ChakrabartiIndian Institute of Technology Kharagpur

Page 2: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

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

Page 3: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

Coin Selection Problem

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Page 4: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

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
Page 5: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

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
Page 6: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

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
Page 7: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

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
Page 8: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

Example

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Page 9: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

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
Page 10: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

Finalizing the Algorithm

Partha P
Partha P
Partha P
Partha P
Page 11: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

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
Page 12: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

Summary

Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Partha P
Page 13: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

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
Page 14: INTRODUCTION TO RECURSIVE FORMULATIONS FOR …

Thank you

Any Questions?