CSCE 321/3201 Analysis and Design of Algorithms Prof. Amr Goneid Fall 2016
CSCE 321/3201 Analysis and Design of Algorithms Prof. Amr Goneid Course Resources Instructor: Prof. Amr Goneid E-mail: goneid@aucegypt.edu Office: Rm 2152 SSE Text Books: Introduction to the Design and Analysis of Algorithms, by Anany V. Levitin Pearson Higher Education, International Edition, 2/E, 2007 Computer Algorithms/C++, by Horowitz, Sahni and Rajasekaran, Computer Science Press, 1997 Other References: The Algorithm Design Manual, by S. Skiena, Springer-Verlag, 1998 Algorithms in C++, by R. Sedgewick, Addison-Wesley, 1992 Language: C++ Web Site: www.cs.aucegypt.edu/~csci321/ Course Goals To gain experience in fundamental techniques used for algorithm analysis. To gain experience in the main methodologies used for the design of efficient algorithms. To study the most important computer algorithms of current practical use. Contents Material for Revision and Reference (mainly from CSCE 210) R1. Elementary Data Structures R2. Binary Search Trees R3. Priority Queues R4. Disjoint Sets R5. Graphs Basics 1. Complexity Bounds Algorithms The 4 Questions about Algorithms Space & Time Complexities Bounds
2. Types of Complexities Rules for Upper Bound Comparing Complexities Types of Complexities 3. Time Complexity Calculations Performance Measurement & Modeling Performance Measurement Performance Analysis (modeling) Evaluating Number of Operations T(n) Examples of Algorithm Analysis Analysis of Iterative and Recursive Algorithms 4. Brute Force Algorithms Brute Force Algorithms Elementary Sorting Algorithms Selection Sort Bubble Sort Insertion Sort Brute Force Sequential Search Brute Force String Matching Closest Pair Problem Exhaustive Search Traveling Salesman Problem 0/1 Knapsack Problem Assignment problem 5. Recursive Algorithms Modeling Recursive Algorithms Examples of Recurrences Exclude & Conquer General Solution of 1st Order Linear Recurrences 2 nd Order Linear Recurrence Major Algorithm Design Methodologies 6. Transform & Conquer Algorithms Transform & Conquer Pre-Sorting Heaps and Heap Sort The Selection Problem Polynomial Evaluation Computing Spans Counting Paths in a Graph
7. Divide & Conquer Algorithms The General Method Time Complexity Common Recurrence Relations A General Divide & Conquer Recurrence Merge Sort Algorithm Quicksort Algorithm An Application of Quicksort: Convex Hull Selection by Partitioning Closest Pair Problem 8. Greedy Algorithms Greedy Algorithms The General Method Continuous Knapsack Problem Optimal Merge Patterns 9. Intermezzo Fibonacci Numbers Computing Binomial Coefficients The Sum of Subset Problem Summary 10. Dynamic Programming Introduction What is Dynamic Programming? How To Devise a Dynamic Programming Approach The Sum of Subset Problem The Knapsack Problem Minimum Cost Path Coin Change Problem Optimal BST DP Algorithms in Graph Problems Comparison with Greedy and D&Q Methods 11. Backtracking Algorithms Problem Statement Brute Force & Backtracking Permutation Tree The 4-Queens Problem Sum of Subsets
Unbound DFG: Permutation Tree Bound DFG: Backtracking General Backtracking Algorithm Example: n-binary Variables Problem The n-queens Problem Another Backtracking Schema The Hamiltonian Circuit Problem by Backtracking 12. Graph Algorithms Graph Traversal: DFS and BFS A Simple Graph Class Minimum Cost Spanning Trees (MST) Single Source Shortest Paths All Pairs Shortest Paths Transitive Closure Graph Coloring Topological Sorting The Clique Problem 13. Branch & Bound Introduction General Idea The 0/1 Knapsack Problem 14. Other Strategies: Heuristics Pattern Matching String/text algorithms Numerical Approximation algorithms Grading 25 % Assignments 5 % Quizzes, class participation and attendance 20 % 1st Midterm Exam 20 % 2nd Midterm Exam 30 % Final Exam All exams are closed book
Corresponding Levitin Book Chapters Part No. Subject Book Chapter R1 Elementary Data Structures 1 R2 BSTs 1 R3 Priority Queues 1 R4 Disjoint Sets 1 R5 Graphs 1 1 Complexity Bounds 1, 2 2 Types of Complexities 2 3 Time Complexity Calculations 2 4 Brute Force Algorithms 3, 4 5 Recursive Algorithms 2, 5, App. B 6 Transform & Conquer Algorithms 6 7 Divide & Conquer Algorithms 4, 5, App.B 8 Greedy Algorithms 9 9 Intermezzo 8 10 Dynamic Programming 8 11 Backtracking Algorithms 12 12 Graph Algorithms 4, 5, 8, 9 13 Branch & Bound 12 14 Other Strategies 7, 11, 12 Useful Equations App. A, B
CSCE 321 Course outcomes: After completing the CSCE 321, students should be able to: 1. Use big O, omega, and theta notation to give asymptotic upper, lower, and tight bounds on time and space complexity of algorithms. 2. Determine the time and space complexity of simple algorithms. 3. Recognize the difference between mathematical modeling and empirical analysis of algorithms, and the difference between deterministic and randomized algorithms. 4. Deduce recurrence relations that describe the time complexity of recursively defined algorithms and work out their particular and general solutions. 5. Practice the main algorithm design strategies of Brute Force, Exclude & Conquer, Transform & Conquer, Divide & Conquer, Greedy methods, Dynamic Programming, Backtracking and Branch & Bound and implement examples of each. 6. Identify examples of everyday human behavior that exemplifies the basic concepts of the main design strategies 7. Implement the most common quadratic and O(N log N) sorting algorithms and perform their complexity analysis. 8. Solve problems using the fundamental graph algorithms including depth-first and breadth-first search, single-source and all-pairs shortest paths, transitive closure, topological sort, and the minimum spanning tree algorithms. 9. Evaluate, select and implement algorithms in programming context.