高等計算機演算法 Advanced Computer Algorithms

Slides:



Advertisements
Similar presentations
MATH 224 – Discrete Mathematics
Advertisements

Data Structures by R.S. Chang, Dept. CSIE, NDHU1 1 Chapter 4 Complexity Analysis 4.1 Computational and Asymptotic Complexity The same problem can frequently.
The Theory of NP-Completeness
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.
Simple Linear Work Suffix Array Construction J. Kärkkäinen, P. Sanders Proc. 30th International Conference on Automata, Languages and Programming 2003.
Lecture 8 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Chapter 0 Computer Science (CS) 計算機概論 教學目標 瞭解現代電腦系統之發展歷程 瞭解電腦之元件、功能及組織架構 瞭解電腦如何表示資料及其處理方式 學習運用電腦來解決問題 認知成為一位電子資訊人才所需之基本條 件 認知進階電子資訊之相關領域.
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.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
1 Financial Management Fall, Textbook and References 徐俊明,財務管理理論與實務,新陸書局。 E.F. Brigham & J.F. Houston , Fundamentals of Financial Management ,
1 數位控制(一) 2 數位控制 課程計畫 課程目標 介紹數位控制理論 與工業界常用之數位控制器比較 實習數位控制器之模擬與設計 課程綱要 Introduction to Digital Control System The z Transform z-Plane Analysis of Discrete-Time.
The Theory of NP-Completeness
演算法 李朱慧. 演算法的課程目的 學習已知常用的演算法 分析程式複雜度 複雜度 vs 執行時間 學習思考過程方式.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2006 Lecture 7 Monday, 4/3/06 Approximation Algorithms.
Johnson’s algorithm Johnson’s演算法可用於計算All pairs shortest path問題。
1 高等演算法 授課老師 : 陳建源 研究室 : 法 401 網站
88- 1 Chapter 8 The Theory of NP-Completeness P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class.
1 影像處理 99/02 revised 課程簡介 1 課程目標 2 課程內容 3 教科書與主要參考書 4 成績計算 5 教學網頁.
Algorithmic Complexity 2 Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
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,
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2009 Lecture 7 Tuesday, 4/7/09 Approximation Algorithms.
1 財務管理 課程大綱 (Spring, 94 ). 2 Textbook and References 徐俊明,財務管理原理,雙葉書局。 E.F. Brigham & J.F. Houston , Fundamentals of Financial Management , concise second.
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
: Longest Paths ★★★☆☆ 題組: VOLUME C 題號: 10000: Longest Paths 解題者:陳冠男、邱元甫 解題日期: 2006 年 3 月 12 日 題意:在一個 no cycle 的 digraph 裡,計算從指 定起點可行走的最長路徑,若有多個最長路.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Signal and Systems 教師:潘欣泰. 本課程目標 學生能熟悉離散及連續信號的時域和頻 域的特性及運算 對線性非時變 (LTI) 系統的頻域分析及 其輸入輸出信號的關係有基本的瞭解 學生在學習完本課程之後,應能熟悉傅 立葉分析 (Fourier analysis) 及拉式轉換 (Laplace.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard 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
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.
Design of double- and triple-sampling X-bar control charts using genetic algorithms 指導教授: 童超塵 作者: D. HE, A. GRIGORYAN and M. SIGH 主講人:張怡笳.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 25, 2014.
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
CSCE350 Algorithms and Data Structure
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.
演算法 ( 課號 : ) 內容 : 本課程是電機工程學系計算機類課程之必選課,對象以對利 用計算機來解決問題有興趣的同學為主。本課程主要是教授 基本的演算法分析與設計技巧,並整理及比較目前最重要之 演算法。 Theme: What is the best algorithm for.
Algorithms  Al-Khwarizmi, arab mathematician, 8 th century  Wrote a book: al-kitab… from which the word Algebra comes  Oldest algorithm: Euclidian algorithm.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
數量方法 課程名稱數量方法 課程編碼 60M01701 系所代碼 / 名稱 06 / 國企系 開課班級碩研國企一甲 開課教師林士琪 學分 3.0 時數 3 必選修系定選修 南台科技大學 課程資訊.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Lecture 3 Analysis of Algorithms, Part II. Plan for today Finish Big Oh, more motivation and examples, do some limit calculations. Little Oh, Theta notation.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Discrete Mathematics Section 3.7 Applications of Number Theory 大葉大學 資訊工程系 黃鈴玲.
Design and Analysis of Algorithms - Chapter 101 Our old list of problems b Sorting b Searching b Shortest paths in a graph b Minimum spanning tree b Primality.
Design and Analysis of Algorithms (09 Credits / 5 hours per week) Sixth Semester: Computer Science & Engineering M.B.Chandak
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
© The McGraw-Hill Companies, Inc., Chapter 1 Introduction.
Optimization/Decision Problems Optimization Problems – An optimization problem is one which asks, “What is the optimal solution to problem X?” – Examples:
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.
CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P.
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.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
The Theory of NP-Completeness
Hard Problems Some problems are hard to solve.
GC 211:Data Structures Week 2: Algorithm Analysis Tools
Design and Analysis of Computer Algorithm (CS575-01)
Objective of This Course
GC 211:Data Structures Algorithm Analysis Tools
Richard Anderson Lecture 29 Complexity Theory
The Theory of NP-Completeness
Chapter 1 Introduction.
Department of Computer Science & Engineering
Presentation transcript:

高等計算機演算法 Advanced Computer Algorithms 伍麗樵(Lih-Chyau Wuu) 雲林科技大學資工所

課程內容: Design Methods Analysis Methods The theory of NP-completeness

Design Methods The Greedy Method The Divide-and-Conquer strategy Prune-and-Search Tree Searching strategy Dynamic Programming Approximation Algorithms Randomized Algorithms On-Line Algorithms

Analysis Methods Complexity of algorithms Best, Average and Worst Case Analyses The Lower Bounds of Problems Amortized Analysis

教科書 Introduction to the Design and Analysis of Algorithms R.C.T Lee R.C. Chang S.S. Tseng Y.T. Tsai Second Edition 旗標代理

分數 期中考 35% 期末考 35% 報告 30%

Algorithm A number of rules, which are to be followed in a prescribed order, for solving a specific type of problems A method that can be used by a computer to solve a problem.

Computer Algorithm – Five Criteria Input Output Finiteness Definiteness Effectiveness

Motivations of studying Algorithms Algorithm is everywhere Use computers efficiently Optimal solution NP-complete problems(Decision problems) NP-hard problems(Optimization problems) next

Use computers efficiently Sorting algorithms 11, 7, 14, 1, 5, 9, 10 ↓sort 1, 5, 7, 9, 10, 11, 14   Insertion sort Quick sort

Comparison with Two Algorithms Implemented on Two Computers

The study of Algorithms: How to design algorithms How to validate algorithms How to analyze algorithms How to test a program

How to design algorithm The study of algorithm design is almost a study of strategies

How to analyze algorithm Measure the goodness of algorithms efficiency?(time/space) asymptotic notations: O( ) worst case average case amortized Measure the difficulty of problems NP-complete undecidable lower bound Is the algorithm optimal?

時間複雜度(time complexity)-worst case executing time O(1):常數時間(constant time) O(n):線性時間(linear time) O(log2n):次線性時間(sub-linear time) O(n2):平方時間(quadratic time) O(n3):立方時間(cubic time) O(2n):指數時間(exponential time)   O(1)<O(log2n)<O(n)<O(nlog2n)<O(n2)<O(n3)<O(2n)

Algorithm vs. Program Algorithm的表示方法 *虛擬碼(Pseudo Code) SPARKS, PASCAL-like, Nature Language *流程圖表示法(Flow-chart representation) A program is the expression of an algorithm in a programming language

Background for Learning Algorithms Clear brain Data structure Discrete mathematics

NP-complete problems:No efficient algorithms Easy problem: polynomial-time algorithm Difficult problem: exponential-time algorithm Garey & Johnson “Computers & Intracability”

N1: Satisfiability Problem Given a Boolean formula S, is there an assignment to make S true?  &: and !: or ~: not S=A& (~B !C) &~C   S=A& ~A Worst case: n variables --> 2n combinations

N2: Bin Packing Problem C1 C2 C3 C4 C5 C6 C7 C8 7 1 3 4 1 3 3 8 B=15 7 1 3 4 1 3 3 8   B=15 How many bags are necessary?

N3: 0/1 Knapsack Problem M(weight limit)=14 Value 10 5 1 9 3 4 11 17 Weight 7 22 15 M(weight limit)=14 best solution: P1, P2, P3, P5(optimal) This problem is NP-complete.

N4: Traveling Salesperson Problem Given a graph (vertex-city, edge-flying cost between two cities), the salesperson travels to every city once and only once, and the cost should also be minimal. 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.

N5: Partition Problem Given: A set of positive integers S Find: S1 and S2 such that S1S2=, S1S2=S, iS1i=iS2 i (partition into S1 and S2 such that the sum of S1 is equal to S2) e.g. S={1, 7, 10, 9, 5, 8, 3, 13} S1={1, 10, 9, 8} S2={7, 5, 3, 13} This problem is NP-complete.

N6: Art Gallery Problem Given an art gallery in the form of a polygon, determine the minimum number of guards and their placements such that the entire art gallery can be monitored by these guards.

P1: Minimal Spanning Tree Problem Given a graph, find a spanning tree (a graph without cycle) with the minimum total edges length.

P1: Minimal Spanning Tree Problem graph: greedy method geometry(on a plane): divide-and-conquer # of possible spanning trees for n points: nn-2 n=10→108, n=100→10196

P1: Minimal Spanning Tree Problem graph: greedy method geometry(on a plane): divide-and-conquer # of possible spanning trees for n points: nn-2 (Cayley’s theorem) n=10→108, n=100→10196

P2: Convex Hull Problem Given a set of 2-dimensional points, find a smallest convex polygon to contain all of these points.   Convex Polygon: any line connecting any two points inside the polygon must itself lie inside the polygon.

P2: Convex Hull Problem It is not obvious to find a convex hull by examining all possible solutions divide-and-conquer

P3: One-Center Problem Given a set of points, find a smallest circle covering all of these points. prune-and-search !!