2016/3/13Page 1 Semester Review COMP3040 Dept. Computer Science and Technology United International College.

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
 2004 SDU Lecture11- All-pairs shortest paths. Dynamic programming Comparing to divide-and-conquer 1.Both partition the problem into sub-problems 2.Divide-and-conquer.
Lecture 17 Review. What I’ve taught ≠ What you’ve learnt.
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Chapter 3 The Greedy Method 3.
CS333 Algorithms
Chapter 9: Greedy Algorithms The Design and Analysis of Algorithms.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Design and Analysis of Algorithms - Chapter 81 Dynamic Programming Dynamic Programming is a general algorithm design technique Dynamic Programming is a.
Chapter 10: Algorithm Design Techniques
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2002 Lecture 1 (Part 3) Tuesday, 1/29/02 Design Patterns for Optimization.
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
Instructor: Dr. Sahar Shabanah Fall Lectures ST, 9:30 pm-11:00 pm Text book: M. T. Goodrich and R. Tamassia, “Data Structures and Algorithms in.
MCS312: NP-completeness and Approximation Algorithms
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
CSCE350 Algorithms and Data Structure Lecture 17 Jianjun Hu Department of Computer Science and Engineering University of South Carolina
Dynamic Programming. Well known algorithm design techniques:. –Divide-and-conquer algorithms Another strategy for designing algorithms is dynamic programming.
Fundamentals of Algorithms MCS - 2 Lecture # 7
Algorithms  Al-Khwarizmi, arab mathematician, 8 th century  Wrote a book: al-kitab… from which the word Algebra comes  Oldest algorithm: Euclidian algorithm.
10/20/20151 CS 3343: Analysis of Algorithms Review for final.
CSC401: Analysis of Algorithms CSC401 – Analysis of Algorithms Chapter Dynamic Programming Objectives: Present the Dynamic Programming paradigm.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 28, 2014.
INTRODUCTION. What is an algorithm? What is a Problem?
For Wednesday No reading No homework There will be homework for Friday, as well the program being due – plan ahead.
Lecture 12: Algorithm Review. General Problem Solving Methods Divide & Conquer Greedy Method Dynamic Programming Graph & Tree Traversal Backtracking Branch.
CS223 Advanced Data Structures and Algorithms 1 Review for Final Neil Tang 04/27/2010.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness and course wrap up.
1 Greedy Technique Constructs a solution to an optimization problem piece by piece through a sequence of choices that are: b feasible b locally optimal.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
Design and Analysis of Algorithms (09 Credits / 5 hours per week) Sixth Semester: Computer Science & Engineering M.B.Chandak
CSE 340: Review (at last!) Measuring The Complexity Complexity is a function of the size of the input O() Ω() Θ() Complexity Analysis “same order” Order.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
Course Review Fundamental Structures of Computer Science Margaret Reid-Miller 28 April 2005.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
Introduction to NP Instructor: Neelima Gupta 1.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
NP-Completeness A problem is NP-complete if: It is in NP
NP-completeness Ch.34.
Chapter 10 NP-Complete Problems.
Design and Analysis of Algorithms (09 Credits / 5 hours per week)
CSCE 411 Design and Analysis of Algorithms
Greedy Technique.
Richard Anderson Lecture 26 NP-Completeness
Major Design Strategies
Lecture 5 Dynamic Programming
Richard Anderson Lecture 29 NP-Completeness and course wrap-up
Courtsey & Copyright: DESIGN AND ANALYSIS OF ALGORITHMS Courtsey & Copyright:
Graph Theory and Algorithm 02
CS 3343: Analysis of Algorithms
Lecture 5 Dynamic Programming
Design and Analysis of Computer Algorithm (CS575-01)
CS 3343: Analysis of Algorithms
Design and Analysis of Algorithms (07 Credits / 4 hours per week)
Graph Algorithm.
CS 3343: Analysis of Algorithms
ICS 353: Design and Analysis of Algorithms
CS 3343: Analysis of Algorithms
CS 3343: Analysis of Algorithms
CS 3343: Analysis of Algorithms
Principles of Computing – UFCFA3-30-1
Richard Anderson Lecture 30 NP-Completeness
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Major Design Strategies
INTRODUCTION TO ALOGORITHM DESIGN STRATEGIES
Our old list of problems
Department of Computer Science & Engineering
Design and Analysis of Algorithms (04 Credits / 4 hours per week)
Review for Final Neil Tang 05/01/2008
Major Design Strategies
Presentation transcript:

2016/3/13Page 1 Semester Review COMP3040 Dept. Computer Science and Technology United International College

2016/3/13COMP2230 Design and Analysis of Algorithms :: UIC 2 Mathematical Basis  O,Ω, Θ.  Derive function from recurrence relation.  Complexity analysis.

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

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

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

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

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

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

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

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.

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?

Mark Distribution  Mathematical Basis 8  Divide & Conquer 12  Graph 20  Dynamic Programming 20  Greedy 8  P&NP&NPC /3/13COMP2230 Design and Analysis of Algorithms :: UIC 12