The Role of Algorithms in Computing

Similar documents
More NP-complete Problems. CS255 Chris Pollett May 3, 2006.

ECE6095: CAD Algorithms. Optimization Techniques

1 The Role of Algorithms in Computing

NP-Complete Problems

Design and Analysis of Algorithms CS404/504. Razvan Bunescu School of EECS.

Time Complexity of an Algorithm

Module 6 NP-Complete Problems and Heuristics

CAD Algorithms. Categorizing Algorithms

Module 6 NP-Complete Problems and Heuristics

8/19/13. Computational problems. Introduction to Algorithm

is easing the creation of new ontologies by promoting the reuse of existing ones and automating, as much as possible, the entire ontology

hp calculators HP 12C Platinum Programming in Algebraic vs. RPN Modes Programming in Algebraic vs. RPN Modes

Machine Learning for Software Engineering

CLASS: II YEAR / IV SEMESTER CSE CS 6402-DESIGN AND ANALYSIS OF ALGORITHM UNIT I INTRODUCTION

Chapter 9 Graph Algorithms

From NP to P Musings on a Programming Contest Problem

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices

How many leaves on the decision tree? There are n! leaves, because every permutation appears at least once.

CSC Design and Analysis of Algorithms. Lecture 4 Brute Force, Exhaustive Search, Graph Traversal Algorithms. Brute-Force Approach

Lecture 3. Brute Force

D.K.M.COLLEGE FOR WOMEN (AUTONOMOUS), VELLORE-1.

CS6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK UNIT I

Data Structures in Java. Session 23 Instructor: Bert Huang

Theorem 2.9: nearest addition algorithm

6/12/2013. Introduction to Algorithms (2 nd edition) Overview. The Sorting Problem. Chapter 2: Getting Started. by Cormen, Leiserson, Rivest & Stein

LECTURE 3 ALGORITHM DESIGN PARADIGMS

The Complexity of Algorithms (3A) Young Won Lim 4/3/18

DESIGN AND ANALYSIS OF ALGORITHMS

Assignment No 2 (Group B)

CS 440 Theory of Algorithms /

5105 BHARATHIDASAN ENGINEERING COLLEGE

Professor Yedidyah Langsam

Design and Analysis of Computer Algorithm Lecture 1. Assoc. Prof.Pradondet Nilagupta Department of Computer Engineering

Computer Algorithms. Introduction to Algorithm

Algorithms and Experimental Study for the Traveling Salesman Problem of Second Order. Gerold Jäger

Lecture 20: Satisfiability Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

N N Sudoku Solver. Sequential and Parallel Computing

Why Study Assembly Language?

Algorithm. Algorithm Analysis. Algorithm. Algorithm. Analyzing Sorting Algorithms (Insertion Sort) Analyzing Algorithms 8/31/2017

Lecture 15: Algorithms. AP Computer Science Principles

Module 6 NP-Complete Problems and Heuristics

Cost Optimal Parallel Algorithm for 0-1 Knapsack Problem

Computer Science 210 Data Structures Siena College Fall Topic Notes: Complexity and Asymptotic Analysis

CSE 548: Analysis of Algorithms. Lecture 13 ( Approximation Algorithms )

Developing MapReduce Programs

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 25: Review and Open Problems

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

Chapter 9 Graph Algorithms

Lecture 1. Introduction

Construction of Minimum-Weight Spanners Mikkel Sigurd Martin Zachariasen

STSM Report. December 24, Improving preparedness of networks to disaster based failures

Lecture 1. Introduction / Insertion Sort / Merge Sort

LIMITATIONS OF COMPUTING. Introduction to Computer Engineering 2015 Spring by Euiseong Seo

What Is An Algorithm? Algorithms are the ideas behind computer programs. An algorithm is the thing which stays the same whether

Algorithm Design and Analysis

CSE 373: Data Structures and Algorithms

Computer Science 385 Design and Analysis of Algorithms Siena College Spring Topic Notes: Brute-Force Algorithms

Coping with the Limitations of Algorithm Power Exact Solution Strategies Backtracking Backtracking : A Scenario

Algorithms for Data Processing Lecture I: Introduction to Computational Efficiency

Module 6 P, NP, NP-Complete Problems and Approximation Algorithms

Multi-threaded Queries. Intra-Query Parallelism in LLVM

Student Number: CSE191 Midterm II Spring Plagiarism will earn you an F in the course and a recommendation of expulsion from the university.

Chapter 9 Graph Algorithms

Fundamentals of Computer Science II

CSCE 350: Chin-Tser Huang. University of South Carolina

CSE 373: Data Structures and Algorithms

Examples of P vs NP: More Problems

Steven Skiena. skiena

THEORY OF COMPUTATION

EXAM PREPARATION GUIDE

A HIGH PERFORMANCE ALGORITHM FOR SOLVING LARGE SCALE TRAVELLING SALESMAN PROBLEM USING DISTRIBUTED MEMORY ARCHITECTURES

Fuzzy Inspired Hybrid Genetic Approach to Optimize Travelling Salesman Problem

Algorithm Analysis. Gunnar Gotshalks. AlgAnalysis 1

Algorithm Design Paradigms

CSE 101 Final Exam. Spring 2017

Stanford University CS261: Optimization Handout 1 Luca Trevisan January 4, 2011

EXAM PREPARATION GUIDE

CSE 544 Principles of Database Management Systems

Combinatorial Optimization

