BYU Computer Science Department

CS 312, Sections 001 & 002
Algorithm Analysis
Winter 2009


InstructorEric Ringger

Class Pagehttp://faculty.cs.byu.edu/~ringger/CS312/


Schedule

Last updated: 2009 April 21

Topics, readings, and homework assignments will be fine-tuned as we progress through the semester.  Hyperlinks will be added.  Check this schedule frequently.

Optional readings are enclosed in (parentheses).

Note: Keys to each homework assignment will be made available on Blackboard on or soon after the assignment's due date.

Date

Lecture

Topics

Reading
(Read before class)

Assignment Due Dates
(Homework due in class at start of class;
Project reports due by 5pm submitted online.)

Week 1

1/5

1

Course objectives;
What is an algorithm?;
Algorithm efficiency;
The Three Questions; Asymptotic notation

---

---

1/7

2

Asymptotic notation: Duality, Limit rule;
First Foray in Analysis: Algorithms for Arithmetic

Course Syllabus and Schedule;
Chapter 0; Sections 1.1 and 1.2

Install Visual Studio (see directions in the course Syllabus)

1/8

-

Help Session: Project #1
Also: Intro. to Visual Studio & C#
[4pm in 1060 TMCB]

Project #1 Guidelines;
Intro. to C# on MSDN

---

1/9

3

Asymptotic notation: Max rule;
Modular arithmetic, including Modular exponentiation

Section 1.3

HW #1: 0.1 (a-e, g, m), 0.3 (a) in the textbook;
New: 0.3 (b) is extra credit

Week 2

1/12

4

Primality testing; Greatest Common Divisor

Section 1.4

HW #2: 1.25 in the textbook, then redo 1.25 using 126 for the exponent

1/14

5

Public Key Cryptography: RSA

Section 1.4

HW #3: 1.9, 1.18, 1.20 in the textbook

Early #1

1/16

6

Divide & Conquer Multiplication;
Master Theorem;
Example: Convex Hull

Sections 2.1 and 2.2

Project #1: Simple Fermat Primality Tester (for small integers)

Week 3

1/19

-

Holiday: Martin Luther King, Jr. Day

1/20

-

Help Session: Project #2
[4pm in 1029 TMCB]

Project #2 Guidelines

---

1/21

7

Intro. to Recurrence Relations;
Solving homogeneous RRs

Recurrence Relations Notes, Part I

HW #4: 1.27, 2.1, 2.5(a-e) in the textbook; for 2.5 (a-e), only find bounds using the Master Theorem

1/20

-

Help Session: Project #2
[4:15pm in 1029 TMCB]

Project #2 Guidelines

---

1/23

8

Non-homogeneous recurrence relations (with geometric forcing function)

Recurrence Relations Notes, Part II

HW #5: Part I (Section 1.2) Exercises in the RR Notes

Week 4

1/26

9

Recurrence relations: change of variable;
Theoretical analysis of mergesort;
Proof of Master Theorem

Recurrence Relations Notes, Parts III & IV

HW #6: Part II (Section 2.3) Exercises in the RR Notes

1/28

10

Theoretical and analysis of quicksort, worst case, best case, and average case;
Empirical analysis of both mergesort and quicksort

Section 2.3

HW #7: Part III (Section 3.2) Exercises 1 and 2 in the RR Notes;
+ Analyze 3-part Mergesort using Recurrence Relations solution techniques;
+ 2.4 in the text book (using the Master Theorem where possible)

Early #2

1/30

11

Selection, Median;
Matrix multiplication with Strassen's algorithm

Sections 2.4 and 2.5

Project #2: Divide & Conquer - Convex Hull

Source Code Distribution

Week 5

2/2

12

Convolution;
Fast Fourier Transform (FFT)

Section 2.6

Project #2 on-time submission until noon
[due to power outage and electrical upgrade]

2/4

13

Graph algorithms: Formulating problems as graphs;
Depth-first Search and Connected Components

Chapter 3.1-3.2

HW #8: 2.11 in the textbook

2/5

-

Help Session: Project #3, part A
[4pm in 1029 TMCB]

Project #3 Guidelines

---

2/6

14

Directed Graphs, Linearization, Connectedness

Section 3.3

HW #9.1: 3.31 a-f in the textbook; critical for Proj. #3;
Here are some hints for 9.1 and 9.2.

Week 6

2/9

15

Strongly connected components

Section 3.4

HW #9.2: 3.31 g-h in the textbook; critical for Proj. #3;

2/10

-

Help Session: Project #3, part B
[4pm in 1029 TMCB]

Project #3 Guidelines

---

2/11

16

Breadth-first search; Shortest Paths;
Dijkstra's algorithm

Sections 4.1-4.5

HW #10: 3.4 (graph ii only; start the SCC-finding algorithm at a vertex other than A -- we already did that in class), 3.10 (this one is important for project #3 as well), 3.15 -- all in the textbook

2/13

17

Dijkstra's algorithm: Efficiency with various Priority Queue implementations;
Special cases for Shortest Paths;
Bellman-Ford algorithm

Sections 4.6-4.7

