In fact, every problem in NP can be reduced to CIRCUIT SAT.
Denition of NP completeness
A problem Q is NP-complete if it is in NP and
every problem in NP can be reduced to Q.
CIRCUIT SATISFIABILITY is NP-complete.
So are all the other problems weve discus
MST-Prim(G,w,r)
Q=V
for each u in Q
key[u]=
key[r]=0
while Q is not empty
u=Extract-Min(Q)
for each v Adj [ u ]
if v Q and w(u,v)<key[v] then key[v]=w(u,v)
4
a
11
8
8
b
h
i
7
1
7
c
d
2
6
4
g
2
9
e
14
f
10
Running time: O(V+V lg V+E lg V)=O(E lg V)
using
Why is the second DFS run on GT?
consider vertex r with largest nish time
r is its own forefather: ( r ) =r
what are the other vertices in rs SCC?
any vertex that has r as the forefather, i.e. those that can reach r
but cannot reach any vertex with a nish
1. Tractable and Intractable Computational Problems
So far in the course we have seen many problems that have polynomial-time solutions; that is, on a problem instance of size n, the running time T (n) = O(nk ) for
some k , with k typically small. For exa
Let d(k)[i,j] be the weight of a shortest path from i to j whose intermediate
vertices are drawn from the set cfw_ 1, 2, 3, , k
If k=0, then d(0)[i,j]=w(i,j)
If k>0, then d(k)[i,j] is the minimum of d(k-1)[i,j] and d(k-1)[i,k]+d(k-1)[k,j]
i.e. d(k)[i,j]=
Digital Signatures using RSA
suppose you didnt care about eavesdropper, but wanted to make sure no one
can forge a message to look like it came from you
(credit card or check transactions over the Internet)
(,)
Bob signs
M
SB
=SB(M)
The discussion for the
Running time: O(V*E)
Proof of correctness:
s
v2
v1
v3
v
v4
v5
Let v be reachable from s, and let p = v 0, v 1, , v k , v 0 = s and v k = v ,
be a shortest path from s to v. Since p is a simple path, k<|V|.
We want to prove by induction for i=0,1,.,k that