Advanced Algorithms Analysis and Design

Slides:



Advertisements
Similar presentations
Analysis of Computer Algorithms
Advertisements

NP-Completeness.
Introduction to Algorithms Rabie A. Ramadan rabieramadan.org 2 Some of the sides are exported from different sources.
ALGORITHMS Introduction. Definition Algorithm: Any well-defined computational procedure that takes some value or set of values as input and produces some.
I Advanced Algorithms Analysis. What is Algorithm?  A computer algorithm is a detailed step-by-step method for solving a problem by using a computer.
Introduction to Analysis of Algorithms
Complexity Analysis (Part I)
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
Chapter 2 The Algorithmic Foundations of Computer Science
1 Data Structures A program solves a problem. A program solves a problem. A solution consists of: A solution consists of:  a way to organize the data.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
DATA STRUCTURE Subject Code -14B11CI211.
Design & Analysis of Algorithms Introduction. Introduction Algorithms are the ideas behind computer programs. An algorithm is the thing which stays the.
CSC 201 Analysis and Design of Algorithms Lecture 03: Introduction to a CSC 201 Analysis and Design of Algorithms Lecture 03: Introduction to a lgorithms.
Lecture 2 Computational Complexity
Analysis of Algorithms
Analysis of algorithms Analysis of algorithms is the branch of computer science that studies the performance of algorithms, especially their run time.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Design & Analysis of Algorithms Lecture 1 Introduction.
Program Efficiency & Complexity Analysis. Algorithm Review An algorithm is a definite procedure for solving a problem in finite number of steps Algorithm.
MS 101: Algorithms Instructor Neelima Gupta
Umans Complexity Theory Lectures Lecture 1a: Problems and Languages.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
 FUNDAMENTALS OF ALGORITHMS.  FUNDAMENTALS OF DATA STRUCTURES.  TREES.  GRAPHS AND THEIR APPLICATIONS.  STORAGE MANAGEMENT.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
1.  A step by step process to solve any problem is called algorithm.  Algorithm is a process which take some values as input and provide us output.
Advanced Algorithms Analysis and Design
Design and Analysis of Algorithms Faculty Name : Ruhi Fatima Course Description This course provides techniques to prove.
FURQAN MAJEED ALGORITHMS. A computer algorithm is a detailed step-by-step method for solving a problem by using a computer. An algorithm is a sequence.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
Introduction To Algorithm and Data Structures Course Teacher: Moona Kanwal -Algorithm Design -Algorithm Analysis -Data structures -Abstract Data Type.
Algorithm Complexity is concerned about how fast or slow particular algorithm performs.
Complexity Analysis (Part I)
CMPT 438 Algorithms.
Introduction to Algorithms
Design and Analysis of Algorithms (09 Credits / 5 hours per week)
Advanced Algorithms Analysis and Design
TK3043 Analysis and Design of Algorithms
Analysis of Algorithms
Introduction Algorithms Order Analysis of Algorithm
Big-O notation.
Unit 1. Sorting and Divide and Conquer
Chapter 1 Introduction Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
DATA STRUCTURES AND OBJECT ORIENTED PROGRAMMING IN C++
Introduction to Algorithms
Courtsey & Copyright: DESIGN AND ANALYSIS OF ALGORITHMS Courtsey & Copyright:
Algorithm Analysis CSE 2011 Winter September 2018.
Course Description Algorithms are: Recipes for solving problems.
Algorithms Furqan Majeed.
CS 583 Fall 2006 Analysis of Algorithms
CS 3343: Analysis of Algorithms
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Objective of This Course
Introduction to Algorithms Analysis
COSC 320 Advanced Data Structures and Algorithm Analysis
Algorithm Analysis and Design
CSE 2010: Algorithms and Data Structures Algorithms
Asst. Dr.Surasak Mungsing
Introduction to Algorithms
Course Description Algorithms are: Recipes for solving problems.
Design and Analysis of Algorithms
INTRODUCTION TO ALOGORITHM DESIGN STRATEGIES
Complexity Analysis (Part I)
Design and Analysis of Algorithms
Chapter 1 Introduction Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Complexity Analysis (Part I)
Advanced Analysis of Algorithms
Algorithms and Data Structures
Presentation transcript:

Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Quaid-i-Azam University, Islamabad M. Phil Mathematics: 1991-93 M. Sc. Mathematics: 1989-91 Quaid-i-Azam University, Islamabad M. Phil Mathematics: 1991-93 M. Sc. Nuclear Engineering: 1993-94 PhD Computer Science: 2000-04 Kyushu University, Japan Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Objective of This Course Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking new algorithms Advanced designing techniques Real world problems will be taken as examples To create feelings about usefulness of this course Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Expected Results Argue and prove correctness of algorithms On successful completion, students will be able to Argue and prove correctness of algorithms Derive and solve mathematical models of problems Reasoning when an algorithm calls certain approach Analyze average and worst-case running times Integrating approaches in dynamic and greedy algos. Use of graph theory in problems solving Advanced topics such as Computational geometry, number theory etc. Several other algorithms such as String matching, NP completeness, approximate algorithms etc. Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Lecture No 1 Introduction (What, Why and Where Algorithms . . .) Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Today Covered In this lecture we will cover the following What is Algorithm? Designing Techniques Model of Computation Algorithms as a technology Algorithms and other technologies Importance of algorithms Difference in Users and Developers Kinds of problems solved by algorithms Conclusion Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

