Download presentation
Presentation is loading. Please wait.
1
CS3381 Des & Anal of Alg (2001-2002 SemA) City Univ of HK / Dept of CS / Helena Wong 1. Introduction - 1 http://www.cs.cityu.edu.hk/~helena Introduction
2
CS3381 Des & Anal of Alg (2001-2002 SemA) City Univ of HK / Dept of CS / Helena Wong 1. Introduction - 2 http://www.cs.cityu.edu.hk/~helena What is an Algorithm? An algorithm is: a sequence of elementary computational steps that transforms the input into the output. An algorithm is: a tool for solving a well-specified computational problem, eg. Sorting, Multiplication. A correct algorithm: for every input instance, it halts with the correct output.
3
CS3381 Des & Anal of Alg (2001-2002 SemA) City Univ of HK / Dept of CS / Helena Wong 1. Introduction - 3 http://www.cs.cityu.edu.hk/~helena A Sorting Problem Input: Output: A permutation (re-ordering) of the input sequence such that a’ 1 a’ 2 … a’ n. Example: => An instance of the sorting problem.
4
CS3381 Des & Anal of Alg (2001-2002 SemA) City Univ of HK / Dept of CS / Helena Wong 1. Introduction - 4 http://www.cs.cityu.edu.hk/~helena The best algorithm Answer these questions first: Number of items to be sorted? Are the items already somewhat sorted? Any restrictions on the item values? What kind of storage device (main memory? Disks?) Which algorithm is best, eg. for a sorting problem?
5
CS3381 Des & Anal of Alg (2001-2002 SemA) City Univ of HK / Dept of CS / Helena Wong 1. Introduction - 5 http://www.cs.cityu.edu.hk/~helena Other examples of problems Identifying 100,000 genes in human DNA. Determining the sequences of 3,000,000,000 base pairs. => Sorting and Order statistics Internet search engine => Graph algorithms, hash tables, string matching Find all x and n that satisfies 1079*x = 80642173 (mod n) Cryptography and digital signatures => Numerical problems
6
CS3381 Des & Anal of Alg (2001-2002 SemA) City Univ of HK / Dept of CS / Helena Wong 1. Introduction - 6 http://www.cs.cityu.edu.hk/~helena Other examples of problems Winning an election Triangulation of polygon Identifying the convex hull => Linear Programming => Dynamic Programming => Computational Geometry PolicyZone A Zone B Zone C Build Roads-200050003000 Gun Control80002000-500
7
CS3381 Des & Anal of Alg (2001-2002 SemA) City Univ of HK / Dept of CS / Helena Wong 1. Introduction - 7 http://www.cs.cityu.edu.hk/~helena NP-Complete Problems No efficient solution is known yet. Nobody has ever proven that an efficient algorithm for one cannot exist. If an efficient algorithm exists for any one of them, then efficient algorithms exist for all of them !!! Eg. Traveling-salesman problem However, “Approximation Algorithms” exist !!! Several NP-Complete problems are similar to some tractable ones. Tractable: The set of problems with efficient solutions known. All known problems:
8
CS3381 Des & Anal of Alg (2001-2002 SemA) City Univ of HK / Dept of CS / Helena Wong 1. Introduction - 8 http://www.cs.cityu.edu.hk/~helena Core Topics Analysis of Algorithms Divide and Conquer Dynamic Programming Greedy Algorithms Computational Geometry Graph Algorithms String Algorithms NP-Completeness
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.