Complexity PowerPoint PPT Presentation

presentation player overlay
About This Presentation
Transcript and Presenter's Notes

Title: Complexity


1
Complexity
11-1
NP-Completeness
Complexity Andrei Bulatov
2
Complexity
11-2
NP-Completeness Proofs
To prove that a language L is NP-complete we
now just have to perform two steps
  • Show that L belongs to NP
  • Find a known NP-complete problem (language) L?
    and show L? ? L

100s of problems have now been shown to be
NP-complete (for an earlier survey see Garey and
Johnson)
Note If we can complete Step 2 but not Step
1, then we say that L is NP-hard
3
Complexity
11-3
NP-Completeness of Clique
Theorem Clique is NP-complete
Step 1 The problem Clique is in NP
the list of vertices
in the clique is the certificate
4
Complexity
11-4
Step 2 To show that Clique is
NP-complete we shall reduce Satisfiability
to Clique
This construction can be carried out in
polynomial time
The resulting graph has a clique of size k if
and only if ? is satisfiable (assign the value
true to every variable occurring in the clique)
5
Complexity
11-5
Example Construction
k ? 3
6
Complexity
11-6
NP-Completeness of Vertex Cover
Step 1 The problem Vertex Cover is in
NP the list of
vertices in M is the certificate
7
Complexity
11-7
Step 2 To show that Vertex Cover is
NP-complete we shall reduce
Satisfiability to Vertex Cover
This construction can be carried out in
polynomial time
8
Complexity
11-8
Example Construction
X
9
Complexity
11-9
10
Complexity
11-10
Alternative Reductions
We have shown that Clique and Vertex Cover
are both NP-complete
This means it must be possible to reduce Clique
to Vertex Cover and vice versa!
11
Complexity
11-11
NP-Completeness of 3-SAT
To show that 3-Satisfiability is NP-complete we
reduce Satisfiability to 3-Satisfiability
  • C is satisfiable if and only if C? is,
    since at least one of the literals
  • other than Ys must be true

12
Complexity
11-12
NP-Completeness of SubsetSum
Step 1 The problem SubsetSum is in
NP the set T is
the certificate
13
Complexity
11-13
Step 2 To show that SubsetSum is
NP-complete we shall reduce
Satisfiability to SubsetSum
  • Choose t so that T must contain exactly
    one of each pair
  • and at least one from each clause

This construction can be carried out in
polynomial time
14
Complexity
11-14
Example Construction
15
Complexity
11-15
NP-Completeness of HamCircuit
Theorem HamCircuit is
NP-complete
Step 1 The problem HamCircuit is in
NP the Hamilton
circuit is the certificate
16
Complexity
11-16
Step 2 To show that HamCircuit is
NP-complete we shall reduce
3-Satisfiability to HamCircuit
What is to be encoded?
  • Boolean variables
  • a choice between two values (for each
    variable)
  • consistency all occurrences of X must
    have the same truth value
  • constraints on the possible values imposed by
    clauses

17
Complexity
11-17
  • the choice gadget
  • We assume that all gadgets are connected
  • with the rest of the graph only through
    their
  • endpoints, shown as full dots there are no
  • edges connecting other vertices of the
    gadget
  • to the rest of the graph
  • This gadget will allow the Hamiltonian
    circuit,
  • approaching from above, to pick either left
  • or right edge, thus communicating to a
    truth
  • value

18
Complexity
11-18
  • the consistency gadget
  • This graph can be traversed by the
    Hamiltonian circuit in one of the
  • two ways

19
Complexity
11-19
  • the constraint gadget
  • If, using the choice and consistency devices,
    we have made sure that each
  • side of the triangle is traversed by the
    Hamilton circuit if and only if the
  • corresponding literal is false then at
    least one literal has to be true

20
Complexity
11-20
Properties of the Gadgets
  • the choice gadget can be traversed in exactly
    two ways
  • the internal vertices of the consistency
    gadget (exclusive or gadget)
  • can be traversed in exactly two ways, so
    that exactly one pair of the
  • external vertices is involved
  • any Hamilton circuit traverses at most two of
    the edges of a
  • constraint gadget

21
Complexity
11-21
X
Y
Z
2
1
22
Complexity
11-22
NP-Completeness of TSP(D)
Step 1 The problem TSP(D) is in NP
a route satisfying the
inequality is the certificate
23
Complexity
11-23
Step 2 To show that TSP(D) is
NP-complete we shall reduce HamCircuit
to TSP(D)
Given a graph G with vertex set V and edge
set E
  • For each vertex v create a city
  • Set if (u,v) ? E
    and otherwise
  • Set B V

Then
  • If G has a Hamilton circuit then there is
    a route of weight B
  • (the Hamilton circuit)
  • If there is a route of weight B, then in G
    this route goes through
  • edges and therefore is a Hamilton circuit
Write a Comment
User Comments (0)
About PowerShow.com