COMP333

Algorithm Theory and Design

 

 

Daniel Sutantyo

Department of Computing

Macquarie University

Summary

  • Algorithm complexity (running time, recursion tree)
  • Algorithm correctness (induction, loop invariants)
  • Problem solving methods:
    • exhaustive search
    • dynamic programming
    • greedy method
    • divide-and-conquer
    • algorithms involving strings
    • probabilistic methods
    • algorithms involving graphs

Week 1-2: Algorithms, Complexity, Correctness

  • formal statement of a problem, types of problems
  • induction
  • algorithm complexity:
    • \(O\)-notation, \(\Theta\)-notation, \(\Omega\)-notation
    • recursion tree, master method, and substitution method
  • algorithm correctness:
    • proof by induction for recursive algorithms
    • loop invariants for iterative algorithms
  • see workshop questions for practice

Week 3: Brute Force Algorithms

  • search-space tree, permutations and combinations
  • \(O(n!)\) and \(O(2^n)\) 
  • recursive backtracking, heuristic
  • not very examinable
    • the point of the topic is to give you some intuition on problem solving, and it is largely replaced by the topics in the following weeks
  • workshop questions can be 'difficult'

Week 4: Dynamic Programming

  • search-space tree
  • problems and subproblems (decomposition)
  • optimal substructure, cut-and-paste technique
  • approach:
    • show there is an optimal substructure
    • show the recursive relation that gives the optimal solution
    • compute value of the optimal solution
    • construct an optimal solution
  • workshop: maximum subarray, longest increasing subsequence

Week 5: Greedy Algorithm

  • optimal substructure, understand difference between dynamic programming and greedy
  • approach:
    • show there is an optimal substructure
    • show the recursive relation that gives the optimal solution
    • show that the greedy choice leads to only one subproblem
    • show that it is 'safe' to make the greedy choice
    • compute value of the optimal solution
    • construct an optimal solution
  • workshop: fractional knapsack, choosing stops (petrol stations)

Week 6: Divide and Conquer

  • majority of time was spent on master theorem, recursion-tree method and substitution method for finding complexity of algorithms (i.e. week 1-2 material)
  • workshop questions are very relevant

Week 7: Strings algorithm

  • longest common subsequence and edit distance problems
  • workshop questions:
    • do not have to worry about Huffman codes and string matching

Week 8: Probabilistic algorithm

  • understand what probabilistic algorithm is
    • Monte Carlo vs Las Vega
  • difficult topic to examine
    • requires backgound in probability theory
  • quicksort, Miller-Rabin test, 
  • don't worry about Rabin-Karp string matching (from workshop)

Week 9: Graph Algorithms

  • Graph traversal, DFS, BFS
  • Maximum flow problem
  • Bellman-Ford
  • Matrix multiplication method
  • Floyd-Warshall algorithm

Exam

  • 3 hours exam
  • Part A: 135 marks (6 questions), Part B: 45 marks (3 questions)
  • Some notes:
    • please revise induction, loop invariants, recursion-tree method, substitution method
    • some questions will be a repeat of workshop questions
    • some questions will be 'new', a problem that you (probably) have never seen before

Exam

  • Part A: 6 questions, each worth 15-25 marks, covering:
    • Complexity
    • Correctness
    • Greedy Algorithm
    • Dynamic Programming
    • Probabilistic Method
    • Graph Algorithms
  • Subparts of a question may ask questions related to brute-force methods