CSCE 411 Design and Analysis of Algorithms

Slides:



Advertisements
Similar presentations
Analysis of Computer Algorithms
Advertisements

MATH 224 – Discrete Mathematics
Analysis & Design of Algorithms (CSCE 321)
ALGORITHMS Introduction. Definition Algorithm: Any well-defined computational procedure that takes some value or set of values as input and produces some.
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
CS 253: Algorithms Syllabus Chapter 1 Appendix A.
Introduction to Analysis of Algorithms
CPSC 411, Fall 2008: Set 1 1 CPSC 411 Design and Analysis of Algorithms Set 1: Introduction and Review Prof. Jennifer Welch Fall 2008.
CSE 830: Design and Theory of Algorithms
CSE 830: Design and Theory of Algorithms
CSE 830: Design and Theory of Algorithms Dr. Eric Torng.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Instructor: Paul Beame TA: Gidon Shavit.
The Design and Analysis of Algorithms
Analysis of Algorithms COMP171 Fall Analysis of Algorithms / Slide 2 Introduction * What is Algorithm? n a clearly specified set of simple instructions.
Unit 1. Sorting and Divide and Conquer. Lecture 1 Introduction to Algorithm and Sorting.
Introduction to Algorithm design and analysis
HOW TO SOLVE IT? Algorithms. An Algorithm An algorithm is any well-defined (computational) procedure that takes some value, or set of values, as input.
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
ECOE 456/556: Algorithms and Computational Complexity Lecture 1 Serdar Taşıran.
Discrete Structures for Computing
Introduction to Algorithms (2 nd edition) by Cormen, Leiserson, Rivest & Stein Chapter 1: The Role of Algorithms in Computing (slides by N. Adlai A. DePano)
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
1Computer Sciences Department. Book: Introduction to Algorithms, by: Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Clifford Stein Electronic:
Program Efficiency & Complexity Analysis. Algorithm Review An algorithm is a definite procedure for solving a problem in finite number of steps Algorithm.
CSCE 411 Design and Analysis of Algorithms Set 1: Introduction Slides by Prof. Jennifer Welch Spring 2014 CSCE 411, Spring 2013: Set 1 1.
CS404 Design and Analysis of Algorithms BBy DDr. M V S Peri Sastry BB.E, PhD(BITS-Pilani)
Text Chapters 2 Analyzing Algorithms.  goal: predicting resources that an algorithm requires memory, communication bandwidth, hardware, memory, communication.
Introduction to design and analysis algorithm
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
CSCE 411 Design and Analysis of Algorithms Set 1: Introduction and Review Prof. Jennifer Welch Spring 2012 CSCE 411, Spring 2012: Set 1 1.
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
Design and Analysis of Algorithms Faculty Name : Ruhi Fatima Course Description This course provides techniques to prove.
Algorithm Design Techniques, Greedy Method – Knapsack Problem, Job Sequencing, Divide and Conquer Method – Quick Sort, Finding Maximum and Minimum, Dynamic.
ECOE 456/556: Algorithms and Computational Complexity
CMPT 438 Algorithms.
Design and Analysis of Algorithms
Advanced Algorithms Analysis and Design
Introduction to Algorithms
The Design and Analysis of Algorithms
Analysis of Algorithms
Lecture 1 Introduction/Overview Text: Chapters 1, 2 Wed. 1/28/04
Introduction Algorithms Order Analysis of Algorithm
Unit 1. Sorting and Divide and Conquer
Chapter 1 Introduction Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Introduction to Algorithms
Advance Analysis of Algorithms
Ch. 11 Theory of Computation
Courtsey & Copyright: DESIGN AND ANALYSIS OF ALGORITHMS Courtsey & Copyright:
Introduction CSE 1310 – Introduction to Computers and Programming
Algorithms Furqan Majeed.
CS 583 Fall 2006 Analysis of Algorithms
Introduction to Algorithms
Discrete Mathematics and Its Applications
CSCE 411 Design and Analysis of Algorithms
Definition In simple terms, an algorithm is a series of instructions to solve a problem (complete a task) We focus on Deterministic Algorithms Under the.
Objective of This Course
Ch 2: Getting Started Ming-Te Chi
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
3. Brute Force Selection sort Brute-Force string matching
Introduction to Algorithms
3. Brute Force Selection sort Brute-Force string matching
Discrete Mathematics in the Real World
Design and Analysis of Algorithms
Discrete Mathematics and Its Applications
DAA - Introduction Dr. Sashikala Mishra Associate Professor Department of Computer Engineering Hope Foundation’s INTERNATIONAL INSTITUTE OF INFORMATION.
Algorithm Course Algorithms Lecture 3 Sorting Algorithm-1
Chapter 1 Introduction Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
3. Brute Force Selection sort Brute-Force string matching
Presentation transcript:

CSCE 411 Design and Analysis of Algorithms Set 1: Introduction Dr. J. Michael Moore Fall 2014 Based primarily on slides by Prof. Jennifer Welch CSCE 411, Fall 2014: Set 1

