




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















http://eagereyes.org/topics/ZIPScribbleMaps
-^ Definition:^ The
complexity^ class
of^ problems that^ are^ intrinsically
harder^ than^ those
that can^ be^ solved
by^ a^ nondeterministic
Turing machine^ in^ polynomial
time.
-^ When^ a^ decision
version^ of^ a^ combinatorial optimization^ problem
is^ proved^ to^ be
complete ,^ then
the^ optimization
version^ is NP‐hard.
http://www.nist.gov/dads/HTML/nphard.html
-^ Find^ a^ “good” solution
fast
-^ sufficient^ for^ many
applications
-^ we^ often^ have
inaccurate^ data
to^ start^ with,^ so approximation^ may
be^ as^ good^ as^ optimal
solution
-^ A^ heuristic^ is
a^ common^ sense
rule^ drawn from^ experience^ –^ not^ a^ mathematically
proven^ assertion
-^ a^ “rule‐of‐thumb” • Examples: –^ TSP:^ go^ to^ next
nearest^ city
-^ Knapsack:^ start
with^ highest^ value/weight
ratio
-^ Packing^ (a^ suitcase):
start^ with^ largest
items
-^ if^ the^ exists^
c^ ≥^ 1,^ such^ that
r(s)^ ≤^ c^ for^ alla^ instances^ of^ a
problem,^ the
given^ algorithm
is
called^ a^ c‐approximation
algorithm
-^ The^ smallest
value^ of^ c^ that
holds^ for^ all instances^ is^ called
the^ performance
ratio ,^ R^ ,A^ of^ the^ algorithm,
-^ c‐approximation
algorithms^ are
good^ if^ you can^ find^ one^ –^ if^ c=1.1,^ your
approximation^
is^ never^ more^ than 10%^ worse^ than
optimal
-^ but^ … in^ some
cases,^ no^ bound
for^ c^ can^ be found^ –^ approx.^ alg.^ may
be^ great^ for^ 99%
of^ instances, but^ there^ are^ a^ few
really^ terrible^ cases
city.
all^ nodes^ are^
visited: Go^ to^ next^ nearest
city.
city.
(^1) ab 6233 d c^1 nearest neighbor will produce:aÆbÆcÆdÆa, length 10optimal tour:aÆbÆdÆcÆa, length 8r(s^ ) = 10/8 = 1.25a no bound for r(s^ a
) can be determined for all instances: suppose length(a
Æd) = 1000, or 1000000, or ….
(^1) ab?^233 d c^1 The problem with this instance is thatthere may be a very large distanceassociated with last edge a
Æd. Is this a “real-world” instance? If this graph represents straight-line distancesbetween cities on a map, the length of a
Æd must be bounded, relative to the other distances (geometry)If this graph represents costs of airline flights, the costof aÆd could be out of proportion to the other edges
-^ Euclidean^ instances
of^ the^ TSP^ problem obey^ the^ natural
geometry^ of^ a
2D^ map.
-^ triangle^ inequality:
d[i,j]^ ≤^ d[i,k]^ +^ d[k,j]
-^ symmetry:^ d[i,j]
=^ d[j]
-^ For^ Euclidean
instances,^ the
nearest^ neighbor algorithm^ satisfies:r(s)^ ≤^ ½ (loga^
n^ +^ 1),^ where 2
n^ =^ #^ cities
-^ (still^ not^ a^ c‐approximation
algorithm)
(^1) ab edge list: 6233 d c^1 edge list:^ (a,b),^ (c,d), (b,c), (a,c), (b,c), (a,d)tour:^ (c,d) , (b,c), (a,c), (b,c), (a,d)tour: (a,b)edge list:^ (b,c) , (a,c), (b,c), (a,d)tour: (a,b), (c,d)tour: (a,b), (c,d), (b,c), (a,d) length 10
from^ the^ graph
the^ tree^ (DFS)
and record^ nodes^
as^ you^ pass^ them
from^ the^ generated node^ list This^ is^ a^2 ‐approximation
algorithm^ for Euclidean^ TSP.
Example:^ 2-opt algorithm^ delete 2 non-adjacent edgesreplace them with a different pair