Cpt. S. 3343: Analysis of Algorithms
Fall 2007

Course Web Page: http://www.cs.utsa.edu/~kwek/cs3343.html

Time and Location: TuTh 3:30-4:45 pm, HSS 2.01.33 

Instructor: Dr. Stephen Kwek (Office: BB 4.01.18 ) 

Instructor's Office Hours:  TuTh 2-3pm

Teaching Assistant:  Amitava Karmaker (email: akarmake@cs.utsa.edu)

TA's Office Hours: M 4-5pm, SB 3.02.10A

Prerequisite: CS 2413, CS3233, and MAT 2213 

Textbook: Introduction to the Design and Analysis of Algorithms, Anany Levitin. Addison-Wesley. ISBN: 0-201-74394th Octo5-7

  1. Objectives: This course is to provide an introduction to the design and analysis of computer algorithms. The students will learn how to analyze the performance of computer algorithms, and  programming techniques and data structures used in the writing of effective algorithms. 
  2. Course Topics (tentative and not in order): 
    • [Ch. 1] Introduction
      • Specification of an algorithm
      • Requirement of an algorithm
    • [Ch. 2] Asymptotic Notations [material from CLR][lecture notes 1 , notes 2]
      • Comparing running time of two programs
      • Aymptotic notations
      • Asserting bounds
        1. Derive from definitions
        2. Using Limit
      • Efficiency classes
      • Analyzing running time for iterative algorithms:
        1. Count number of basic operations (Example: selection sort)
        2. Rough estimate (Example: Matrix multiplication)
      • Idea behind Recursion:
        1. Boundary case: small input (easy solution)
        2. Not so small input: solve smaller subproblem(s) and extend it to the larger problem
      • Express running time as a recurrence
      • Solving recurrences
        1. Substition
        2. Iterative Method
        3. Master Theorem
    • [Ch. 3] Brute Force Method [notes]
      • Exhaustive search
      • Brute force evaluation
      • Advantages and disadvantages of brute-force approach
      • More examples: Traveling salesman problem and knapsack problem.
    • [Ch. 4] Divide-and-Conquer: Merge-sort, tree traversal and related algorithms 
      • Components of Divide and Conquer Technique:
        • Boundary Case
        • Recurrence: 
          1. Divide - partition the problem into subproblems.
          2. Conquer - Solve the subproblems 
          3. Merge - 'combine' the solutions to subproblems to one that solve the original problem. 
      • Examples: Merge Sort, Summing up array of integers.
      • Tree Traversals: preorder, inorder and postorder.
      • Further examples: Computing the height of a tree, and counting the number of nodes in a tree. 
    • [Ch. 5] Incremental Methods (Decreased and Conquer) 
      • Components of Chip and Conquer Technique:
        • Boundary Case
        • Recurrence: 
          1. Chip - Reduce the problem to a slightly smaller problem.
          2. Conquer - Solve the smaller problem
          3. Extend - Extend the solution to solve the original 
        • Examples: insertion sort, removing nodes from a linked list and counting number of nodes with key 'a' in list.
      • Incremental Method:
        • Depth first search, depth-first search forest and types of edges
        • Breath first search, breath-first search forest and types of edges
        • Topological sort
        • Rank-k selection
    • [Ch. 6] Transform and Conquer [material on heaps]
      • Techniques:
        1. Change to easier input instance (e.g. presorting)
        2. Change the input representation (i.e. data structures)
        3. Problem Reduction
      • Data Structures:
        • Heaps
        • AVL-tree
        • (2.,3)-tree
    • [Ch. 9] Greedy Algorithms[lecture material:greedy and dynamic programming, MST, Problems]
      • Minimum spanning trees
        • Prim's algorithm
          • Proof of correctness:
            1. Greedy choice is in some solution
            2. Optimal substructure property.
        • Kruskal's algorithm
          • Proof of correctness:
            1. Greedy choice is in some solution
            2. Optimal substructure property.
      • Activitry selection problem
        • Proof of correctness:
          1. Greedy choice is in some solution
          2. Optimal substructure property.
      • Why proof?
        • Knapsack Problem
        • Fibonacci Example
    • [Ch. 8] Dynamic Programming [Optimum Binary Search Trees, Problems]:
      • Elements of Dynamic Programming:
        1. Understand where function f() is your solution optimizing.
        2. Express f (n) in terms of f( ) of smaller subproblems. [But note that simple divide-and-conquer strategy yeield a slow exponential time algorithm].
        3. Construct a table for f() and an auxilary table l to keep track of how the entries in f() were obtained.
        4. Using the table construct the optimum solution/
      • Longest common subsequence
        1. Freshman approach: Brute force -- enumerate all 2n possibilites..
        2. Sophomore approach: Divide and conquer -- a very short program that runs much slower than brute fore due to recomputation of the same problem
        3. Dynamic programming approach -- O(mn) time.
    • [Ch. 10] NP-Completeness  [material from CLR, exercises]
      • The need to learn about NP-Completeness.
      • Opimization problem vs. decision problem
      • A list of problems: graph-coloring, Hamiltonion cycle (path), traveling saleman problem, kanpsack, bin-packing, satisfiability.
      • The size of an input. Prime factorizing problem
      • Polynomial time reduction
      • Definition of NP-hard and NP-complete
      • Proving NP-Completeness.
      • Dealing with NP-Completeness:
        • Restricted cases of NP-complete problems maybe easy.
        • Approximation algorithm
        • Randomized algorithm
        • Heuristics and hope for the best (without any guarnatee on the approximation ratio).

    Grading:
         Exam 1 15% 
         Exam 2 15% 
         Final Exam 35% 
         Lab Work 10% 
         Homework plus programming projects 25% 
         Class participation: 5% 

    No grades will be dropped.  Exams cannot be made up, cannot be taken early, and must be taken in class at the scheduled time.  There will be no make up exams. The grade that you obtain for the course will also be served as the grade for the lab. 

    The letter grade for the course will be determined as follows:  80% or better = A; 70 to 79.99 = B; 60 to 69.99 = C; 50 to 59.99 = D; and less than 50 = F.  The instructor may curve this scale down but will not curve it up. 

    Since your grade is partially based on computer and homework assignments, they must be your own work unless otherwise stated in the assignment. You can ask me questions about any aspect of an assignment and pursue general discussions with others on the system or on an approach to solving a problem. 

    The assignments are typically due on Tuesday before class. If for any personal or health reason, you are not able to hand in on Tuesday, you can hand in on the following Thursday (i.e., two days later) without asking for the instructor permission. However, no assignment will be accepted after Thursday. 

    Cheating (for example, copy homework solution from the web, friends or other textbooks) will result at least in an immediate failing grade ('F') and maybe expelled from UTSA. Anyone who assists in cheating (e.g. letting others copied your solution) will receive the same penalty. All the written work should be done by yourself, although some group discussion is strongly encouraged. 

    It is your responsibility to contact me in a timely manner if there are extenuating circumstances that impact your ability to perform in this class. Your grade is 'not given' by the instructor, but rather is earned by you through demonstrating your mastery of the subject. A poor grade does not say anything about you as a person. 

    Assignments:

      Assignment 1: Asymptotic Notations  [Soln]
      Assignment 2: Time Analysis  
      Assignment 3: Solving Recurrences 


    Important Dates:

    1. Test 1: 2nd October (Tues)
    2. Test 2: 6th November  (Tues)
    3. Final: TBA