Teaching plan
Reading Assignment
Dasgupta et al's book MIT (Cormen et al) book
Written Assingment
Week 1, Jan 14 Week 2, Jan 21 Week 3, Jan 28 Week 4, Feb 4 Week 5, Feb 11 Week 6, Feb 18 Week 7, Feb 2
Polynomials & FFT Reading Cormen et al. : Chapter 30 (recommended) Dasgupta et al. : 2.6 Lipson, Elements of Algebra & Algebraic Computing (available in the library)
Fast Fourier transform: math & alg
More NP complete problems
3SAT Clique Knapsack 3D matching Vertex Vertex Cover subset sum Hamiltonian path set cover Hamiltonian path TSP
Todays lecture sketches some reductions. You should fill in th
The first NP-complete problem
The Satisfiability problem (SAT): Given a formula F, find a satisfying truth assignment or else report that none exists. E.g., (x1 x2) (~ x2) : x1 = true, x2 = false x2 (
NP-completeness
Most recognized theoretical aspect of CS Methodology for showing some hard problems cant be solved efficiently. Reading: Dasgupta et al. Chapter 8 Cormen et als book (not recommeded)
1
Edmond & Karp Algorithm
Identical structure as the Ford and Fulkerson algorithm.
Start with zero flow f (i.e., f(u,v)=0 for all (u,v) E). Repeat Construct the residual network Gf with forward & backwa
Faster maximum flow algorithms
Notations.
n = number of vertices; m = number of edges; integer C = max capacity.
Ford & Fulkerson: O(nmC) time. Scaling FF: O(m2 log C) time. Edmond & Karp: O(m2 n) tim
Maximum Maximum flow
To remember: max flow = min cut Reading
Dasgupta: Chapter 7.2 Cormen et al. : Chapter 26.1-2
Assignment 1
Average 29.4 / 50 (expectation: 30 35) Max 45 / 50 Difficulty rating: ~4
All-pairs shortest paths
Input:
a weighted directed graph G = (V,E) edge weight w(e) can be +ve or ve;
To find: the shortest (smallest weight) path between all pairs of vertices. Assumption: G has no
Sequence similarity
DNA: From a computer scientists viewpoint, DNA is a sequence of characters chosen from the alphabet cfw_A, C, G, T. Human genome contains ~3 billion characters.
An A4 paper contain
Shortest paths revisited
Input:
a weighted directed graph G = (V,E) edge weight w(e) can be +ve or ve; vertexes s and t
To find: the shortest (smallest weight) path from s to t (s-t path). path). Reca
Dynamic programming
Greedy algorithm. Build up a solution incrementally by optimizing some local criterion. Remark. May not give optimal solutions; when yes, it often involves non-trivial analysis. Di
Interval Scheduling
Interval scheduling. Job j starts at sj and finishes at fj. Two jobs are compatible if they don't overlap. Goal: find the largest subset of mutually compatible jobs.
TIME
1
Interva
Greedy Algorithms
Huffman Encoding
Dasgupta et al. 5.2 Cormen et al. 16.3
Greedy algorithms
Characterization: Build up a solution in small steps; Each step makes a choice/decision based on a simple bu
Shortest paths
Dasgupta et al. 4.1-4.5 Cormen et al. 24.2-24.3
Shortest Paths in a Graph
Input: A directed graph G = (V, E), each edge e is associated with a positive weight (length), denoted w(e). So
Minimum (weight) spanning trees
Input: A connected undirected graph G = (V, E); each edge e in E has a weight or cost, denoted w(e). To find: MST = a subset of edges T E such that T is a spanning tree
Graphs
Graphs: a simple way of representing pairwise relationships among a set of objects. Graph theory: an old subject with modern applications. Graph algorithms - algorithms for graph problems.
1
Re
Divide and Conquer
Week 1 Reading
Examples Mergesort O(n log n) time Long integer multiplication O(n log n) time Finding the closest pair of points O(n log n) time Matrix mulitplication O(n2.81) time
0250B Algorithms (advanced class)
Regular class focuses on how basic algorithms work applications of algorithms Advanced class puts more emphasis on problem solving skills mathematical proofs (why it
CSIS 0250B Design and Analysis of Algorithms
Assignment 6 Sampled Solution
1
Figure 1: Solution for question 1 by Ng Wai Lun
2
Figure 2: Solution for question 2 by Feng Letain
3
Figure 3: Solution for
CSIS 0250B Design and Analysis of Algorithms
Assignment 6 Due: 11:55 PM, 1 May, 2009 1. Let G = (V, E ) be a degree-d, undirected graph, where d > 2. (I.e., every node has at most d neighbors.) An unr
CSIS0250B Design and Analysis of Algorithms Sample Solution to Assignment Five Questions 1 - 5 carry 20 marks each. 1. The input to the Clique-3 problem consists of a graph G and a positive integer b
CSIS 0250B Design and Analysis of Algorithms
Assignment 4 Due: 11:55 PM, Apr 16, 2009 1. Consider the CLIQUE problem restricted to graphs in which every vertex has degree at most 3. Call this problem
CSIS 0250B Design and Analysis of Algorithms
Assignment 4 Sampled Solution 1. As matching M of G with n 1 edges are given, we have 1 vertex on each side of the bipartite graph that are not matched. We
CSIS 0250B Design and Analysis of Algorithms
Assignment 4 Due: 11:55 PM, Apr 2, 2009 Below we assume that all networks have integer edge capacities, and the ow being considered have integer value. In
CSIS0250B Design and Analysis of Algorithms Sample Solution to Assignment Three Questions 1 - 4 carry 25 marks each. 1. (Solution by Tong Chiu Man) Assume U = n=1 ai is a multiple of three and ai U i
CSIS 0250B Design and Analysis of Algorithms
Assignment 3 Due: 11:55 PM, Mar 12, 2009 1. Given positive integers a1 , a2 , , an , devise a dynamic programming algorithm to determine whether it is poss