Design and Analysis of Computer Algorithm (CS575-01)

Slides:



Advertisements
Similar presentations
Algorithm Design Techniques
Advertisements

Algorithm Design Methods (I) Fall 2003 CSE, POSTECH.
Algorithm Design Methods Spring 2007 CSE, POSTECH.
S. J. Shyu Chap. 1 Introduction 1 The Design and Analysis of Algorithms Chapter 1 Introduction S. J. Shyu.
Lecture 8 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
CS333 Algorithms
Chapter 9: Greedy Algorithms The Design and Analysis of Algorithms.
CS333/ Topic 11 CS333 - Introduction CS333 - Introduction General information Goals.
The Theory of NP-Completeness
Chapter 10: Algorithm Design Techniques
Design and Analysis of Algorithms Review of algorithm analysis Haidong Xue Summer 2012, at GSU.
Instructor: Dr. Sahar Shabanah Fall Lectures ST, 9:30 pm-11:00 pm Text book: M. T. Goodrich and R. Tamassia, “Data Structures and Algorithms in.
Fundamentals of Algorithms MCS - 2 Lecture # 7
Algorithms  Al-Khwarizmi, arab mathematician, 8 th century  Wrote a book: al-kitab… from which the word Algebra comes  Oldest algorithm: Euclidian algorithm.
INTRODUCTION. What is an algorithm? What is a Problem?
For Wednesday No reading No homework There will be homework for Friday, as well the program being due – plan ahead.
Lecture 12: Algorithm Review. General Problem Solving Methods Divide & Conquer Greedy Method Dynamic Programming Graph & Tree Traversal Backtracking Branch.
CS223 Advanced Data Structures and Algorithms 1 Review for Final Neil Tang 04/27/2010.
Design and Analysis of Algorithms (09 Credits / 5 hours per week) Sixth Semester: Computer Science & Engineering M.B.Chandak
Computer Science/Ch. Algorithmic Foundation of CS 4-1 Chapter 4 Chapter 4 Algorithmic Foundation of Computer Science.
CSE 340: Review (at last!) Measuring The Complexity Complexity is a function of the size of the input O() Ω() Θ() Complexity Analysis “same order” Order.
CES 592 Theory of Software Systems B. Ravikumar (Ravi) Office: 124 Darwin Hall.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Review Lecture Tuesday, 12/11/01.
Course Review Fundamental Structures of Computer Science Margaret Reid-Miller 28 April 2005.
2016/3/13Page 1 Semester Review COMP3040 Dept. Computer Science and Technology United International College.
Design and Analysis of Algorithms (09 Credits / 5 hours per week)
Analysis of Algorithms
Data Structures Lab Algorithm Animation.
Subject Name: Design and Analysis of Algorithm Subject Code: 10CS43
CSE 326: Data Structures: Advanced Topics
Foundations of Algorithm 유관우
Algorithm Design Methods
Major Design Strategies
Introduction Algorithms Order Analysis of Algorithm
CS 3343: Analysis of Algorithms
Summary of lectures Introduction to Algorithm Analysis and Design (Chapter 1-3). Lecture Slides Recurrence and Master Theorem (Chapter 4). Lecture Slides.
Courtsey & Copyright: DESIGN AND ANALYSIS OF ALGORITHMS Courtsey & Copyright:
Chapter 4 Divide-and-Conquer
COSC160: Data Structures Linked Lists
Introduction to Algorithms
CS 3343: Analysis of Algorithms
Design and Analysis of Algorithms (07 Credits / 4 hours per week)
Objective of This Course
Exam 2 LZW not on syllabus. 73% / 75%.
COSC 320 Advanced Data Structures and Algorithm Analysis
Topic: Divide and Conquer
CMPT 438 Algorithms Instructor: Tina Tian.
Course Contents: T1 Greedy Algorithm Divide & Conquer
CS 3343: Analysis of Algorithms
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Richard Anderson Lecture 30 NP-Completeness
CLASSES P AND NP.
3. Brute Force Selection sort Brute-Force string matching
3. Brute Force Selection sort Brute-Force string matching
Algorithm Design Methods
Algorithm Design Methods
Chapter 1 Introduction.
The Greedy Approach Young CS 530 Adv. Algo. Greedy.
Major Design Strategies
INTRODUCTION TO ALOGORITHM DESIGN STRATEGIES
Approximation Algorithms
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Department of Computer Science & Engineering
Design and Analysis of Algorithms (04 Credits / 4 hours per week)
Review for Final Neil Tang 05/01/2008
Major Design Strategies
Algorithm Design Methods
Algorithm Course Algorithms Lecture 3 Sorting Algorithm-1
3. Brute Force Selection sort Brute-Force string matching
Presentation transcript:

