23 fl 24 np complete
TRANSCRIPT
-
7/24/2019 23 Fl 24 Np Complete
1/44
-
7/24/2019 23 Fl 24 Np Complete
2/44
-
7/24/2019 23 Fl 24 Np Complete
3/44
-
7/24/2019 23 Fl 24 Np Complete
4/44
Decision Problems
To keep things simple, we will mainly concern ourselves withdecision problems. These problems only require a single bit output:
``yes'' and ``no''.
ow would you solve the !ollowing decision problems"
#s this directed graph acyclic"
#s there a spanning tree o! this undirected graph with total
weight less than w"
Does this bipartite graph have a per!ect $all nodes matched%
matching"Does the pattern p appear as a substring in te&t t"
-
7/24/2019 23 Fl 24 Np Complete
5/44
-
7/24/2019 23 Fl 24 Np Complete
6/44
P
P is the set o! decision problems that can be solved in worstcase
polynomial time:
#! the input is o! si(e n, the running time must be )$nk%.
*ote that k can depend on the problem class, but not the
particular instance.
+ll the decision problems mentioned above are in P.
-
7/24/2019 23 Fl 24 Np Complete
7/44
*ice Pu((le
The class *P $meaning nondeterministic polynomial time% is the
set o! problems that might appear in a pu((le maga(ine: ``*icepu((le.''
hat makes these problems special is that they might be hard to
solve, but a short answer can always be printed in the back, and it
is easy to see that the answer iscorrect once you see it.
-&le... Does matri& + have an / decomposition"
*o guarantee i! answer is ``no''.
-
7/24/2019 23 Fl 24 Np Complete
8/44
-
7/24/2019 23 Fl 24 Np Complete
9/44
*P
Technically speaking:
+ problem is in *P i! it has a short accepting certi!icate.
+n accepting certi!icate is something that we can use to
quickly show that the answer is ``yes'' $i! it is yes%.
0uickly means in polynomial time.1hort means polynomial si(e.
This means that all problems in P are in *P $since we don't even
need a certi!icate to quickly show the answer is ``yes''%.
2ut other problems in *P may not be in P. 3iven an integer &, is
it composite" ow do we know this is in *P"
-
7/24/2019 23 Fl 24 Np Complete
10/44
3ood 3uessing
+nother way o! thinking o! *P is it is the set o! problems that can
solved e!!iciently by a really good guesser.
The guesser essentially picks the accepting certi!icate out o! the air
$*ondeterministic Polynomial time%. #t can then convince itsel! that
it is correct using a polynomial
time algorithm. $ike a rightbrain, le!tbrain sort o! thing.%
4learly this isn't a practically use!ul characteri(ation: how could
we build such a machine"
-
7/24/2019 23 Fl 24 Np Complete
11/44
-&ponential /pperbound
+nother use!ul property o! the class *P is that all *P problems can
be solved in e&ponential time $-5P%.
This is because we can always list out all short certi!icates in
e&ponential time and check all )$6nk% o! them.
Thus, P is in *P, and *P is in -5P. +lthough we know that P is
not equal to -5P, it is possible that *P 7 P, or -5P, or neither.
8rustrating9
-
7/24/2019 23 Fl 24 Np Complete
12/44
*Phardness
+s we will see, some problems are at least as hard to solve as any
problem in *P. e call such problems *Phard.
ow might we argue that problem 5 is at least as hard $to within
a polynomial !actor% as problem "
#! 5 is at least as hard as , how would we e&pect an algorithm
that is able to solve 5 to behave"
-
7/24/2019 23 Fl 24 Np Complete
13/44
-
7/24/2019 23 Fl 24 Np Complete
14/44
-
7/24/2019 23 Fl 24 Np Complete
15/44
-
7/24/2019 23 Fl 24 Np Complete
16/44
-
7/24/2019 23 Fl 24 Np Complete
17/44
-
7/24/2019 23 Fl 24 Np Complete
18/44
+;D +*D -+1 P;)2-
-
7/24/2019 23 Fl 24 Np Complete
19/44
+;D +*D -+1 P;)2->?
3arey and @ohnson: Computers and Intractability, 8reeman =>A>
1chriBver: Theory of Linear and Integer Programming, iley, =>C, $4hapter 6%
P: 4ollection E o! problems is in P $polynomialtime solvable% i!
there e&ists a polynomialtime algorithm that solves any problem in E, i.e, the
algorithm that requires at most
f(s)
basic steps where s7si(e o! the input and f is a polynomial.
NP:4ollection E o! decision problems is in *P $nondeterministic polynomial
time solvable% i! there e&ists a polynomial time algorithm to check thecorrectness o! the -1 answer.
co-NP:replace -1 by *) in the above de!inition.
-
7/24/2019 23 Fl 24 Np Complete
20/44
co*P
-
7/24/2019 23 Fl 24 Np Complete
21/44
)ne o! the central $and widely and intensively studied FG years% problems o!
$theoretical% computer science is to prove that
$a%P
NP $b% NP co-NP.
+ll evidence indicates that these conBectures are true.Disproving any o! these two conBectures would not only be considered truly
spectacular, but would also come as a tremendous surprise $with a variety o! !a
reaching counterintuitive consequences%.
NP-complete: 4ollection E o! problems is *Pcomplete i! $a% it is *P and $b% polynomialtime algorithm e&isted !or solving problems in E, then P7*P.
P
*Pco *P
-
7/24/2019 23 Fl 24 Np Complete
22/44
-
7/24/2019 23 Fl 24 Np Complete
23/44
-
7/24/2019 23 Fl 24 Np Complete
24/44
-
7/24/2019 23 Fl 24 Np Complete
25/44
-
7/24/2019 23 Fl 24 Np Complete
26/44
-
7/24/2019 23 Fl 24 Np Complete
27/44
Theorem.$HarpPapadimitriou, ICG%
#! collection E o! membership problems is *Pcomplete, then either
$=% *P7co*P
or
$6% 4Ds !or E cannot be described $in terms o! giving a !inite number o!
classesJrules !or de!ining hal!spaces !rom 4D%.
Precise de!initions o! what !orm o! description is ruled out $unless *P7co*P% by the theorem
can be !ound in
Harp and Papadimitriou: K)n linear characteri(ation o! combinatorialoptimi(ation problemsL, SIAM ournal on Computing11$=>C6%, 6GF6.
+lso, 4hapter =C o! 1chriBverMs Theory of Linear and Integer Programming$iley, =>C% has
discussion o! the result.
$The result is o!ten stated in terms o! the class o! all possible KrationalL polyhedra. owever,!ocusing on any *Pcomplete class is equivalent to studying the general class.%
-
7/24/2019 23 Fl 24 Np Complete
28/44
-
7/24/2019 23 Fl 24 Np Complete
29/44
-5+
-
7/24/2019 23 Fl 24 Np Complete
30/44
-5+
-
7/24/2019 23 Fl 24 Np Complete
31/44
p MC( ) %
#*P/T: w Rd
Find max{ f(s)= w s | s PMC(n) }.
ma& attained at some e&treme point o!PMC(n), i.e., at some &i
$that represents ;
=
==
OSQO
%,$
%,$
%,$
%,$ %OSQ$O%$
a$bbaC$a
$a
$a
C$a
$a
i$aii
.i
/
a$bbaT/x/.f
#%n$mic Pro!r$mmin!:
-
7/24/2019 23 Fl 24 Np Complete
32/44
8or every a 4 do 0alue('a-)1 & /(a'a-)
8or i76Rn, do
8or every 2 such that Q2Q7i, do
8ind
Value(C )is the sol)tion to the line$r optimi($tion pro*lem.
#nside loop requires at most Hi6i steps !or some const. H.
There are 6nrepetitions o! the inside loop.
Thus the algorithm needs at most HM$n6n%6 steps.
#n terms o! the input si(e d7n6n= :
The algorithm requires at most d6
steps !or some const. . $Theare very crude estimates, but we don
have to be precise !or our purpose here
"ine$r Optimi($tion onP (n)c$n *e done in pol%nomi$l time
+= ','
%',$P%OS$ma&:%$$b$$
$b
$b
/b$0alue$0alue
The prob2distr2 o3er the set of all n4 ran5ings explains the data
-
7/24/2019 23 Fl 24 Np Complete
33/44
p f g p
3iven the set o! queries D:
#! the number o! queries d !$n% !or some polynomial !,
!inding 4D !or the corresponding polytope is likely to be hopeless.
#! the number o! queries d U Han, there is hope.
E+ercise:1how that the linear optimi(ation problem corresponding to the
membership problem !or the +pproval Noting Polytope is easy $i.e., can be
solved in polynomial time%.
int: hat is the input si(e"
int: Devise a dynamic programming algorithm !or !inding a
ma&. weight ma&imal chain.
*ote that the rankings played no conceptual role.
-
7/24/2019 23 Fl 24 Np Complete
34/44
,ener$l &odel
4laim:
6!i3en any data set there is a probability distribution o3er thefiniteset of
alternati3es (states of nature) that explains the data27
The initeset o! queriesJquestions:
Then, !or any0, the probability that 0 holds is
,et pol%top$l represent$tion o the model.
Ho to choose #
s*
s*
ppp
SSS
,,,
,,,
=
=s
i
ii p8p ,
===other/ise8
Sintrue9ifp9P9T
m
mm %Q$:%$
%$%$9
9Tp9Pn
i
ii=
=
,,,O d* 999: =
-
7/24/2019 23 Fl 24 Np Complete
35/44
Possi*le /t$tes o N$t)re
1=,R,1s
0)eries$d o! them%
Pol%tope$in VG,=Wd%
&odel
Ch$r$cteri($tion
"ine$r"ine$r
Optimi($tionOptimi($tion
NP C l P bl
-
7/24/2019 23 Fl 24 Np Complete
36/44
NP-Complete Problems
-
7/24/2019 23 Fl 24 Np Complete
37/44
-
7/24/2019 23 Fl 24 Np Complete
38/44
-
7/24/2019 23 Fl 24 Np Complete
39/44
-
7/24/2019 23 Fl 24 Np Complete
40/44
-
7/24/2019 23 Fl 24 Np Complete
41/44
-
7/24/2019 23 Fl 24 Np Complete
42/44
-
7/24/2019 23 Fl 24 Np Complete
43/44
-
7/24/2019 23 Fl 24 Np Complete
44/44