Download presentation
Presentation is loading. Please wait.
Published byLaurence Bryan Modified over 9 years ago
1
2016/3/13Page 1 Semester Review COMP3040 Dept. Computer Science and Technology United International College
2
2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 2 Mathematical Basis O,Ω, Θ. Derive function from recurrence relation. Complexity analysis.
3
2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 3 Divide and Conquer Method Divide: Divide a given problem into subproblems (ideally of approximately equal size). Conquer: Solve each subproblem (directly or recursively) Combine: Combine the solutions of the subproblems into a global solution. Algorithms Maximum Contiguous Subarray Problem (MCS) The Polynomial Multiplication Problem The Selection Problem
4
2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 4 Graphs Graph Representation Pictorial, Adjacency Matrix, Adjacency List Breadth First Search Depth First Search Cycle detection, Topological Sort Dijkstra's algorithm Single Source Shortest-Path Problem Data structure: Priority Queue Prim's algorithm & Kruskal's algorithm Minimal Spanning Tree Problem Data structure: Union-Find
5
2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 5 Dynamic Programming Method Structure: Characterize the structure of an optimal solution by showing that it can be decomposed into optimal subproblems Recursively define the value of an optimal solution by expressing it in terms of optimal solutions for smaller problems Bottom-up computation: Compute the value of an optimal solution in a bottom-up fashion by using a table structure Construction of optimal solution: Construct an optimal solution from computed information Dynamic Programming VS. Divide&Conquer
6
2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 6 Dynamic Programming The 0-1 Knapsack Problem Chain Matrix Multiplication All Pairs Shortest Path D&Q algorithm Simple dynamic programming algorithm The Floyd Warshall algorithm
7
2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 7 Greedy algorithms Method Always makes the choice that looks best at the moment and adds it to the current subsolution. Greedy VS. Dynamic Programming Fractional Knapsack Problem Huffman Coding
8
2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 8 String String Matching Problem and Terminology The Knuth-Morris-Pratt (KMP) Algorithm. Next function calculation Meaning of the next function Time complexity The Boyer-Moore (BM) Algorithm. Bad-Character Heuristic Good Suffix Heuristic
9
2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 9 NP Completeness Input size Standard Definition Two positive functions f(n) and g(n) are of the same type if Optimization Problem vs. Decision Problem MST vs. Decision Spanning Tree (DST) Knapsack vs. Decision Knapsack (DKnapsack) SubSet Sum vs. Decision Subset Sum (DSubset Sum) Complementary Problems
10
2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 10 NP Completeness The class P How to prove a problem L is in P? Find a polynomial solution. NP How to prove a problem L is in NP? Find a certificate that can be verified in polynomial time. NPC How to prove a problem L is in NPC? Prove that the problem L is in NP. Prove that an NPC problem is polynomial reducible to L.
11
2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 11 NP Completeness NP Complete Problems Satisability of Boolean formulas (SAT) Extension: 3-CNF SAT The first NPC problem ever proven Decision clique (DCLIQUE) Decision vertex cover (DVC) Decision Hamiltonian cycle (DHamCyc) Decision traveling salesman (DTSP) Decision independent set (DIS) The relation between classes P, NP, NP hard, and NPC Open problems: P=NP? NP=NP hard=NPC?
12
Mark Distribution Mathematical Basis 8 Divide & Conquer 12 Graph 20 Dynamic Programming 20 Greedy 8 P&NP&NPC 32 2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 12
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.