Tutorial 11
1. Show that the question of determining whether a graph
G
= (
V,E
) has a simple cycle of
size at least
k
is NPcomplete.
Ans: (a) Certiﬁcate would be a cycle of size at least
k
.
Veriﬁer just checks whether the cycle is indeed simple (that is, it does not repeat a
vertex), and all the edges in the cycle are indeed in the graph. This clearly can be done
in polynomial time.
(b) Hamiltonian circuit problem can be reduced to the above problem by using the same
graph and taking
k
=
n
(the number of nodes in the graph).
2. Consider the following problem called vertex cover.
Input: An undirected graph
G
= (
V,E
), and a number
k
.
Question: Does there exists a vertex cover of size
k
? That is, does there exist
V
0
⊆
V
,

V
0
 ≤
k
such that, for each edge (
u,v
)
∈
E
, at least one of
u,v
is in
V
0
.
Show that the above problem is NP complete.
Ans:
(a) To show that the problem is in NP, the certiﬁcates would be of the form
V
0
of cardi
nality at most
k
which form a cover.
Veriﬁcation would be to check that indeed
V
0
⊆
V
,

V
0
 ≤
k
, and for every edge (
u,v
)
∈
E
,
at least one of
u,v
is in
V
0
.
(b) Two methods.
First method: Note that for a given graph
G
= (
V,E
),
V
0
is a vertex cover iﬀ
V

V
0
is an independent set. Thus, there exists a vertex cover of size
≤
k
iﬀ there exists an
independent set of size
≥ 
V

k
. As independent set problem is NPhard, we immediately
get that vertex cover problem is NPhard.
Second method:
Direct reduction from 3SAT:
Suppose (
U,C
) is a 3SAT problem.
Consider the vertex cover problem constructed as follows:
Suppose
U
=
{
x
1
,x
2
,...,x
n
}
, and
C
=
{
c
1
,c
2
,...,c
m
}
, where
c
i
=
`
1
i
∨
`
2
i
∨
`
3
i
.
Then, let