IV/IV B.Tech (Regular) DEGREE EXAMINATION. Design and Analysis of Algorithms (CS/IT 414) Scheme of Evaluation

6 ROUTING PROBLEMS VEHICLE ROUTING PROBLEMS. Vehicle Routing Problem, VRP:

OHIO ASSESSMENTS FOR EDUCATORS (OAE) FIELD 010: COMPUTER INFORMATION SCIENCE

P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang

Java and Software Design

More advanced CPUs. August 4, Howard Huang 1

What is an algorithm?

Algorithms. Notations/pseudo-codes vs programs Algorithms for simple problems Analysis of algorithms

Cisco Unified CallConnector for Microsoft Windows

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, / 21

Outline and Reading. Analysis of Algorithms 1

CSI32 Object-Oriented Programming

l Find a partner to bounce ideas off of l Assignment 2 l Proofs should be very concrete l Proving big-o, must satisfy definition

COMP171. Hashing.

February 19, Integer programming. Outline. Problem formulation. Branch-andbound

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem

CS 380 ALGORITHM DESIGN AND ANALYSIS

Computing and compilers

Unit 1: Introduction to Programming. Saurabh Khatri Lecturer Department of Computer Technology VIT, Pune

Example 1 (Optimizing neural network weights)

Algorithms and Complexity

Transcription:

The Role of Algorithms in Computing Chapter 1 CPTR 430 Algorithms The Role of Algorithms in Computing 1

What is an Algorithm? Any well-defined computational procedure that takes some value (or set of values) its input and produces some value (or set of values) its output A sequence of computational steps that transforms its input into its output A tool for solving a well-specified computational problem CPTR 430 Algorithms The Role of Algorithms in Computing 2

a1 41 26 Example Sorting Input: a sequence of n numbers a 0 an 1 Output: a permutation (re-ordering) a a 0 1 a n 1 such that a a 0 1 a n 1 Instance of problem: Input: 31 59 41 58 Output: 26 31 41 41 58 59 CPTR 430 Algorithms The Role of Algorithms in Computing 3

Algorithms for Sorting Sorting is an important operation in computer science Many programs sort as an intermediate step Thus, a large number of good sorting algorithms have been developed Which is best? CPTR 430 Algorithms The Role of Algorithms in Computing 4

Algorithm Correctness An algorithm is correct if, for every input instance, it halts with the correct output A correct algorithm solves the given computational problem An incorrect algorithm might not halt on some input instances, or might halt with incorrect output Can an incorrect algorithm ever be useful? CPTR 430 Algorithms The Role of Algorithms in Computing 5

Expressing Algorithms Algorithms can be expressed in English (or any other natural language) a computer program a hardware design Requirement: The specification must provide a precise description of the computational procedure to be followed CPTR 430 Algorithms The Role of Algorithms in Computing 6

Data Structures A data structure is a way to store and organize data in order to facilitate access and modifications No single data structure works well for all purposes It is advantageous to be familiar with a wide variety of data structures and be aware of their strengths and weaknesses CPTR 430 Algorithms The Role of Algorithms in Computing 7

Hard Problems We are most concerned about efficient algorithms An algorithm s efficiency is often measured by its running time Some problems have no known efficient solutions These are called NP-complete problems No one has proven that efficient algorithms for NP-complete problems do not exist If an efficient solution can be found for one NP-complete problem, then an efficient solution exists for all other NP-complete problems! NP-complete problems are very similar to problems that have an efficient solution A small change to the problem statement can cause a big change to the efficiency of the best known algorithm CPTR 430 Algorithms The Role of Algorithms in Computing 8

Why study NP-Complete Problems? They often arise in everyday situations If you are asked to produce an efficient algorithm to to find an exact solution,... If you can show that the problem is equivalent to a known NP-complete problem, then you can devote your efforts to developing an algorithm that gives a good approximation of the solution The traveling salesman problem (TSP) is one example of a common NPcomplete problem CPTR 430 Algorithms The Role of Algorithms in Computing 9

Algorithm Efficiency Computing resources time and space are bounded resources Efficient algorithms use computing resources wisely Algorithms to solve the same problem often differ drastically in their efficiencies Compare insertion sort and merge sort CPTR 430 Algorithms The Role of Algorithms in Computing 10

Insertion Sort vs. Merge Sort Insertion sort takes time c 1 n 2 to sort n elements Merge sort takes time c 2 n n to sort n elements c 1 and c 2 are constants that do not depend on n Usually c c2 1 Comparing insertion sort vs. merge sort, note that n n Given a large enough n, the overwhelm the c 1 c 2 advantage of insertion sort n n advantage of merge sort will CPTR 430 Algorithms The Role of Algorithms in Computing 11

Concrete Example The hardware: 1 GHz Pentium III vs. 10 MHz 386 In raw processing speed the Pentium is 100 times faster than the 386 The algorithms: Insertion sort vs. merge sort Insertion sort implemented in assembly language by a team of algorithm/assembler experts, so c 1 2 Merge sort implemented in C with a non-optimizing compiler by an average programmer, so c 2 50 The task: sort 1,000,000 integers CPTR 430 Algorithms The Role of Algorithms in Computing 12

The Results Pentium: 2 106 2 instructions 10 9 instructions second 2000 seconds 386: 50 106 106 instructions 10 7 instructions second 100 seconds The merge sort is 20 times faster than the insertion sort! For 10,000,000 numbers: 2.3 days vs. 20 minutes! CPTR 430 Algorithms The Role of Algorithms in Computing 13