© The McGraw-Hill Companies, Inc., 2005 1 -1 Chapter 1 Introduction.

Slides:



Advertisements
Similar presentations
Algorithm Design Methods (I) Fall 2003 CSE, POSTECH.
Advertisements

Algorithm Design Methods Spring 2007 CSE, POSTECH.
Greed is good. (Some of the time)
Chapter 4 The Greedy Approach. Minimum Spanning Tree A tree is an acyclic, connected, undirected graph. A spanning tree for a given graph G=, where E.
The Theory of NP-Completeness
5-1 Chapter 5 Tree Searching Strategies. 5-2 Satisfiability problem Tree representation of 8 assignments. If there are n variables x 1, x 2, …,x n, then.
S. J. Shyu Chap. 1 Introduction 1 The Design and Analysis of Algorithms Chapter 1 Introduction S. J. Shyu.
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
高等計算機演算法 Advanced Computer Algorithms
The Design and Analysis of Algorithms
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
1 -1 Chapter 1 Introduction Why Do We Need to Study Algorithms? To learn strategies to design efficient algorithms. To understand the difficulty.
1 Approximation Algorithms CSC401 – Analysis of Algorithms Lecture Notes 18 Approximation Algorithms Objectives: Typical NP-complete problems Approximation.
Chapter 9: Greedy Algorithms The Design and Analysis of Algorithms.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 23.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
1 Branch and Bound Searching Strategies 2 Branch-and-bound strategy 2 mechanisms: A mechanism to generate branches A mechanism to generate a bound so.
1 -1 Chapter 1 Introduction Why to study algorithms? Sorting problem: To sort a set of elements into increasing or decreasing order. 11, 7, 14,
Chapter 11: Limitations of Algorithmic Power
Ch 13 – Backtracking + Branch-and-Bound
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
5-1 Chapter 5 Tree Searching Strategies. 5-2 Breadth-first search (BFS) 8-puzzle problem The breadth-first search uses a queue to hold all expanded nodes.
The Complexity of Algorithms and the Lower Bounds of Problems
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
Approximation Algorithms
The Art Gallery Problem
Lecture 6 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 25, 2014.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Algorithms  Al-Khwarizmi, arab mathematician, 8 th century  Wrote a book: al-kitab… from which the word Algebra comes  Oldest algorithm: Euclidian algorithm.
Module 5 – Networks and Decision Mathematics Chapter 23 – Undirected Graphs.
The Lower Bounds of Problems
Theory of Algorithms: Brute Force. Outline Examples Brute-Force String Matching Closest-Pair Convex-Hull Exhaustive Search brute-force strengths and weaknesses.
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
LIMITATIONS OF ALGORITHM POWER
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
Algorithm Design Methods 황승원 Fall 2011 CSE, POSTECH.
Computer Science/Ch. Algorithmic Foundation of CS 4-1 Chapter 4 Chapter 4 Algorithmic Foundation of Computer Science.
Lecture 7 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Lecture 19 Minimal Spanning Trees CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Branch and Bound Searching Strategies
1 CPSC 320: Intermediate Algorithm Design and Analysis July 14, 2014.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
Exhaustive search Exhaustive search is simply a brute- force approach to combinatorial problems. It suggests generating each and every element of the problem.
Weighted Graphs and traveling Salesperson problem
Greedy Technique.
Algorithm Design Methods
Minimum Spanning Tree Chapter 13.6.
The Complexity of Algorithms and the Lower Bounds of Problems
Exam 2 LZW not on syllabus. 73% / 75%.
The Lower Bounds of Problems
3. Brute Force Selection sort Brute-Force string matching
Minimum Spanning Trees
3. Brute Force Selection sort Brute-Force string matching
Algorithm Design Methods
Algorithm Design Methods
Chapter 1 Introduction.
Department of Computer Science & Engineering
Algorithm Design Methods
3. Brute Force Selection sort Brute-Force string matching
Presentation transcript:

© The McGraw-Hill Companies, Inc., Chapter 1 Introduction

© The McGraw-Hill Companies, Inc., Why Do We Need to Study Algorithms? To learn strategies to design efficient algorithms. To understand the difficulty of designing good algorithms for some problems, namely NP-complete problems.

© The McGraw-Hill Companies, Inc., Consider the Sorting Problem Sorting problem: To sort a set of elements into increasing or decreasing order. 11, 7, 14, 1, 5, 9, 10 ↓ sort 1, 5, 7, 9, 10, 11, 14 Insertion sort Quick sort

© The McGraw-Hill Companies, Inc., Comparison of Two Algorithms Implemented on Two Computers A bad algorithm implemented on a fast computer does not perform as well as a good algorithm implemented on a slow computer.

© The McGraw-Hill Companies, Inc.,

© The McGraw-Hill Companies, Inc., Analysis of Algorithms Measure the goodness of algorithms efficiency asymptotic notations: e.g. O(n 2 ) worst case average case amortized Measure the difficulty of problems NP-complete undecidable lower bound Is the algorithm optimal?

© The McGraw-Hill Companies, Inc., /1 Knapsack Problem Given a set of n items where each item P i has a value V i, weight W i and a limit M of the total weights, we want to select a subset of items such that the total weight does not exceed M and the total value is maximized.

© The McGraw-Hill Companies, Inc., /1 Knapsack Problem M(weight limit) = 14 best solution: P 1, P 2, P 3, P 5 (optimal) This problem is NP-complete. P1P1 P2P2 P3P3 P4P4 P5P5 P6P6 P7P7 P8P8 Value Weight

© The McGraw-Hill Companies, Inc., Traveling Salesperson Problem Given: A set of n planar points Find: A closed tour which includes all points exactly once such that its total length is minimized. This problem is NP-complete.

© The McGraw-Hill Companies, Inc., Partition Problem Given: A set of positive integers S Find S 1 and S 2 such that S 1  S 2 = , S 1  S 2 =S, (Partition into S 1 and S 2 such that the sum of S 1 is equal to that of S 2 ) e.g. S={1, 7, 10, 4, 6, 8, 13} S 1 ={1, 10, 4, 8, 3} S 2 ={7, 6, 13} This problem is NP-complete.

© The McGraw-Hill Companies, Inc., Given: an art gallery Determine: min # of guards and their placements such that the entire art gallery can be monitored. This problem is NP-complete. Art Gallery Problem

© The McGraw-Hill Companies, Inc., Minimal Spanning Trees Given a weighted graph G, a spanning tree T is a tree where all vertices of G are vertices of T and if an edge of T connects V i and V j, its weight is the weight of e(V i,V j ) in G. A minimal spanning tree of G is a spanning tree of G whose total weight is minimized.

© The McGraw-Hill Companies, Inc., Minimum Spanning Trees graph: greedy method # of possible spanning trees for n points: n n-2 n=10 → 10 8, n=100 →

© The McGraw-Hill Companies, Inc., Convex Hull Given a set of planar points, find a smallest convex polygon which contains all points. It is not obvious to find a convex hull by examining all possible solutions. divide-and-conquer

© The McGraw-Hill Companies, Inc., One-Center Problem Given a set of planar points, find a smallest circle which contains all points. Prune-and-search

© The McGraw-Hill Companies, Inc., Many strategies, such as the greedy approach, the divide-and-conquer approach and so on will be introduced in this book.