What is Algorithm? Algorithm Input output A computer algorithm is a detailed step-by-step method for solving a problem by using a computer. An algorithm is a sequence of unambiguous instructions for solving a problem in a finite amount of time. An Algorithm is well defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values as output. More generally, an Algorithm is any well defined computational procedure that takes collection of elements as input and produces a collection of elements as output. Algorithm Input output Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Popular Algorithms, Factors of Dependence Most basic and popular algorithms are Sorting algorithms Searching algorithms Which algorithm is best? Mainly, it depends upon various factors, for example in case of sorting The number of items to be sorted The extent to which the items are already sorted Possible restrictions on the item values The kind of storage device to be used etc. Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

One Problem, Many Algorithms The statement of the problem specifies, in general terms, the desired input/output relationship. Algorithm The algorithm describes a specific computational procedure for achieving input/output relationship. Example One might need to sort a sequence of numbers into non-decreasing order. Algorithms Various algorithms e.g. merge sort, quick sort, heap sorts etc. Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Important Designing Techniques Brute Force Straightforward, naive approach Mostly expensive Divide-and-Conquer Divide into smaller sub-problems Iterative Improvement Improve one change at a time Decrease-and-Conquer Decrease instance size Transform-and-Conquer Modify problem first and then solve it Space and Time Tradeoffs Use more space now to save time later Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Some of the Important Designing Techniques Greedy Approach Locally optimal decisions, can not change once made. Efficient Easy to implement The solution is expected to be optimal Every problem may not have greedy solution Dynamic programming Decompose into sub-problems like divide and conquer Sub-problems are dependant Record results of smaller sub-problems Re-use it for further occurrence Mostly reduces complexity exponential to polynomial Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Problem Solving Phases Analysis How does system work? Breaking a system down to known components How components (processes) relate to each other Breaking a process down to known functions Synthesis Building tools Building functions with supporting tools Composing functions to form a process How components should be put together? Final solution Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Problem Solving Process Strategy Algorithm Input Output Steps Analysis Correctness Time & Space Optimality Implementation Verification Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Model of Computation (Assumptions) Design assumption Level of abstraction which meets our requirements Neither more nor less e.g. [0, 1] infinite continuous interval Analysis independent of the variations in Machine Operating system Programming languages Compiler etc. Low-level details will not be considered Our model will be an abstraction of a standard generic single-processor machine, called a random access machine or RAM. Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Model of Computation (Assumptions) A RAM is assumed to be an idealized machine Infinitely large random-access memory Instructions execute sequentially Every instruction is in fact a basic operation on two values in the machines memory which takes unit time. These might be characters or integers. Example of basic operations include Assigning a value to a variable Arithmetic operation (+, - , × , /) on integers Performing any comparison e.g. a < b Boolean operations Accessing an element of an array. Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Model of Computation (Assumptions) In theoretical analysis, computational complexity Estimated in asymptotic sense, i.e. Estimating for large inputs Big O, Omega, Theta etc. notations are used to compute the complexity Asymptotic notations are used because different implementations of algorithm may differ in efficiency Efficiencies of two given algorithm are related By a constant multiplicative factor Called hidden constant. Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Drawbacks in Model of Computation First poor assumption We assumed that each basic operation takes constant time, i.e. model allows Adding Multiplying Comparing etc. two numbers of any length in constant time Addition of two numbers takes a unit time! Not good because numbers may be arbitrarily Addition and multiplication both take unit time! Again very bad assumption Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Model of Computation not so Bad Finally what about Our Model? But with all these weaknesses, our model is not so bad because we have to give the Comparison not the absolute analysis of any algorithm. We have to deal with large inputs not with the small size Model seems to work well describing computational power of modern nonparallel machines Can we do Exact Measure of Efficiency ? Exact, not asymptotic, measure of efficiency can be sometimes computed but it usually requires certain assumptions concerning implementation Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Summary : Computational Model Analysis will be performed with respect to this computational model for comparison of algorithms We will give asymptotic analysis not detailed comparison i.e. for large inputs We will use generic uniprocessor random-access machine (RAM) in analysis All memory equally expensive to access No concurrent operations All reasonable instructions take unit time, except, of course, function calls Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

Conclusion What, Why and Where Algorithms? Designing Techniques Problem solving Phases and Procedure Model of computations Major assumptions at design and analysis level Merits and demerits, justification of assumptions taken We proved that algorithm is a technology Compared algorithmic technology with others Discussed importance of algorithms In almost all areas of computer science and engineering Algorithms make difference in users and developers Dr Nazir A. Zafar Advanced Algorithms Analysis and Design