CS 6505 Homework 3
Problem 1. Negative Cycle with Floyd-Warshall
Algorithm 1 extends Floyd-Warshall algorithm to detect a negative-cycle and print it if exists. Suppose the argument W is the adjacency matrix expression of the input graph G = (V, E ). Star
CS 6505 Midterm 1
Problem 1.
Denote by T (n) the number of xs output by ExpRecurse. Then we have the recurrence T (n) =
2T (n 1) + 1 and the initial condition T (1) = 1.
T (n) = 2T (n 1) + 1 = 4T (n 2) + 2 + 1 = 2n1 + + 1 = 2n 1
Problem 2.
Consider the gr
Last Name: . First Name: . Email: .
CS 3510 A, Springl 2015, Final Exam, 4-29-15
Page 1/10
Problem 1: Analyze Recursive Algorithm, 10 points.
Consider the function Mystery defined below.
Mystery(n)
print(xxx);
if n > 1 then begin
Mystery(n/2);
Mystery(n/2
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Homework 4, 2/19/16 Due 2/26/16 5pm Klaus 2138 Page 1/5
Problem 1: Testing Bipartiteness, DFS Application (20 points)
(a) An undirected graph G(V, E) is bipartite if and only if V can be partitione
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Homework 5, 3/5/16 Due 3/11/16 5pm Klaus 2138 Page 1/10
Problem 1: Second Best MST (10 points)
Let G(V, E) be an undirected connected graph whose edge weight function is we > 0 for all e E
and such
MINCOST VERTEX COVER
Linear Time Dynamic Programming Algorithm for Line Graphs
1. Definition of mincost vertex cover problem in General Graphs
G(V, E), |V | = n, is an undirected graph.
C V is a vertex cover iff every vertex cfw_u, v E has at least one en
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Homework 3, 2/04/16 Due 2/11/16 5pm Klaus 2138 Page 1/5
Problem 1: Generalized shortest-paths problem (20 points)
In Internet routing, there are delays on lines but also, more significantly, delays
IDL Commands and Syntax
This document will cover various aspects of the structure of the IDL
language. It is organized into the following sections:
Variable Types
Procedures and Functions
Logical Operators
Mathematical Operators
Mathematical Functions
Com
Lecture 1:
Recursive Algorithms, Preliminaries:
Towers of Hanoi, Bubblesort, Mergesort, Binary Search
Solving Recurrences by Substitution, Sketch/Intro
(also solution Visualization by expanding the recursion tree)
Reading before coming to Lecture 2, also
LONGEST PATHS IN DAGs
Linear Time Dynamic Programming Algorithm
1. Definition of Longest Path problem in General Graphs
G(V, E), |V | = n, is a directed acyclic graph.
Every edge e E has a given cost cost(e) without restriction, ie cost(e) can be positive
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Quiz2, Practice Solutions
Page 1/4
Problem 1: Mincut Maxflow (25 points)
Figure 1a below indicates a flow f over a maxflow network G with source S and sink T.
(a) Draw the residual graph Gf on Figu
SaLViN&
RECURRENLES
Step 1_ (the- harries+ .pctr+)
[i, +his se-+
1
of
Ylo
fe>
11-1 E
SoLu-rioJJ
do He 8t.tSSi~
we wi II
l.t_
Sfep2 (the ea.sy fcJ.r-)
G-UESS
pa.rf
SUSSTl.Tt.rr1 oN
1? E PE/~ TED
'PRoVe 6'-uESSE-.D SoLu-HoN
is
CORRECT
(ty pi eqJ[y by ~.,J.w
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Homework 4, 2/19/16 Due 2/26/16 5pm Klaus 2138 Page 1/5
Problem 1: Testing Bipartiteness, DFS Application (20 points)
(a) An undirected graph G(V, E) is bipartite if and only if V can be partitione
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Practice Quiz 1, Page 1/4
Problem 1: Analysis of Recursive Algorithm (25 points)
Consider the function Mystery defined below.
Mystery(n)
if n > 1 then begin
print(xx);
Mystery(n/3); Mystery(n/3); M
Last Name: . First Name: . Email: .
CS 3510 C, Fall 2014, Final Exam, 12/10/14
Page 1/10
Problem 1: Analysis of Recursive Algorithm, 10 points
Where n is a positive power of 2, how many xs (in terms of n) does function F (n) below print?
Give an exact ans
FTP Client
RWH
September 4, 2015
Abstract
An interesting feature has been pointed out to me by a student.
There isnt any way to upload a le directly from the unix machine to
D2L. Youll need to transfer the le to a machine that has a web-browser
on it rst.
Last. Name: . First Name: . Email: .
cs 3510/11, Spring 2016, Hardness Homework Page um
Problem 1: Hamilton Path in BAGS (10 points)
Show that the Directed Hamhm Path problem can be solved in polynomial time. in. directed acyciic.
graphs. Give an efcient
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Homework 2, 1/29/16 Due 2/04/16 5pm Klaus 2138 Page 1/5
Problem 1: Weighted Median (20 points)
P
For n distinct positive weights w1 , w2 , . . . , wn such that ni=1 wi = 1, the weighted median is t
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Homework 5, 3/5/16 Due 3/11/16 5pm Klaus 2138 Page 1/10
Problem 1: Second Best MST (10 points)
Let G(V, E) be an undirected connected graph whose edge weight function is we > 0 for all e E
and such
Algorithms
In Wall Street, that iconic movie of the 1980s, Michael Douglas gets up in
front of a room full of stockholders and proclaims, "Greed . is good. Greed
is right. Greed works." In this chapter, we'll be taking a much more understated
perspective
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Quiz 3, 4-22-16 Due 4-25-16 Klaus 2138 Page 1/4
Problem 1: Hardness Reduction 0-1-TSP (25 points)
Recall that Hamilton Cycle is the following problem.
Input: Undirected graph G(V, E).
Output: YES i
Last Name: . First Name: . Email: .
CS 3510 A, Springl 2015, Practice Final Exam
Page 1/10
Problem 1: 10 points.
Consider the function Mystery defined below.
Mystery(n)
if n > 1 then begin
print(xxx);
Mystery(n/2);
end
If we call Mystery(n), where n is an
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Homework 1, 1/13/16 Due 1/20/16 in class
Page 1/8
Problem 1: Analysis of Recursive Algorithm (10 points).
Consider the function Mystery defined below.
Mystery(n)
if n > 1 then begin
print(x);
Myste
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Homework 3, 2/04/16 Due 2/11/16 5pm Klaus 2138 Page 1/5
Problem 1: Generalized shortest-paths problem (20 points)
In Internet routing, there are delays on lines but also, more significantly, delays
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Homework 1, 1/13/16 Due 1/20/16 in class
Page 1/8
Problem 1: Analysis of Recursive Algorithm (10 points).
Consider the function Mystery defined below.
Mystery(n)
if n > 1 then begin
print(x);
Myste
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Quiz2, Practice
Page 1/4
Problem 1: Mincut Maxflow (25 points)
Figure 1a below indicates a flow f over a maxflow network G with source S and sink T.
(a) Draw the residual graph Gf on Figure 1b.
(b)
Last Name: . First Name: . Email: .
CS 3511, Spring 2016, Homework 6, 4/6/16 Due 4/14/16 5pm Klaus 2138 Page 1/10
Problem 1: Hamilton Path in DAGs (10 points)
Show that the Directed Hamilton Path problem can be solved in polynomial time in directed acycli
Homework 6, Tuesday April 9
Due Wednesday April 17
Problem 1: Let G(V,E) be a tree, and suppose all vertices have the same cost (say 1). Give a polynomial
time algorithm that finds the optimal (minimum number of vertices) vertex cover . Prove that your
al
CS 6505 Homework 2
Problem 1. Recurrence Relation
We prove this by induction. Assume that T (k ) = O(k log k ) for some k n. That is, T (k )
c k log k for some constant c 0. Then,
2n
n
+T
+ cn
3
3
n
n
2n
2n
c log + c
log
+ cn
3
3
3
3
c
2c
= (n log n n l
MST = Mincost Spanning Tree
First Three Efficient Algorithms, then why they work.
4
32
A
1
C
B
30
E
20
40
F
G
2
32
4
30
E
F
2
D
E
20
40
F
13
G
2
H
10
10
D
15
B
15
H
1
C
1
C
B
4
30
13
consdider edges in increasing order of cost
add an edge to the MST if it
CS 3511 - Spring 2016
Syllabus
Description and list of Topics and Methods:
Recursive Algorithms, Divide and Conquer, Sorting (bubblesort, mergesort, quicksort, heapsort),
Searching (median finding and order statistics), Strassens Multiplication, Fast Fou
DFS in UNDIRECTED GRAPHS
DFS G(V,E)
T:=0; N:=0;
for all v in V set status(v):= UNVISITED;
for all cfw_u,v in E set status(cfw_u,v):=UNTRAVERSED
A
B
while there exists v in V with status(v)=UNVISITED
SEARCH(v)
SEARCH(v)
T:=T+1; start(v):=T;
N:=N+1; number(
CS 161: Design and Analysis of
Algorithms
NP-Complete II: More NP-Complete
Problems
The problems
Some reducBons
So Far
All of NP
Circuit SAT
3SAT
Independent Set
SAT
Recipe For Proving NP-Completeness
Pick a