overview of algorithm design

9
Overview of Algorithm Design Partha P Chakrabarti Department of CSE, IIT Kharagpur T10KT Main Workshop May 25, 2015

Upload: saraah-ghori

Post on 09-Apr-2016

216 views

Category:

Documents


1 download

DESCRIPTION

ALgorithm Design

TRANSCRIPT

Page 1: Overview of Algorithm Design

Overview of Algorithm Design

Partha P Chakrabarti

Department of CSE, IIT KharagpurT10KT Main Workshop

May 25, 2015

Page 2: Overview of Algorithm Design

Developing a ‘Process’ for a Beginner to Learn Algorithm Design

• Problem Specification– Input, Output, Constraints

• Algorithm Features– Termination, Functional Correctness, Efficiency,

User Interface / Interaction, Implementation, Error Handling, Documentation

• An Overall Solution Strategy– Initial Solution, Design Space Exploration and

Analysis, Algorithm Finalization, Data Structuring• Design, Analysis: Algorithm + Data Structure

Page 3: Overview of Algorithm Design

Problem SpecificationUnambiguously specify the INPUTS, OUTPUTS, CONDITIONS / CONSTRAINTS. Make use of logical operations and mathematical symbols to the extent possible.Additionally give examples to explain the specification given where special cases are properly highlighted)

• Finding the smallest of n integers.• Sorting a set of integers.• Finding the median of a set of numbers.• Finding the number of matches of a pattern in a string.

Page 4: Overview of Algorithm Design

Modelling Problem Specification• Modelling, Input, Output, Constraints to structures• Use of Real-Life like Examples

– Finding a route in a map– Crypt-arithmetic Problem– Telephone Line Connection Problem– Time Table Scheduling– Stamp Selection Problem– Pumping Water in a City– Travelling Salesperson– Robber’s Dilemma

• Mapping to Models– Combinatorial, Matrices, Graphs, Logic, Constraint Satisfaction /

Optimization Framework, ILP

Page 5: Overview of Algorithm Design

Basic Steps Towards A Structured Algorithm Design

• Initial Solution• Solution Space Creation • Solution Space Explorations• Analysis of Complexity• Finalization of Options• Data Structuring

Page 6: Overview of Algorithm Design

Detailing the Process• Initial Solution by Recursive Definition• Analysis by Recurrence Relations• Asymptotic Complexity • Opening up the Recursion Space• Traversal of the Recursion Space• Optimal Choice / Balancing the recursion• Choosing the final solution• Identifying need / sources for memorization• Data Structuring

Page 7: Overview of Algorithm Design

Demonstration by Examples• Finding the largest of n integers• Largest and Smallest• Largest and second largest• Finding Fibonacci Numbers• Sorting and Searching• (Route Planning) Shortest Path• (Telephone Post Wiring) Spanning Tree (What about the

Telephone Post Placement?)• (Stamp Selection Problem) Sub-Set Sum• (Water Pumping) Max Flow Problem• (Time Table Scheduling) Constraint Satisfaction• Travelling Salesperson

Page 8: Overview of Algorithm Design

Efficient Algorithms, Hard Problems• Time and Space Complexity

– Asymptotic Complexity– Use Trick Questions

• Adding arbitrarily large numbers• The n = 2*n loop

– Space and Recursion– Output sensitive algorithms (Tower of Hanoi)

• Polynomial Time Algorithms• Polynomial Space Algorithms• Hard Problems

– NP Complete, NP Hard– Exponential Time– Exponential Space

• Approximation• Randomization

Page 9: Overview of Algorithm Design

Thank You