HW #11: 4.1 in the textbook

Early #3

Week 7

2/16

-

Holiday: President's Day

2/17
Monday Instruction

18

Greedy algorithms: Coins;
Minimal spanning trees,
Kruskal's algorithm

Section 5.1

Project #3: Graph Algorithms - Separating Vertices, Bridges, and Biconnected Components

Source Code Distribution

Vista and x86 only: ArticulationPoints assemblies for x86 Vista

2/17

-

Help Session: Project #4
[4pm in 1029 TMCB]

Project #4 Guidelines

---

2/18

19

Representing disjoint sets;
Analysis of Kruskal's;
Prim's algorithm for MST

Section 5.1

HW #12: 4.2, 5.1 a-b in the textbook

2/20

20

(Divisible) Knapsack

Section 5.2; (Sections 5.3-5.4)

HW #13: 5.2a in the textbook

Week 8

2/23

21

Dynamic Programming;
Binomial Coefficients;
Coins;
Extracting solutions

Sections 6.1-6.2

HW #14: described in separate document

2/25

22

Optimality in DP;
Edit Distance;
Gene Sequence Alignment

Section 6.3

HW #15: described in separate document

Early #4

2/27

23

0/1-Knapsack

Section 6.4

Project #4: Intelligent Scissors

Source Code Distribution

Week 9

3/2

24

Chain Matrix Multiplication;
Extra: Recursion and Memory functions (Memoization)

Section 6.5

HW #16: described in separate document

3/3

-

Help Session: Project #5
[4pm in 1029 TMCB]

Project #5 Guidelines

---

3/4

-

Review: Mid-Term Exam

Study List of Topics for Mid-Term Exam

Your (optional) notes sheet for the mid-term exam (to be handed in with exam)

3/5

Mid-Term Exam in Testing Center

3/6

3/7

Week 10

3/9

25

All-Pairs Shortest Paths; Floyd's Algorithm

Section 6.6; (Section 6.7)

HW #17: described in separate document

3/11

26

Linear Programming; Standard Form

Section 7.1

HW #18: described in separate document
Early #5

3/13

-

Follow-up: Mid-Term Exam

---

Project #5: Gene Sequence Alignment

Source Code Distribution

Week 11

3/16

27

Flows in Networks

Section 7.2

HW #19: 7.1, 7.2 in the textbook

3/17

-

Help Session: Project #6
[4pm in 1029 TMCB]

Project #6 Guidelines

---

3/18

28

Flows in Networks (cont.);
Examples; Bipartite Graph Matching

Sections 7.3-7.4

HW #20: 7.10 in the textbook

3/20

29

Simplex Algorithm

Section 7.6;
Linear Programming Notes (Important for the Project)

HW #21: Formulate problem (part 1) of Project #6

3/21

-

College of Physical and Mathematical Sciences
Spring Research Conference

[8am-1pm in 1104 JKB]

Week 12

3/23

30

Review: Tractability, P, NP, and NP-Complete

Section 8.2: pp. 243-247 

Early #6

3/25

31

State-space search and Back-tracking: Graph coloring, 8 Queens;
Feasibility functions

Sections 9.1-9.2

Project #6: Linear Programming

(no code distribution)

3/26

-

Help Session: Project #7
[4pm in 1029 TMCB]

Project #7 Guidelines

---

3/27

32

State-space search and Bound functions;
Branch and Bound search for Job Assignment

Section 9.1.2 Improvement Proposal

Week 13

3/30

33

Tight bounds;
Solving the TSP with Branch and Bound

Branch &Bound for TSP Notes
(Useful for the Project)

HW #22: described in separate document

4/1

34

State spaces;
Solving the TSP with Branch and Bound (cont.)
Extra slides with hints on implementing Include-Exclude State Space HW #23: described in separate document

4/3

35

Best-first Search: A* Search and Admissible Heuristics;
Relation to Branch & Bound

Russell & Norvig 4.1-4.2 [available under Course Materials or Course Documents on BlackBoard]

HW #24: described in separate document

Early #7

Week 14

4/6

36

A* (cont.);
Relaxed Problems: solutions as bounds / heuristics

---

Project #7: Solving the TSP with Branch & Bound

Source Code Distribution

4/8

37

Randomized Algorithms;
Monte Carlo Algorithms;
Amplification of Stochastic Advantage

"Virtual Chapter" (beginning with the gray box on p. 29)

No homework due -- make progress on your improvement!

4/10

38

Amplification of Stochastic Advantage (cont.)

Bonus lecture #39: Numerical Probabilistic Algorithms and Las Vegas Algorithms

HW #25: described in separate document

Week 15

4/13

-

Last day of CS 312
Review: Final Exam

Study List of Topics for Final Exam

Early: Improvement Report

4/14

-

Last day of Winter Instruction  (no CS 312)

Improvement Report

No late project reports accepted after this date

4/15

-

Reading days

4/16

4/20
Monday

-

Final Exam for Section 002: 11:00am-2:00pm in Classroom

4/21
Tuesday

-

Final Exam for Section 001: 11:00am-2:00pm in Classroom