Combinatorial Algorithms
Reference Text:
Kreher and Stinson
Combinatorial Algorithms can be generally classified into three types:
1) Generation: Contruct all the combinatorial structures of a given type.
Examples of these structures are subsets, permutat

5
3 1 5 2 4
1 3 2 5 4
2 4 5 1 3
25
Remember when banks were exposed manipulating virtually
everything except precious metals, because obviously
nobody ever manipulates the price of gold and silver?
After all, the biggest "conspiracy theory" of all is
that

Public Key Cryptography
Slides courtesy of Professor Sheridan Houghten
COSC 4P03 Week 9
1
Public Key Cryptography History
For many years, the idea was attributed to Diffie
and Hellman, who presented the idea at a
conference in 1976 and published the idea

COSC 4P03 Advanced Algorithms
Winter 2014 Assignment #2
Due Date:
14th March 12:00 noon
Late Date: 17th March 12:00 noon
This assignment accounts for 15% of your final grade and is worth a total of 100 marks.
This assignment is courtesy of Professor Sheri

Still more dynamic programming
The 0-1 knapsack problem
1
There are several different versions of the knapsack
problem (fractional, unbounded, 0-1).
We will be looking at the 0-1 problem.
We are given a set of items I1 to In.
Each item Ii has a certain va

More dynamic programming
Longest common subsequence
Definition of Subsequences on board.
Proof of optimal substructure on board.
Recursive Formula derivation on board.
Example from CLRS.
Lambda is the null string. We fill the first row and column with zer

COSC 4P03 Advanced Algorithms
Winter 2014 Assignment #3
This assignment courtesy of Professor Sheridan Houghten
Due Date:
April 4th, 12:00 noon
Late Date:
April 7th, 12:00 noon
This assignment accounts for 15% of your final grade and is worth a total of 1

Greedy Algorithms
See chapter 16 of CLRS
The following material was covered in class on the board:
1)Explanation of the greedy choice property and optimal
substructure.
2)Comparison to dynamic programming.
3)Worked through the example of the activity sele

Week 7
Heuristic Searches
Intro to Cryptography
Slides courtesy of
Professor Sheridan Houghten
1
Generic Heuristic Search see section 5.1,
KS
c = 0;
select a feasible solution X;
Xbest = X;
while(c <= cmax) / c counts the number of iterations
cfw_
Y = hN(

Week 5
Courtesy of Sheridan Houghten
1
Lexicographic Order Subsets of cfw_1, , n
(See KS, algorithm 2.1)
Algorithm to find rank of subset T:
FindRank(n, T)
cfw_
rank = 0;
for (i = 1; i <= n; i+)
if i is in T
rank = rank + 2^(n-i);
return rank;
2
Lexicogr

Dynamic Programming for the
Edit Distance Problem
Hamming Distance
Hamming distance is the number of positions where two
strings of equal length have different characters.
Example: The strings
0010100111010
0110110110010
have a Hamming distance of 3.
I

Cryptanalysis
With thanks to Professor Sheridan Houghten
Example 1.11: Ciphertext obtained from
a Substitution Cipher
YIFQFMZRWQFYVECFMDZPCVMRZWNMDZVEJBTXCDDUMJ
NDIFEFMDZCDMQZKCEYFCJMYRNCWJCSZREXCHZUNMXZ
NZUCDRJXYYSMRTMEYIFZWDYVZVYFZUMRZCRWNZDZJJ
XZWGCHSM

Dynamic Programming
Lets begin by looking at the Fibonacci sequence.
The Fibonacci sequence is defined by the recursive
formula Fib(x) = Fib(x-1) + Fib(x-2)
However, actually using recursion to calculate
Fibonacci numbers is extremely inefficient.
Does an

Brock University
Department of Computer Science
COSC 4P03 Advanced Algorithms
Winter 2014
Instructor: John Orth. Email jorth@brocku.ca. Consultation after the class or by appointment.
Prerequisite:
COSC 3P03 (minimum 60%) or permission of the instructor.

COSC 4P03 Advanced Algorithms
Winter 2014 Assignment #1
Due Date: Tuesday, February 18, 12:00 noon Late date: Friday, February 21, 12:00 noon
This assignment accounts for 15% of your final grade and is worth a total of 150 marks.
Most of this assignment i

Approximation Algorithms
Definition of approximation ratio and approximation scheme on
board.
Vertex Cover approximation algorithm on board.
Here is the graph we begin with: (from Cormen, Leiserson,
Rivest, and Stein CH 35)
Select edge (b,c) shown heavy a

Instructor: John Orth
I am available for consultation on Tuesdays from 10:00 AM till
12:00 noon in J304, or after the class, or by appointment.Until my
new email becomes active I can be reached at my student's email
jo05bi.
Class time and location
Tuesday