7.7
Intractability
Introduction to Computer Science
·
Robert Sedgewick and Kevin Wayne
·
Copyright © 2008
·
*
*
3
Q.
Which
algorithms
are useful in practice?
A.
[von Neumann 1953, Gödel 1956, Cobham 1964, Edmonds 1965, Rabin 1966]
!
Model of computation = deterministic Turing machine.
!
Measure running time as a function of input size
n
.
!
Useful in practice ("efficient") =
polynomial time
for all inputs.
Theory.
Definition is broad and robust.
Practice.
Polytime algorithms scale to huge problems.
A Reasonable Question about Algorithms
Ex 1.
Sorting
n
elements takes
n
2
steps using insertion sort.
Ex 2
.
Finding best TSP tour on
n
elements takes
n
!
steps using exhaustive search.
constants
a
and
b
tend to be small
a
n
b
4
Exponential Growth
Exponential growth dwarfs technological change.
!
Suppose you have a giant parallel computing device…
!
With as many processors as electrons in the universe…
!
And each processor has power of today's supercomputers…
!
And each processor works for the life of the universe…
!
Will not help solve 1,000 city TSP problem
via brute force.
quantity
electrons in universe
†
supercomputer instructions per second
value
10
79
10
13
age of universe in seconds
†
10
17
†
estimated
1000!
>>
10
1000
>>
10
79
!
10
13
!
10
17
6
Q.
Which
problems
can we solve in practice?
A.
Those with guaranteed polytime algorithms.
Q.
Which
problems
have polytime algorithms?
A.
Not so easy to know.
Focus of today's lecture.
Reasonable Questions about Problems
no known polytime algorithm for TSP
many known polytime algorithms for sorting
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document7
LSOLVE.
Given a system of
linear
equations, find a solution.
LP.
Given a system of linear
inequalities
, find a solution.
ILP.
Given a system of linear inequalities, find a
binary
solution.
48
x
0
+
16
x
1
+
119
x
2
"
88
5
x
0
+
4
x
1
+
35
x
2
#
13
15
x
0
+
4
x
1
+
20
x
2
#
23
x
0
,
x
1
,
x
2
#
0
x
0
=
1
x
1
=
1
x
2
=
1
5
Three Fundamental Problems
0
x
0
+
1
x
1
+
1
x
2
=
4
2
x
0
+
4
x
1
"
2
x
2
=
2
0
x
0
+
3
x
1
+
15
x
2
=
36
x
0
=
"
1
x
1
=
2
x
2
=
2
x
1
+
x
2
"
1
x
0
+
x
2
"
1
x
0
+
x
1
+
x
2
#
2
x
0
=
0
x
1
=
1
x
2
=
1
each
x
i
is either 0 or 1
8
LSOLVE.
Given a system of linear equations, find a solution.
LP.
Given a system of linear inequalities, find a solution.
ILP.
Given a system of linear inequalities, find a binary solution.
Q.
Which of these problems have polytime solutions?
A.
No easy answers.
LSOLVE.
Yes.
Gaussian elimination solves
n
by
n
system in
n
3
time.
LP.
Yes.
Celebrated ellipsoid algorithm is polytime.
ILP.
No polytime algorithm known or believed to exist!
Three Fundamental Problems
?
"
"
9
Search Problems
Search problem.
Given an instance
I
of a problem,
find
a solution
S
.
Requirement.
Must be able to efficiently
check
that
S
is a solution.
polytime in size of instance
I
or report none exists
10
Search Problems
Search problem.
Given an instance
I
of a problem,
find
a solution
S
.
Requirement.
Must be able to efficiently
check
that
S
is a solution.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '08
 DOUGLASW.CLARK
 Computational complexity theory, Travelling salesman problem, NPcomplete, polytime, polytime algorithm

Click to edit the document details