CSCE 411 Design and Analysis of Algorithms Set 1: Introduction Slides by Prof. Jennifer Welch Spring 2014 CSCE 411, Spring 2013: Set 1 1.

Slides:



Advertisements
Similar presentations
CMSC 611: Advanced Computer Architecture Performance Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
Advertisements

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)
What is an Algorithm? (And how do we analyze one?)
CS Section 600 CS Section 002 Dr. Angela Guercio Spring 2010.
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.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
CSE 830: Design and Theory of Algorithms
CSE 830: Design and Theory of Algorithms
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.
CSE 830: Design and Theory of Algorithms Dr. Eric Torng.
CS3381 Des & Anal of Alg ( SemA) City Univ of HK / Dept of CS / Helena Wong 1. Introduction - 1 Introduction.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2005 Lecture 1 Introduction/Overview Text: Chapters 1, 2 Wed. 9/7/05.
1 Efficiency of Algorithms. 2  Two main issues related to the efficiency of algorithms:  Speed of algorithm  Efficient memory allocation  We will.
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.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
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.
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Fundamentals of Algorithms MCS - 2 Lecture # 1
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
Analysis of Algorithms
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.
What is an algorithm? Algorithms are the ideas behind computer programs. An algorithm is the thing which stays the same whether the program is in Pascal.
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.
CS404 Design and Analysis of Algorithms BBy DDr. M V S Peri Sastry BB.E, PhD(BITS-Pilani)
Computer Science/Ch. Algorithmic Foundation of CS 4-1 Chapter 4 Chapter 4 Algorithmic Foundation of Computer Science.
Text Chapters 2 Analyzing Algorithms.  goal: predicting resources that an algorithm requires memory, communication bandwidth, hardware, memory, communication.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Introduction to design and analysis algorithm
CES 592 Theory of Software Systems B. Ravikumar (Ravi) Office: 124 Darwin Hall.
Lecture # 1 Introduction Analysis of Algorithm by Qamar Abbas Analysis of Algorithms.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
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.
1 The Role of Algorithms in Computing. 2 Computational problems A computational problem specifies an input-output relationship  What does the.
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.
1 Introduction to design and analysis algorithm. 2.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
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
Unit 1. Sorting and Divide and Conquer
Advance Analysis of Algorithms
Courtsey & Copyright: DESIGN AND ANALYSIS OF ALGORITHMS Courtsey & Copyright:
CS 583 Fall 2006 Analysis of Algorithms
Introduction to Algorithms
CSCE 411 Design and Analysis of Algorithms
Objective of This Course
3. Brute Force Selection sort Brute-Force string matching
Introduction to Algorithms
3. Brute Force Selection sort Brute-Force string matching
3. Brute Force Selection sort Brute-Force string matching
Presentation transcript:

CSCE 411 Design and Analysis of Algorithms Set 1: Introduction Slides by Prof. Jennifer Welch Spring 2014 CSCE 411, Spring 2013: Set 1 1

Mechanics Sources: [CLRS] (textbook) The Design and Analysis of Algorithms, Anany Levitin The Algorithm Design Manual, Steven S. Skiena CSCE 411, Spring 2013: Set 12

Introduction What is an algorithm? a step-by-step procedure to solve a problem every program is the instantiation of some algorithm CSCE 411, Spring 2013: Set 13

Sorting Example Solves a general, well-specified problem given a sequence of n keys, a 1,…,a n, as input, produce as output a reordering b 1,…,b n of the keys so that b 1 ≤ b 2 ≤ … ≤ b n. 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, Spring 2013: Set 14

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

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, Spring 2013: Set 16

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, Spring 2013: Set 17

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 CSCE 411, Spring 2013: Set 18

Nearest Neighbor Counter- example CSCE 411, Spring 2013: Set

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, Spring 2013: Set 110

Efficiency Software is always outstripping hardware 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, Spring 2013: Set 111

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, Spring 2013: Set 112

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 2n 2 instructions Suppose computer C1 executes 1 billion instruc/sec When n = 1 million, takes 2000 sec Suppose algorithm S2 sorts n keys in 50nlog 2 n instructions Suppose computer C2 executes 10 million instruc/sec When n = 1 million, takes 100 sec CSCE 411, Spring 2013: Set 113

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, Spring 2013: Set 114

Modeling the Real World Cast your application in terms of well-studied abstract data structures CSCE 411, Spring 2013: Set 115 ConcreteAbstract arrangement, tour, ordering, sequencepermutation cluster, collection, committee, group, packaging, selectionsubsets hierarchy, ancestor/descendants, taxonomytrees network, circuit, web, relationshipgraph sites, positions, locationspoints shapes, regions, boundariespolygons text, characters, patternsstrings

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, Spring 2013: Set 116

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, Spring 2013: Set 117

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, Spring 2013: Set 118

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, Spring 2013: Set 119