Mechanics Sources: https://courses.cse.tamu.edu/jmichael/f14/411 [CLRS] (textbook) The Design and Analysis of Algorithms, Anany Levitin The Algorithm Design Manual, Steven S. Skiena CSCE 411, Fall 2014: Set 1

Introduction What is an algorithm? a step-by-step procedure to solve a problem every program is the instantiation of some algorithm http://blog.kovyrin.net/wp-content/uploads/2006/05/algorithm_c.png CSCE 411, Fall 2014: Set 1

Sorting Example Solves a general, well-specified problem given a sequence of n keys, a1,…,an, as input, produce as output a reordering b1,…,bn of the keys so that b1 ≤ b2 ≤ … ≤ bn. Problem has specific instances [Dopey, Happy, Grumpy] or [3,5,7,1,2,3] Algorithm takes every possible instance and produces output with desired properties insertion sort, quicksort, heapsort, … CSCE 411, Fall 2014: Set 1

Challenge Hard to design algorithms that are Need to know about correct efficient implementable Need to know about design and modeling techniques resources - don't reinvent the wheel CSCE 411, Fall 2014: Set 1

Correctness How do you know an algorithm is correct? produces the correct output on every input Since there are usually infinitely many inputs, it is not trivial Saying "it's obvious" can be dangerous often one's intuition is tricked by one particular kind of input CSCE 411, Fall 2014: Set 1

Tour Finding Problem Given a set of n points in the plane, what is the shortest tour that visits each point and returns to the beginning? application: robot arm that solders contact points on a circuit board; want to minimize movements of the robot arm How can you find it? CSCE 411, Fall 2014: Set 1

Finding a Tour: Nearest Neighbor start by visiting any point while not all points are visited choose unvisited point closest to last visited point and visit it return to first point works well here CSCE 411, Fall 2014: Set 1

Nearest Neighbor Counter-example -21 -5 -1 0 1 3 11 works poorly here CSCE 411, Fall 2014: Set 1

How to Prove Correctness? There exist formal methods even automated tools more advanced than this course In this course we will primarily rely on more informal reasoning about correctness Seeking counter-examples to proposed algorithms is important part of design process CSCE 411, Fall 2014: Set 1

Efficiency Software is always outstripping hardware Given a problem: need faster CPU, more memory for latest version of popular programs Given a problem: what is an efficient algorithm? what is the most efficient algorithm? does there even exist an algorithm? CSCE 411, Fall 2014: Set 1

How to Measure Efficiency Machine-independent way: analyze "pseudocode" version of algorithm assume idealized machine model one instruction takes one time unit "Big-Oh" notation order of magnitude as problem size increases Worst-case analyses safe, often occurs most often, average case often just as bad CSCE 411, Fall 2014: Set 1

Faster Algorithm vs. Faster CPU A faster algorithm running on a slower machine will always win for large enough instances Suppose algorithm S1 sorts n keys in 2n2 instructions Suppose computer C1 executes 1 billion instruc/sec When n = 1 million, takes 2000 sec Suppose algorithm S2 sorts n keys in 50nlog2n instructions Suppose computer C2 executes 10 million instruc/sec When n = 1 million, takes 100 sec CSCE 411, Fall 2014: Set 1

Caveat No point in finding fastest algorithm for part of the program that is not the bottleneck If program will only be run a few times, or time is not an issue (e.g., run overnight), then no point in finding fastest algorithm CSCE 411, Fall 2014: Set 1

Modeling the Real World Cast your application in terms of well-studied abstract data structures Concrete Abstract arrangement, tour, ordering, sequence permutation cluster, collection, committee, group, packaging, selection subsets hierarchy, ancestor/descendants, taxonomy trees network, circuit, web, relationship graph sites, positions, locations points shapes, regions, boundaries polygons text, characters, patterns strings CSCE 411, Fall 2014: Set 1

Real-World Applications Hardware design: VLSI chips Compilers Computer graphics: movies, video games Routing messages in the Internet Searching the Web Distributed file sharing Computer aided design and manufacturing Security: e-commerce, voting machines Multimedia: CD player, DVD, MP3, JPG, HDTV DNA sequencing, protein folding and many more! CSCE 411, Fall 2014: Set 1

Some Important Problem Types Sorting a set of items Searching among a set of items String processing text, bit strings, gene sequences Graphs model objects and their relationships Combinatorial find desired permutation, combination or subset Geometric graphics, imaging, robotics Numerical continuous math: solving equations, evaluating functions CSCE 411, Fall 2014: Set 1

Algorithm Design Techniques Brute Force & Exhaustive Search follow definition / try all possibilities Divide & Conquer break problem into distinct subproblems Transformation convert problem to another one Dynamic Programming break problem into overlapping subproblems Greedy repeatedly do what is best now Iterative Improvement repeatedly improve current solution Randomization use random numbers CSCE 411, Fall 2014: Set 1

Plan of the Course Cover a variety of fundamental algorithm design and analysis techniques as applied to a number of basic problems Organize by technique In the other direction, study some lower bounds, indicating inherent limitations for finding efficient algorithms including NP-completeness Learn about undecidability: some problems are unsolvable CSCE 411, Fall 2014: Set 1