Professional Documents
Culture Documents
?
WANNA BE A MILLIONAIRE? THEN PAY ATTENTION TO
THIS PRESENTATION AND YOU MIGHT JUST LEARN
HOW!
PROGRES & NEED FOR RATING
S STANDARD
Time to solve problems:
How long does it take to execute a given algorithm? In CS the answer is not
given in minutes/sec. but relative to the number of elements the algorithm
has to manipulate.
POLYNOMIAL
𝑙𝑎𝑖 𝑡𝑛𝑒𝑛𝑜𝑝𝑥𝑠
𝐸 𝑣
Runtime = 𝒙𝟐+ c vs Runtime = 𝟐𝒙
+ c Polynomial Exponential
2500
2000 2048
1500
Runtim
1000 1024
e
500 512
256
142 64 81 100 121
0 2 4 9 16 32 6346
1 2 8 4 8 9 10 11
25 6 98
1 3
5 Value of x
7
P class is a set of problems whose solutions running times
depend polynomially on the size of the input. Thus, it is
relatively easy to find these solutions using programs that are
reasonably fast.
NP-
P complete
-We can use the Hamilton Circuit or any other NP-complete problem
(SAT) to reduce it to our TSP. Given an instance of a graph G, we create
G′: We first make G′ complete. We let d(ij) = 0 if edge (i, j) is in G.
Otherwise, we let d(ij) = 1.
THE FUNDAMENTAL DILEMMA
If the correct solution to a problem can be verified in
polynomial time, can it also be found in polynomial time?
So P = NP means that for every problem that has an efficiently
verifiable solution, we can find that solution efficiently as well. A
solution to one exercise would give the key to all NP problems.