Design and Analysis of Computer Algorithm (CS575-01) Problems Strategy Efficiency Analysis Order Algorithm: Applying a technique to a problem results in a step-by-step procedure for solving problem. The step-by-step procedure is called an algorithm for the problem.

Examples Example: - Sort a list S of n numbers in non-decreasing order. The answer is the numbers in sorted sequence. - Determine whether the number x is in the list S of n numbers. The answer is yes if x is in S, and no if it is not - solution: Sequential search; Binary search - Add array members - Matrix multiplication

Importance of Algorithm Efficiency Time Storage Example - Sequential search versus binary search Basic operation: comparison Number of comparisons is grown in different rate - nth Fibonacci sequence Recursive versus iterative

Example: search strategy Sequential search vs. binary search Problem: determine whether x is in the sorted array S of n keys Inputs: positive integer n, sorted (non-decreasing order) array of keys S indexed from 1 to n, a key x Output: location, the location of x in S (0 if x is not in S)

Example: search strategy Sequential search: Basic operation: comparison Void Seqsearch(int n, const keytype S[], keytype x, index& location) { location=1; while(location<=n && S[location] != x) location++; if(location > n) location = 0; }

Example: search strategy Binary search: Basic operation: comparison Void Binsearch(int n, const keytype S[], keytype x, index& location) { index low, high, mid; low = 1; high =n; location=0; while(low<=high && location ==0) mid = floor((low+high)/2); if(x==S[mid]) location = mid; else if (x< S[mid]) high = mid -1; else(low = mid +1); }

Example: number of comparisons Sequential search: n 32 128 1024 1,048,576 Binary search: lg(n) + 1 6 8 11 21 Eg: S[1],…, S[16],…, S[24], S[28], S[30], S[31], S[32] (1st) (2nd) (3rd) (4th) (5th) (6th)

Analysis of Algorithm Complexity Input size Basic operation Time complexity - T(n) : Every-case time complexity - W(n): Worst-case time complexity - A(n): Average-case time complexity - B(n): Best-case time complexity n is the input size T(n) example - Add array members; Matrix multiplication; Exchange sort T(n) = n-1; n*n*n n(n-1)/2

Math preparation Induction Logarithm Sets Permutation and combination Limits Series Asymptotic growth functions and recurrence Probability theory

Programming preparation Data structure C C++

Presenting Commonly used algorithms Search (sequential, binary) Sort (mergesort, heapsort, quicksort, etc.) Traversal algorithms (breadth, depth, etc.) Shortest path (Floyd, Dijkstra) Spanning tree (Prim, Kruskal) Knapsack Traveling salesman Bin packing

Well known problem Problem: Given a map of North America, find the best route from New York to Orlando? Well known problem: what is it? Many efficient algorithms Choose appropriate one (e.g., Floyd’s algorithm for shortest paths using dynamic programming)

Another well known problem Problem: You got a job as a paper person. You want to find the shortest tour from your home to every person on your list? Well known problem: what is it? One solution to traveling salesperson problem: dynamic programming

Another well known problem (continued) No efficient algorithm to general problem Many heuristic and approximation algorithms (e.g., greedy heuristic) Choose appropriate one

Another well known problem (continued) Computer Graphics Scan conversion Flood Filling Ray tracing, …

Another well known problem (continued) Computational Geometry Find a convex hull Delaunay triangulation Voronoi Diagram Choose an efficient one

Design Methods or Strategies Divide and conquer Greedy Dynamic programming Backtrack Branch and bound Linear Programming

Not addressed (Advanced algorithms) Genetic algorithms Neural net algorithms Algebraic methods

The theory of NP completeness Many common problems are NP-complete ( traveling salesperson, knapsack,...) (NP: non-deterministic polynomial) Fast algorithms for solving NP-complete problems probably don’t exist Techniques such as approximation algorithms are used (e.g., minimum spanning tree prim’s algorithm with triangle inequality)

Are algorithms useful? Hardware Software Economics Biomedicine Computational geometry (graphics) Decision making ….. “Great algorithms are the poetry of computation”

Software Text processing Networks Data bases Compilers String matching, spell checking, and pretty print,… Networks Minimum spanning trees, routing algorithms, … Data bases Compilers

Engineering Optimization problem (e.g., finite element, energy minimization, dynamic simulation). Best feature selection for object representation and biometrics recognition (e.g., Genetic Algorithm) Mathematics: geometric simulation and approximation (e.g., algorithm approximation) Graphics visualization (e.g., area filling and scan conversion, 3D key framing). Signal analysis: FFT, Huffman coding, encryption, decryption…

Economics Transportation problems Scheduling problems Shortest paths, traveling salesman, knapsack, bin packing Scheduling problems Location problems (e.g., Voronoi Diagram) Manufacturing decisions

Social decisions The matching problem Assigning residents to hospitals Matching residents to medical program