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 our analysis, you can express the time complexty in ter
CSIS0250A Design and Analysis of Algorithms Assignment 1 Due Date: February 11, 2010, 11:59 pm Question 1. (10%) Solve the following recurrence relations (i.e., nd out what is T (n), using big-O notation). You are required to show the results as well as t
Posted on 16 April 2009 14:08
>Dear Prof. Lam
>In assignment 5 question 3, can I quote that 3D matching can be reduced
>to ZOE (Dasgupta, p254) and then do ZOE -> CNFSAT?
>Since CNFSAT is NP-complete, we all know that there
>exists a polynomial time algor
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 the details and proof of correctness.
1
NPThe Knapsack pr
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 (~ x2) : no satisfying assignment exists. Theorem [Cook
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
No efficient algorithms
A simple search problem withou
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 & backward edges. Find a path p with residual capacity rc from
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) time; edge capacity can be arbitrarily large real number.
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 (expectation: 4) Mid-term (Friday 10:40 11:35) Divide a
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 negative cycles. Using Bellman-Ford algorithm, we can f
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 contains 5 to 10 K characters, you need ~.5 million sheets she
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 & algorithm
From Wikipedia, the free encyclopedia A fast Fou
Posted on 15 April 2009 09:49
>Hi Prof. Lam,
>Thanks for your explanation!
>One other question: Assignment 5, question 1
>Given the graph G=(V,E)
>CLIQUE-3 can only handle the problem with clique size k <= 4 (but I know |V| can be more
>than 4 actually),
Posted on 14 April 2009 09:49
>I want to ask in Q3, We have to prove "3D <=p CNFSAT" or "CNFSAT <=p 3D"?
>Q3 asks for a polynomial time algorithm to reduce 3D matching to
CNFSAT. The other direction can be found in most textbooks, you
are welcome to read
Posted on 14 April 2009 09:49
>I want to ask in Q3, We have to prove "3D <=p CNFSAT" or "CNFSAT <=p 3D"?
Q3 asks for a polynomial time algorithm to reduce 3D matching to
CNFSAT. The other direction can be found in most textbooks, you
are welcome to read i
Posted on 25 March 2009 18:38
> Dear Prof. Lam,
> I want to clarify question 1. The question said: "You are given a matching M of G with
> n - 1 edges". I want to ask is that every edges in these n-1 edges are have one end in
> left and the other end in r
Posted on 25 March 2009 10:00
> Hi Prof. Lam,
> Can I apply the Ford-Fulkerson Algorithm when the source is not in-degree 0 and the
> sink is not out-degree 0? as the assumption is that no edge enters the source s and no
> edge leaves the sink t.
> Thanks
Posted on 26 February 2009 10:37
> Dear Prof. Lam,
> in question 2, you said that we are required to find the "weight of the
> shortest cycle", by "shortest", do you mean that the total number of edges
> in the cycle is the smallest
> OR
> do you mean th
Posted on 24 February 2009 11:48
> Dear Prof. Lam,
> In the assignment, can i use some well-known algirithm in the
> intermediate steps? Like Q3, i want to use dijkstra algorithm on G and reverse G to find
> shortest path from v and to v in the first step
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 25 Week 8, Mar 4 Week 9, Mar 11 Week 10, Mar 18 Week 11,
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). Recall that the proof of Dijkstras algorithm fails if there
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. Divide and conquer. Break up a problem into two subproble
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 where the degree of G is bounded by 3. CLIQUE-3 is the
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 CLIQUE-3. (a) Prove that CLIQUE-3 is in NP. (b) What is
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 construct a directed graph G from G. For each edge e(u
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 3 for all i = 1, 2, , n. Otherwise, it is not possible
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 possible to divide the n integers into three disjoint subse
CSIS0250B - Sample solution for Assignment 2 (2009-03-12)
For a general graph, the cost value of any two nodes in the same strongly connected component will be the same since both are reachable from each other. Hence, it is sufficient to run the below alg
CSIS 0250B Design and Analysis of Algorithms
Assignment 2 Due: 11:59 PM, Feb 26, 2009 Warm-up (no need to turn in) 1. Given a directed graph G in adjacency list format, show how to construct the reverse graph in linear time. 2. Give a linear-time algorith