You are on page 1of 177

More Reductions for NP Problems

Nabil Mustafa

Computational Complexity

1 / 177

Reductions From Last Time
So far, we have shown the following problems NP complete: SAT , 3-CNF SAT, INDSET , CLIQUE , VERTEX-COVER , HITTING-SET , INTEGER-PROGRAMMING

SAT
3-SAT

VC

IS

IP

HS

CL
2 / 177

HAMILTONIAN
Claim
HAMILTONIAN : Given a directed graph G = (V , E ), does G have a Hamiltonian path? The Hamiltonian path problem (HAMILTONIAN ) is NP complete.

3 / 177

HAMILTONIAN Claim HAMILTONIAN : Given a directed graph G = (V . does G have a Hamiltonian path? The Hamiltonian path problem (HAMILTONIAN ) is NP complete. Review: Hamiltonian path visits each vertex in G exactly once 4 / 177 . E ).

HAMILTONIAN Claim HAMILTONIAN : Given a directed graph G = (V . Review: Hamiltonian path visits each vertex in G exactly once Computationally very different from Eulerian paths 5 / 177 . does G have a Hamiltonian path? The Hamiltonian path problem (HAMILTONIAN ) is NP complete. E ).

HAMILTONIAN Claim HAMILTONIAN : Given a directed graph G = (V . does G have a Hamiltonian path? The Hamiltonian path problem (HAMILTONIAN ) is NP complete. Review: Hamiltonian path visits each vertex in G exactly once Computationally very different from Eulerian paths Note that HAMILTONIAN is in NP 6 / 177 . E ).

HAMILTONIAN Claim HAMILTONIAN : Given a directed graph G = (V . Review: Hamiltonian path visits each vertex in G exactly once Computationally very different from Eulerian paths Note that HAMILTONIAN is in NP We reduce 3-CNF SAT to HAMILTONIAN For a fixed 3-CNF SAT formula. show that it can be transformed into a graph whose Hamiltonian path will give us the assignments for SAT. 7 / 177 . E ). does G have a Hamiltonian path? The Hamiltonian path problem (HAMILTONIAN ) is NP complete.

Ci = (x1 ∨ x2 ∨ x3 ) 8 / 177 . n variables. ∧ Cm .Reduction Sketch i i i φ = C1 ∧ C2 ∧ . . .

9 / 177 . n variables. . .Reduction Sketch i i i φ = C1 ∧ C2 ∧ . have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable. ∧ Cm . Ci = (x1 ∨ x2 ∨ x3 ) Given φ.

Ci = (x1 ∨ x2 ∨ x3 ) Given φ. . have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable. 10 / 177 . . ∧ Cm .Reduction Sketch i i i φ = C1 ∧ C2 ∧ . n variables. and then the clauses. We first define the mapping of variables.

.Reduction Sketch i i i φ = C1 ∧ C2 ∧ . have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable. We first define the mapping of variables. . Ci = (x1 ∨ x2 ∨ x3 ) Given φ. ∧ Cm . and then the clauses. n variables. Each xi will correspond to a path (chain) of 6m vertices 11 / 177 .

and then the clauses. ∧ Cm . We first define the mapping of variables.Reduction Sketch i i i φ = C1 ∧ C2 ∧ . Each xi will correspond to a path (chain) of 6m vertices xi 12 / 177 . n variables. . . Ci = (x1 ∨ x2 ∨ x3 ) Given φ. have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable.

. . and then the clauses. Ci = (x1 ∨ x2 ∨ x3 ) Given φ. ∧ Cm . n variables. have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable.Reduction Sketch i i i φ = C1 ∧ C2 ∧ . Each xi will correspond to a path (chain) of 6m vertices If we are at the first (or end) vertex. only one path to follow xi 13 / 177 . We first define the mapping of variables.

Add a start vertex vstart which has 14 / 177 .

Add a start vertex vstart which has no incoming edges. 15 / 177 .

an outgoing edge to the first vertex of x1 chain. 16 / 177 .Add a start vertex vstart which has no incoming edges.

an outgoing edge to the last vertex of x1 chain.Add a start vertex vstart which has no incoming edges. 17 / 177 . an outgoing edge to the first vertex of x1 chain.

an outgoing edge to the last vertex of x1 chain. an outgoing edge to the first vertex of x1 chain.Add a start vertex vstart which has no incoming edges. vstart x1 x2 xn−1 xn 18 / 177 .

Add an end vertex vend which has 19 / 177 .

20 / 177 .Add an end vertex vend which has no outgoing edges.

an incoming edge from the first vertex of xn chain. 21 / 177 .Add an end vertex vend which has no outgoing edges.

an incoming edge from the first vertex of xn chain.Add an end vertex vend which has no outgoing edges. an incoming edge from the last vertex of xn chain. 22 / 177 .

Add an end vertex vend which has no outgoing edges. an incoming edge from the first vertex of xn chain. vstart x1 x2 xn−1 xn vend 23 / 177 . an incoming edge from the last vertex of xn chain.

From the first and last vertex of each chain xi . add 24 / 177 .

From the first and last vertex of each chain xi , add
an outgoing edge to the first vertex of chain xi +1

25 / 177

From the first and last vertex of each chain xi , add
an outgoing edge to the first vertex of chain xi +1 an outgoing edge to the last vertex of chain xi +1

26 / 177

From the first and last vertex of each chain xi , add
an outgoing edge to the first vertex of chain xi +1 an outgoing edge to the last vertex of chain xi +1
vstart x1 x2 xn−1 xn vend

27 / 177

From the first and last vertex of each chain xi . add an outgoing edge to the first vertex of chain xi +1 an outgoing edge to the last vertex of chain xi +1 vstart x1 x2 xn−1 xn vend 28 / 177 .

add an outgoing edge to the first vertex of chain xi +1 an outgoing edge to the last vertex of chain xi +1 vstart x1 x2 xn−1 xn vend 29 / 177 .From the first and last vertex of each chain xi .

From the first and last vertex of each chain xi . add an outgoing edge to the first vertex of chain xi +1 an outgoing edge to the last vertex of chain xi +1 vstart x1 x2 xn−1 xn vend 30 / 177 .

Construction Properties vstart x1 x2 xn−1 xn vend 31 / 177 .

Construction Properties Any Hamiltonian path has to start at vstart vstart x1 x2 xn−1 xn vend 32 / 177 .

Construction Properties Any Hamiltonian path has to end at vend vstart x1 x2 xn−1 xn vend 33 / 177 .

Construction Properties Any Hamiltonian path first traverses chain x1 . vstart x1 x2 xn−1 xn vend 34 / 177 . then x2 etc.

right-to-left means xi = 0 vstart x1 x2 xn−1 xn vend 35 / 177 .Construction Properties For each chain. only two ways of traversing it. Left-to-right means xi = 1.

vstart x1 x2 xn−1 xn vend 36 / 177 .Construction Properties Each assignment of variables corresponds to a unique Hamiltonian path.

vstart x1 x2 xn−1 xn vend 37 / 177 .Construction Properties Each Hamiltonian path corresponds to a unique variable assignment.

no constraints – they will come from the clauses now. vstart x1 x2 xn−1 xn vend 38 / 177 .Construction Properties So far.

39 / 177 .Clause Constraints Each clause Cj corresponds to a new vertex uj .

Clause Constraints
Each clause Cj corresponds to a new vertex uj . If Cj contains a non-negated literal xi , add edges to uj :

40 / 177

Clause Constraints
Each clause Cj corresponds to a new vertex uj . If Cj contains a non-negated literal xi , add edges to uj :
Add an incoming edge from a vertex, say vk , in the xi chain

41 / 177

Clause Constraints
Each clause Cj corresponds to a new vertex uj . If Cj contains a non-negated literal xi , add edges to uj :
Add an incoming edge from a vertex, say vk , in the xi chain Add an outgoing edge to vk +1 in the xi chain

42 / 177

in the xi chain Add an outgoing edge to vk +1 in the xi chain uj xi 43 / 177 . say vk .Clause Constraints Each clause Cj corresponds to a new vertex uj . add edges to uj : Add an incoming edge from a vertex. If Cj contains a non-negated literal xi .

reverse the edge directions 44 / 177 .Clause Constraints If Cj contains a negated literal.

Clause Constraints If Cj contains a negated literal. reverse the edge directions If Cj contains a negated literal x i . say vk . in the xi chain 45 / 177 . add edges to uj : Add an incoming edge from a vertex.

reverse the edge directions If Cj contains a negated literal x i . add edges to uj : Add an incoming edge from a vertex.Clause Constraints If Cj contains a negated literal. in the xi chain Add an outgoing edge to vk −1 in the xi chain 46 / 177 . say vk .

Clause Constraints If Cj contains a negated literal. in the xi chain Add an outgoing edge to vk −1 in the xi chain uj xi 47 / 177 . say vk . reverse the edge directions If Cj contains a negated literal x i . add edges to uj : Add an incoming edge from a vertex.

An Example Construction of Hamiltonian path for (a ∨ b) ∧ (a ∨ b) Here: C1 = (a ∨ b) C2 = (a ∨ b) 48 / 177 .

The Graph Construction vstart a∨b a a∨b b vend 49 / 177 .

The Graph Construction vstart a∨b a a∨b b vend Claim Hamiltonian path exists ONLY if you go from left to right in a and chose any one of the two directions for b. 50 / 177 .

b = 1 vstart a∨b a a∨b b vend 51 / 177 .Path Corresponding to Assignment 1 a = 1.

b = 0 vstart a∨b a a∨b b vend 52 / 177 .Path Corresponding to Assignment 2 a = 1.

Path Corresponding to Assignment 3
a = 0; b = 1
vstart
a∨b

a

a∨b

b

vend

Error in finding HAMILTONIAN
No HAMILTONIAN PATH as (a ∨ b) is not accessible
53 / 177

Path Corresponding to Assignment 4
a = 0; b = 0
vstart
a∨b

a

a∨b

b

vend

Error in finding HAMILTONIAN
No HAMILTONIAN PATH as (a ∨ b) is not accessible
54 / 177

Construction Claim
Claim
The constructed graph G has a Hamiltonian path iff φ satisfiable.

55 / 177

Construction Claim Claim The constructed graph G has a Hamiltonian path iff φ satisfiable. Things to note about the final construction: 56 / 177 .

Construction Claim Claim The constructed graph G has a Hamiltonian path iff φ satisfiable. Things to note about the final construction: Any Hamiltonian path has to start at vstart 57 / 177 .

Construction Claim Claim The constructed graph G has a Hamiltonian path iff φ satisfiable. Things to note about the final construction: Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend 58 / 177 .

59 / 177 . then x2 etc. Things to note about the final construction: Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend Any Hamiltonian path first traverses chain x1 .Construction Claim Claim The constructed graph G has a Hamiltonian path iff φ satisfiable.

For each chain. only two ways of traversing it. 60 / 177 . then x2 etc. Things to note about the final construction: Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend Any Hamiltonian path first traverses chain x1 .Construction Claim Claim The constructed graph G has a Hamiltonian path iff φ satisfiable.

61 / 177 . For each chain. only two ways of traversing it.Construction Claim Claim The constructed graph G has a Hamiltonian path iff φ satisfiable. then x2 etc. Things to note about the final construction: Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend Any Hamiltonian path first traverses chain x1 . Each assignment of variables corresponds to a path.

then x2 etc. Each path corresponds to a unique variable assignment. For each chain. only two ways of traversing it. Each assignment of variables corresponds to a path. 62 / 177 . Things to note about the final construction: Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend Any Hamiltonian path first traverses chain x1 .Construction Claim Claim The constructed graph G has a Hamiltonian path iff φ satisfiable.

Each path corresponds to a unique variable assignment. can visit uj along the way. If xi ∈ Cj and xi = 1. 63 / 177 . Each assignment of variables corresponds to a path. For each chain. Things to note about the final construction: Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend Any Hamiltonian path first traverses chain x1 .Construction Claim Claim The constructed graph G has a Hamiltonian path iff φ satisfiable. only two ways of traversing it. then x2 etc.

Each path corresponds to a unique variable assignment. Each assignment of variables corresponds to a path. can visit uj along the way. If xi ∈ Cj and xi = 1. can visit uj along the way. For each chain. then x2 etc. only two ways of traversing it. Things to note about the final construction: Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend Any Hamiltonian path first traverses chain x1 . 64 / 177 .Construction Claim Claim The constructed graph G has a Hamiltonian path iff φ satisfiable. If x i ∈ Cj and xi = 0.

Things to note about the final construction: Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend Any Hamiltonian path first traverses chain x1 . then x2 etc. The above two only ways to visit uj without getting stuck. Each assignment of variables corresponds to a path. Each path corresponds to a unique variable assignment.Construction Claim Claim The constructed graph G has a Hamiltonian path iff φ satisfiable. only two ways of traversing it. If xi ∈ Cj and xi = 1. If x i ∈ Cj and xi = 0. For each chain. 65 / 177 . can visit uj along the way. can visit uj along the way.

and parameter k. Sm } of subsets of a base set X .SET-COVER Claim SET-COVER : A collection C = {S1 . |X | = n. find a set cover C ⊆ C of size k The set cover problem (SET-COVER ) is NP complete. . 66 / 177 . . . .

. . Sm } of subsets of a base set X . . .SET-COVER Claim SET-COVER : A collection C = {S1 . C = {Si1 . find a set cover C ⊆ C of size k The set cover problem (SET-COVER ) is NP complete. . and parameter k. . |X | = n. 67 / 177 . Sik } is a set-cover iff j Sij = X . . .

and parameter k. . 68 / 177 . |X | = n. . find a set cover C ⊆ C of size k The set cover problem (SET-COVER ) is NP complete. . . . . Sm } of subsets of a base set X . C = {Si1 .SET-COVER Claim SET-COVER : A collection C = {S1 . . . Sik } is a set-cover iff Note that SET-COVER is in NP j Sij = X .

. Sm } of subsets of a base set X . . |X | = n.SET-COVER Claim SET-COVER : A collection C = {S1 . and parameter k. . find a set cover C ⊆ C of size k The set cover problem (SET-COVER ) is NP complete. Sik } is a set-cover iff Note that SET-COVER is in NP How to prove NP hardness? j Sij = X . . . C = {Si1 . . . 69 / 177 . .

. Sik } is a set-cover iff Note that SET-COVER is in NP How to prove NP hardness? Reduce from VERTEX-COVER j Sij = X . find a set cover C ⊆ C of size k The set cover problem (SET-COVER ) is NP complete. . . . . 70 / 177 .SET-COVER Claim SET-COVER : A collection C = {S1 . |X | = n. . and parameter k. . C = {Si1 . Sm } of subsets of a base set X . .

the idea is that: 71 / 177 . E ).Reduction from VERTEX-COVER Given a graph G = (V .

E ). the idea is that: Each vertex vi maps to a set Ci 72 / 177 .Reduction from VERTEX-COVER Given a graph G = (V .

Cik } is a set-cover. . . . . . E ). . 73 / 177 . vik } is a vertex-cover iff {Ci1 .Reduction from VERTEX-COVER Given a graph G = (V . . the idea is that: Each vertex vi maps to a set Ci {vi1 . .

. . . E ). .Reduction from VERTEX-COVER Given a graph G = (V . . the idea is that: The exact construction is as follows: Each vertex vi maps to a set Ci {vi1 . vik } is a vertex-cover iff {Ci1 . 74 / 177 . . . Cik } is a set-cover. .

. E ). 75 / 177 . . .Reduction from VERTEX-COVER Given a graph G = (V . . . . Cik } is a set-cover. vik } is a vertex-cover iff {Ci1 . Each vertex vi maps to a set Ci {vi1 . . . the idea is that: The exact construction is as follows: Each edge ej ∈ E maps to an element aj ∈ X .

the idea is that: The exact construction is as follows: Each edge ej ∈ E maps to an element aj ∈ X . vik } is a vertex-cover iff {Ci1 . . . .Reduction from VERTEX-COVER Given a graph G = (V .t . . . . ej incident to vi } Each vertex vi maps to a set Ci {vi1 . Cik } is a set-cover. E ). Each vertex vi ∈ V maps to set Ci = {aj s . . 76 / 177 . .

. Claim V = {vi1 . . . . Cik } is a set-cover. vik } is a vertex-cover iff {Ci1 . .t . E ). Each vertex vi ∈ V maps to set Ci = {aj s . . . 77 / 177 . Cik } is a set cover. . . . the idea is that: The exact construction is as follows: Each edge ej ∈ E maps to an element aj ∈ X . . . . .Reduction from VERTEX-COVER Given a graph G = (V . vik } is a vertex-cover iff {Cii . ej incident to vi } Each vertex vi maps to a set Ci {vi1 . . .

vik } is a vertex-cover iff {Ci1 . vik } is a vertex-cover iff {Cii . . the idea is that: The exact construction is as follows: Each edge ej ∈ E maps to an element aj ∈ X . . . . ej incident to vi } Each vertex vi maps to a set Ci {vi1 .t . Cik } is a set cover.Reduction from VERTEX-COVER Given a graph G = (V . Each vertex vi ∈ V maps to set Ci = {aj s . Claim V = {vi1 . . Proof. . . Cik } is a set-cover. then set Ci contains aj 78 / 177 . . . E ). . If ej incident to vi . . . . . . .

Each vertex vi ∈ V maps to set Ci = {aj s . . . Claim V = {vi1 . Proof. . . Cik } is a set-cover. the idea is that: The exact construction is as follows: Each edge ej ∈ E maps to an element aj ∈ X . . . E ). Cik } is a set cover. . vik } is a vertex-cover iff {Cii . If ej incident to vi . . . then set Ci contains aj Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj 79 / 177 .t . . . vik } is a vertex-cover iff {Ci1 . ej incident to vi } Each vertex vi maps to a set Ci {vi1 . . . .Reduction from VERTEX-COVER Given a graph G = (V . . .

t . . . . then set Ci contains aj Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj V covers all edges ⇐⇒ C cover all elements 80 / 177 . . E ). Claim V = {vi1 . . Cik } is a set-cover.Reduction from VERTEX-COVER Given a graph G = (V . If ej incident to vi . Each vertex vi ∈ V maps to set Ci = {aj s . . Proof. ej incident to vi } Each vertex vi maps to a set Ci {vi1 . vik } is a vertex-cover iff {Cii . Cik } is a set cover. . . . . . . . vik } is a vertex-cover iff {Ci1 . . . . the idea is that: The exact construction is as follows: Each edge ej ∈ E maps to an element aj ∈ X .

Another Hardness Proof for INTEGER-PROGRAMMING Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING 81 / 177 .

Another Hardness Proof for INTEGER-PROGRAMMING Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof. Formulate the set-cover problem as an integer program 82 / 177 .

. . . Formulate the set-cover problem as an integer program Given C = {S1 .Another Hardness Proof for INTEGER-PROGRAMMING Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof. an } and k : 83 / 177 . Sm } over X = {a1 . . . . . .

. . an } and k : Integer program variables: xj = 1 iff Sj picked in set-cover 84 / 177 . .Another Hardness Proof for INTEGER-PROGRAMMING Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof. . . Formulate the set-cover problem as an integer program Given C = {S1 . . . Sm } over X = {a1 . .

Another Hardness Proof for INTEGER-PROGRAMMING
Another reduction for INTEGER-PROGRAMMING
SET-COVER can be reduced to INTEGER-PROGRAMMING

Proof.
Formulate the set-cover problem as an integer program Given C = {S1 , . . . , Sm } over X = {a1 , . . . , an } and k : Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets:

85 / 177

Another Hardness Proof for INTEGER-PROGRAMMING
Another reduction for INTEGER-PROGRAMMING
SET-COVER can be reduced to INTEGER-PROGRAMMING

Proof.
Formulate the set-cover problem as an integer program Given C = {S1 , . . . , Sm } over X = {a1 , . . . , an } and k : Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets:
j

xj ≤ k

86 / 177

Another Hardness Proof for INTEGER-PROGRAMMING
Another reduction for INTEGER-PROGRAMMING
SET-COVER can be reduced to INTEGER-PROGRAMMING

Proof.
Formulate the set-cover problem as an integer program Given C = {S1 , . . . , Sm } over X = {a1 , . . . , an } and k : Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets:
j

xj ≤ k

All elements covered:

87 / 177

. an } and k : Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets: j xj ≤ k xj ≥ 1 ∀i j |ai ∈Sj All elements covered: 88 / 177 . . . Formulate the set-cover problem as an integer program Given C = {S1 . Sm } over X = {a1 . .Another Hardness Proof for INTEGER-PROGRAMMING Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof. . . . .

. . . Formulate the set-cover problem as an integer program Given C = {S1 . Sm } over X = {a1 . an } and k : Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets: j xj ≤ k xj ≥ 1 ∀i j |ai ∈Sj All elements covered: Variable 0 or 1: 89 / 177 . . . .Another Hardness Proof for INTEGER-PROGRAMMING Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof. . .

an } and k : Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets: j xj ≤ k xj ≥ 1 ∀i j |ai ∈Sj All elements covered: Variable 0 or 1: xi ∈ {0. . . . 1} 90 / 177 . . . .Another Hardness Proof for INTEGER-PROGRAMMING Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof. . Sm } over X = {a1 . Formulate the set-cover problem as an integer program Given C = {S1 . .

Yet Another Hardness Proof for INTEGER-PROGRAMMING Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING 91 / 177 .

Yet Another Hardness Proof for INTEGER-PROGRAMMING Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof. Formulate the hitting-set as an integer program 92 / 177 .

. . . an } and k : 93 / 177 . Formulate the hitting-set as an integer program Given C = {S1 . . . . .Yet Another Hardness Proof for INTEGER-PROGRAMMING Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof. . Sm } over X = {a1 .

. Sm } over X = {a1 . . an } and k : Integer program variables: xj = 1 iff xj picked in hitting-set 94 / 177 . Formulate the hitting-set as an integer program Given C = {S1 . . . . . . .Yet Another Hardness Proof for INTEGER-PROGRAMMING Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof.

. Sm } over X = {a1 . . . . an } and k : Integer program variables: xj = 1 iff xj picked in hitting-set At most k elements: 95 / 177 . . .Yet Another Hardness Proof for INTEGER-PROGRAMMING Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof. . Formulate the hitting-set as an integer program Given C = {S1 . .

Sm } over X = {a1 . .Yet Another Hardness Proof for INTEGER-PROGRAMMING Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof. . . Formulate the hitting-set as an integer program Given C = {S1 . . . . . . an } and k : Integer program variables: xj = 1 iff xj picked in hitting-set At most k elements: j xj ≤ k 96 / 177 .

Sm } over X = {a1 . . an } and k : Integer program variables: xj = 1 iff xj picked in hitting-set At most k elements: j xj ≤ k All sets covered: 97 / 177 . .Yet Another Hardness Proof for INTEGER-PROGRAMMING Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof. . . . Formulate the hitting-set as an integer program Given C = {S1 . . . .

. an } and k : Integer program variables: xj = 1 iff xj picked in hitting-set At most k elements: j xj ≤ k xj ≥ 1 ∀i j |aj ∈Si All sets covered: 98 / 177 . Sm } over X = {a1 . . . . . Formulate the hitting-set as an integer program Given C = {S1 . . . .Yet Another Hardness Proof for INTEGER-PROGRAMMING Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof.

.Yet Another Hardness Proof for INTEGER-PROGRAMMING Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof. . . . Sm } over X = {a1 . an } and k : Integer program variables: xj = 1 iff xj picked in hitting-set At most k elements: j xj ≤ k xj ≥ 1 ∀i j |aj ∈Si All sets covered: Variable 0 or 1: 99 / 177 . . . . . Formulate the hitting-set as an integer program Given C = {S1 .

an } and k : Integer program variables: xj = 1 iff xj picked in hitting-set At most k elements: j xj ≤ k xj ≥ 1 ∀i j |aj ∈Si All sets covered: Variable 0 or 1: xi ∈ {0. . . . Sm } over X = {a1 . .Yet Another Hardness Proof for INTEGER-PROGRAMMING Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof. . . 1} 100 / 177 . . Formulate the hitting-set as an integer program Given C = {S1 . .

. |X | = 3m. . 101 / 177 . . The exact cover by 3-sets problem (EXACT-COVER ) is NP complete. find a disjoint set cover C ⊆ C of size m.EXACT-COVER Claim EXACT-COVER : A collection C = {S1 . . |Sj | = 3 over a base set X . Sn }.

find a disjoint set cover C ⊆ C of size m. The exact cover by 3-sets problem (EXACT-COVER ) is NP complete. . . . |X | = 3m. Note that EXACT-COVER is in NP 102 / 177 .EXACT-COVER Claim EXACT-COVER : A collection C = {S1 . Sn }. . |Sj | = 3 over a base set X .

Note that EXACT-COVER is in NP How to prove NP hardness? 103 / 177 . . find a disjoint set cover C ⊆ C of size m. |X | = 3m.EXACT-COVER Claim EXACT-COVER : A collection C = {S1 . . . The exact cover by 3-sets problem (EXACT-COVER ) is NP complete. |Sj | = 3 over a base set X . . Sn }.

104 / 177 . Sn }. Read from the Papadimitriou book. . |X | = 3m. . The exact cover by 3-sets problem (EXACT-COVER ) is NP complete. . Note that EXACT-COVER is in NP How to prove NP hardness? Reduce from SAT . .EXACT-COVER Claim EXACT-COVER : A collection C = {S1 . |Sj | = 3 over a base set X . find a disjoint set cover C ⊆ C of size m.

.KNAPSACK Claim KNAPSACK : Given a set A = {a1 . both positive integers. an } of n elements. where each element ai has a weight wi and a value vi . . . . Find a subset A ⊆ A such that 105 / 177 .

106 / 177 . . both positive integers.KNAPSACK Claim KNAPSACK : Given a set A = {a1 . . where each element ai has a weight wi and a value vi . . . Find a subset A ⊆ A such that 1 aj ∈A wi ≤ W . an } of n elements.

107 / 177 . Find a subset A ⊆ A such that 1 2 aj ∈A aj ∈A wi ≤ W . both positive integers.KNAPSACK Claim KNAPSACK : Given a set A = {a1 . vi ≥ K . . . where each element ai has a weight wi and a value vi . an } of n elements. . .

108 / 177 . an } of n elements. Find a subset A ⊆ A such that 1 2 aj ∈A aj ∈A wi ≤ W . where each element ai has a weight wi and a value vi . . both positive integers. . .KNAPSACK Claim KNAPSACK : Given a set A = {a1 . . vi ≥ K . The Knapsack problem (KNAPSACK ) is NP complete.

vi ≥ K . both positive integers. . .KNAPSACK Claim KNAPSACK : Given a set A = {a1 . Find a subset A ⊆ A such that 1 2 aj ∈A aj ∈A wi ≤ W . The Knapsack problem (KNAPSACK ) is NP complete. where each element ai has a weight wi and a value vi . . . an } of n elements. Note that KNAPSACK is in NP 109 / 177 .

. . where each element ai has a weight wi and a value vi .KNAPSACK Claim KNAPSACK : Given a set A = {a1 . Find a subset A ⊆ A such that 1 2 aj ∈A aj ∈A wi ≤ W . both positive integers. vi ≥ K . The Knapsack problem (KNAPSACK ) is NP complete. . Note that KNAPSACK is in NP How to prove NP hardness? 110 / 177 . an } of n elements. .

. . Find a subset A ⊆ A such that 1 2 aj ∈A aj ∈A wi ≤ W . where each element ai has a weight wi and a value vi . The Knapsack problem (KNAPSACK ) is NP complete. an } of n elements. .KNAPSACK Claim KNAPSACK : Given a set A = {a1 . Note that KNAPSACK is in NP How to prove NP hardness? Special case: K = W and wi = vi for all i . . vi ≥ K . both positive integers. 111 / 177 .

. Find a subset A ⊆ A such that 1 2 aj ∈A aj ∈A wi ≤ W . an } of n elements. . Note that KNAPSACK is in NP How to prove NP hardness? Special case: K = W and wi = vi for all i . The Knapsack problem (KNAPSACK ) is NP complete. both positive integers.KNAPSACK Claim KNAPSACK : Given a set A = {a1 . . . vi ≥ K . Then problem? 112 / 177 . where each element ai has a weight wi and a value vi .

where each element ai has a weight wi and a value vi . . . an } of n elements. 113 / 177 . . The Knapsack problem (KNAPSACK ) is NP complete. vi ≥ K .KNAPSACK Claim KNAPSACK : Given a set A = {a1 . Note that KNAPSACK is in NP How to prove NP hardness? Special case: K = W and wi = vi for all i . Find a subset A ⊆ A such that 1 2 aj ∈A aj ∈A wi ≤ W . . both positive integers. Then problem? Subset sum! Find a subset with value and weight equal to W .

114 / 177 .SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete.

SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete. Reduce EXACT-COVER to SUBSET-SUM 115 / 177 .

. . . . .SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete. . Reduce EXACT-COVER to SUBSET-SUM {S1 . Sn }. a3m } 116 / 177 . . |Sj | = 3 over a base set X = {a1 . .

. . . Sn }. . a3m } Map each set Sj to an integer tj 117 / 177 . . Reduce EXACT-COVER to SUBSET-SUM {S1 . . . .SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete. |Sj | = 3 over a base set X = {a1 .

a3m } Map each set Sj to an integer tj If Sj ’s are disjoint and cover X . . .SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete. . Sn }. then tj ’s add up to some T 118 / 177 . Reduce EXACT-COVER to SUBSET-SUM {S1 . . . . . |Sj | = 3 over a base set X = {a1 . .

a3m } Map each set Sj to an integer tj If Sj ’s are disjoint and cover X . then tj ’s add up to some T For mapping sets into integers. . Reduce EXACT-COVER to SUBSET-SUM {S1 . . Sn }. . . . use the characteristic vector 119 / 177 .SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete. |Sj | = 3 over a base set X = {a1 . . . .

Sn }. a3m } Map each set Sj to an integer tj If Sj ’s are disjoint and cover X . .SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete. |Sj | = 3 over a base set X = {a1 . then tj ’s add up to some T For mapping sets into integers. . . . . . . . use the characteristic vector Represent set S as a vector v (S ) where vi (S ) = 1 iff ai ∈ S 120 / 177 . Reduce EXACT-COVER to SUBSET-SUM {S1 .

a4 . .SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete. . then tj ’s add up to some T For mapping sets into integers. Sn }. . |Sj | = 3 over a base set X = {a1 . a3m } Map each set Sj to an integer tj If Sj ’s are disjoint and cover X . . . use the characteristic vector Represent set S as a vector v (S ) where vi (S ) = 1 iff ai ∈ S Example: S = {a1 . . Reduce EXACT-COVER to SUBSET-SUM {S1 . . . a5 } out of 6 elements 121 / 177 .

a3m } Map each set Sj to an integer tj If Sj ’s are disjoint and cover X . . .SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete. Sn }. . then tj ’s add up to some T For mapping sets into integers. . . . . a5 } out of 6 elements v (S ) = 122 / 177 . |Sj | = 3 over a base set X = {a1 . use the characteristic vector Represent set S as a vector v (S ) where vi (S ) = 1 iff ai ∈ S Example: S = {a1 . . Reduce EXACT-COVER to SUBSET-SUM {S1 . a4 .

. use the characteristic vector Represent set S as a vector v (S ) where vi (S ) = 1 iff ai ∈ S Example: S = {a1 .SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete. Sn }. Reduce EXACT-COVER to SUBSET-SUM {S1 . a3m } Map each set Sj to an integer tj If Sj ’s are disjoint and cover X . |Sj | = 3 over a base set X = {a1 . . . . . a4 . then tj ’s add up to some T For mapping sets into integers. . . a5 } out of 6 elements v (S ) = 1 0 0 1 1 0 123 / 177 . .

a3m } Map each set Sj to an integer tj If Sj ’s are disjoint and cover X . . . . . |Sj | = 3 over a base set X = {a1 . a4 . .SUBSET-SUM Claim The subset sum problem (SUBSET-SUM ) is NP complete. . a5 } out of 6 elements v (S ) = 1 0 0 1 1 0 Easy to see that its a one-to-one mapping 124 / 177 . Sn }. . use the characteristic vector Represent set S as a vector v (S ) where vi (S ) = 1 iff ai ∈ S Example: S = {a1 . Reduce EXACT-COVER to SUBSET-SUM {S1 . . then tj ’s add up to some T For mapping sets into integers.

2. {6. 9}. 5} 125 / 177 . 4. 3. 4. 4. {2. 6}. {2. 7}. 8}. 6}. {1.An Example {1. 8. {1.

8}. 4. 2. 4. 6}. {2. 6}. 9}. 8. 3. {1. {2. {1. 5} 1 2 3 4 5 6 7 8 9 126 / 177 .An Example {1. 7}. 4. {6.

2. {2. 4.An Example {1. 8}. 7}. 8. 3. {1. 6}. {2. 4. 5} 1 2 3 4 5 6 7 8 9 1 0 0 1 0 1 0 0 0 127 / 177 . 6}. 9}. 4. {6. {1.

{1. 8}. 3. {6. {2.An Example {1. 8. 2. 9}. {1. {2. 5} 1 2 3 4 5 6 7 8 9 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 1 1 128 / 177 . 4. 4. 6}. 6}. 4. 7}.

6}. 4. 6}. 7}. 8. {1. {1. 2.An Example {1. {2. 5} 1 2 3 4 5 6 7 8 9 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 0 0 129 / 177 . 3. 4. 4. {6. 9}. 8}. {2.

4. {1. {2. 9}. 3. {1. 8. 6}. 4.An Example {1. 2. 5} 1 2 3 4 5 6 7 8 9 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 0 130 / 177 . 4. 8}. {2. 6}. {6. 7}.

8. 4. The corresponding vectors are: 0 0 0 0 0 1 0 1 1 131 / 177 . 9}. 7}.An Example Lets take the two sets {6. {2.

An Example Lets take the two sets {6. 8. The corresponding vectors are: 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 0 0 132 / 177 . 4. {2. 7}. 9}.

4. 7}. {2. 7. 8. 8. 9}.An Example Lets take the two sets {6. 6. The corresponding vectors are: 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 0 0 The union of the two sets is: {2. 4. 9} 133 / 177 .

6. 7. 4. 4. 7}.An Example Lets take the two sets {6. 8. The corresponding vectors are: 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 0 0 The union of the two sets is: {2. 9}. 9} The characteristic vector of the union is: 0 1 0 1 0 1 1 1 1 134 / 177 . {2. 8.

6.An Example Lets take the two sets {6. 7}. 8. The corresponding vectors are: 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 0 0 The union of the two sets is: {2. 9}. {2. 4. 9} The characteristic vector of the union is: 0 1 0 1 0 1 1 1 1 Any observations? 135 / 177 . 8. 4. 7.

6}. {1. 7}. {6. 4. 3. {2. 4.An Example {1. 9}. {1. 8. 5} 136 / 177 . 8}. 4. 6}. {2. 2.

3. 4. 8}.An Example {1. 4. 6}. 2. 9}. {2. 4. 8. {1. {1. 7}. {6. {2. 6}. 5} 137 / 177 .

9}. {2. 4. 6}. 6}. 8}. 5} 0 0 0 0 0 1 0 1 1 : 23 + 21 + 20 = 011 0 1 0 1 0 0 1 0 0 : 27 + 25 + 22 = 164 1 0 1 0 1 0 0 0 0 : 28 + 26 + 24 = 336 138 / 177 . 2. {2. 4. {6. 3. {1. 4. {1.An Example {1. 8. 7}.

6}. 4. 5} 0 0 0 0 0 1 0 1 1 : 23 + 21 + 20 = 011 0 1 0 1 0 0 1 0 0 : 27 + 25 + 22 = 164 1 0 1 0 1 0 0 0 0 : 28 + 26 + 24 = 336 The union covers X and the sets are pair-wise disjoint: 139 / 177 . 3. 6}. {1. 8. {2. 4.An Example {1. 9}. 4. 8}. 2. {1. {2. {6. 7}.

8}. 4. {6. 6}.An Example {1. {1. 3. 6}. {2. 8. 9}. {2. 7}. 4. 5} 0 0 0 0 0 1 0 1 1 : 23 + 21 + 20 = 011 0 1 0 1 0 0 1 0 0 : 27 + 25 + 22 = 164 1 0 1 0 1 0 0 0 0 : 28 + 26 + 24 = 336 The union covers X and the sets are pair-wise disjoint: 1 1 1 1 1 1 1 1 1 : 29 − 1 = 511 140 / 177 . {1. 4. 2.

3. 4. 141 / 177 . 4. {1.An Example {1. 2. {2. 4. {1. {2. 8. 8}. 7}. 5} 0 0 0 0 0 1 0 1 1 : 23 + 21 + 20 = 011 0 1 0 1 0 0 1 0 0 : 27 + 25 + 22 = 164 1 0 1 0 1 0 0 0 0 : 28 + 26 + 24 = 336 The union covers X and the sets are pair-wise disjoint: 1 1 1 1 1 1 1 1 1 : 29 − 1 = 511 11 + 164 + 336 = 511. {6. 6}. 6}. 9}.

8}. So set W = 2n − 1. {6. 6}. 3. 4. 8. 5} 0 0 0 0 0 1 0 1 1 : 23 + 21 + 20 = 011 0 1 0 1 0 0 1 0 0 : 27 + 25 + 22 = 164 1 0 1 0 1 0 0 0 0 : 28 + 26 + 24 = 336 The union covers X and the sets are pair-wise disjoint: 1 1 1 1 1 1 1 1 1 : 29 − 1 = 511 11 + 164 + 336 = 511. 9}. {1. {2. 2. 142 / 177 . and check. {1.An Example {1. {2. 4. 6}. 7}. 4.

4. {1.An Example {1. 5} 0 0 0 0 0 1 0 1 1 : 23 + 21 + 20 = 011 0 1 0 1 0 0 1 0 0 : 27 + 25 + 22 = 164 1 0 1 0 1 0 0 0 0 : 28 + 26 + 24 = 336 The union covers X and the sets are pair-wise disjoint: 1 1 1 1 1 1 1 1 1 : 29 − 1 = 511 11 + 164 + 336 = 511. 4. {2. 9}. So set W = 2n − 1. 4. {1. and check. 8}. 6}. 8. 6}. There exists subset equal to W =⇒ exact-cover possible 143 / 177 . {6. 7}. 2. 3. {2.

{1. 8}. and check. {2. So set W = 2n − 1. 6}. There exists subset equal to W =⇒ exact-cover possible Problem: 144 / 177 . 4.An Example {1. 3. 7}. 5} 0 0 0 0 0 1 0 1 1 : 23 + 21 + 20 = 011 0 1 0 1 0 0 1 0 0 : 27 + 25 + 22 = 164 1 0 1 0 1 0 0 0 0 : 28 + 26 + 24 = 336 The union covers X and the sets are pair-wise disjoint: 1 1 1 1 1 1 1 1 1 : 29 − 1 = 511 11 + 164 + 336 = 511. 4. 8. 6}. {1. 9}. {6. 2. 4. {2.

{1. 5} 0 0 0 0 0 1 0 1 1 : 23 + 21 + 20 = 011 0 1 0 1 0 0 1 0 0 : 27 + 25 + 22 = 164 1 0 1 0 1 0 0 0 0 : 28 + 26 + 24 = 336 The union covers X and the sets are pair-wise disjoint: 1 1 1 1 1 1 1 1 1 : 29 − 1 = 511 11 + 164 + 336 = 511. {1. 8}. 8. and check. {2. 6}. 6}. 4. 9}. {6. {2. 7}. 4. 145 / 177 . 3. There exists subset equal to W =⇒ exact-cover possible Problem: False positives. 2. 4. So set W = 2n − 1.An Example {1.

{2. 4}. 3. {2. 4} 146 / 177 . 4}.A Problem {3.

{2. {2. 4}. 4} 0 0 1 1 :3 147 / 177 .A Problem {3. 4}. 3.

3. {2.A Problem {3. 4}. 4} 0 0 1 1 :3 0 1 0 1 :5 148 / 177 . 4}. {2.

4}. 3. 4} 0 0 1 1 :3 0 1 0 1 :5 0 1 1 1 :7 149 / 177 . 4}.A Problem {3. {2. {2.

{2. 150 / 177 . {2. and not disjoint. 4} 0 0 1 1 :3 0 1 0 1 :5 0 1 1 1 :7 The union does not cover X . 3. 4}.A Problem {3. 4}.

4}. 3. 0011 + 0101 + 0111 151 / 177 .A Problem {3. 4} 0 0 1 1 :3 0 1 0 1 :5 0 1 1 1 :7 The union does not cover X . 4}. and not disjoint. {2. {2.

4}. and not disjoint. 4} 0 0 1 1 :3 0 1 0 1 :5 0 1 1 1 :7 The union does not cover X . {2. 0011 + 0101 + 0111 = 1111 152 / 177 . 3. {2. 4}.A Problem {3.

and not disjoint. {2. 3. {2. 4}. 4} 0 0 1 1 :3 0 1 0 1 :5 0 1 1 1 :7 The union does not cover X . 0 0 1 1 + 0 1 0 1 + 0 1 1 1 = 1 1 1 1 = 15 153 / 177 .A Problem {3. 4}.

{2. {2. 0 0 1 1 + 0 1 0 1 + 0 1 1 1 = 1 1 1 1 = 15 So. where is the problem coming from? 154 / 177 .A Problem {3. 4} 0 0 1 1 :3 0 1 0 1 :5 0 1 1 1 :7 The union does not cover X . 4}. 3. 4}. and not disjoint.

3. 155 / 177 . 4}. 4} 0 0 1 1 :3 0 1 0 1 :5 0 1 1 1 :7 The union does not cover X . {2. 0 0 1 1 + 0 1 0 1 + 0 1 1 1 = 1 1 1 1 = 15 So. and not disjoint. where is the problem coming from? Carrying! It messes up the addition.A Problem {3. 4}. {2.

A Solution There are actually two different problems due to carrying: 156 / 177 .

could get 1 from carry-over 157 / 177 .A Solution There are actually two different problems due to carrying: If a column has all 0’s.

could get 1 from carry-over If a column has more than one 1.A Solution There are actually two different problems due to carrying: If a column has all 0’s. could still get one 1 158 / 177 .

could get 1 from carry-over If a column has more than one 1. could still get one 1 Solution: 159 / 177 .A Solution There are actually two different problems due to carrying: If a column has all 0’s.

could still get one 1 Solution: Interpret vector over base 3m.A Solution There are actually two different problems due to carrying: If a column has all 0’s. not base 2! 160 / 177 . could get 1 from carry-over If a column has more than one 1.

not base 2! {2. could still get one 1 Solution: Interpret vector over base 3m.A Solution There are actually two different problems due to carrying: If a column has all 0’s. could get 1 from carry-over If a column has more than one 1. 4} = 0 1 1 1 = 161 / 177 . 3.

could still get one 1 Solution: Interpret vector over base 3m. 4} = 0 1 1 1 = 22 + 21 + 20 . could get 1 from carry-over If a column has more than one 1. 3. 162 / 177 . not base 2! {2.A Solution There are actually two different problems due to carrying: If a column has all 0’s.

not base 2! {2. 52 + 51 + 50 = 31 163 / 177 . 4} = 0 1 1 1 = 22 + 21 + 20 .A Solution There are actually two different problems due to carrying: If a column has all 0’s. could get 1 from carry-over If a column has more than one 1. could still get one 1 Solution: Interpret vector over base 3m. 3.

could get 1 from carry-over If a column has more than one 1. could still get one 1 Solution: Interpret vector over base 3m. not base 2! {2.A Solution There are actually two different problems due to carrying: If a column has all 0’s. 4} = 0011 = 164 / 177 . 52 + 51 + 50 = 31 {3. 3. 4} = 0 1 1 1 = 22 + 21 + 20 .

could still get one 1 Solution: Interpret vector over base 3m. 4} = 0 1 1 1 = 22 + 21 + 20 . 4} = 0 0 1 1 = 21 + 20 .A Solution There are actually two different problems due to carrying: If a column has all 0’s. 52 + 51 + 50 = 31 {3. 165 / 177 . 3. not base 2! {2. could get 1 from carry-over If a column has more than one 1.

A Solution There are actually two different problems due to carrying: If a column has all 0’s. 4} = 0 1 1 1 = 22 + 21 + 20 . 3. 4} = 0 0 1 1 = 21 + 20 . not base 2! {2. could get 1 from carry-over If a column has more than one 1. 52 + 51 + 50 = 31 51 + 50 = 6 {3. 166 / 177 . could still get one 1 Solution: Interpret vector over base 3m.

not base 2! {2.A Solution There are actually two different problems due to carrying: If a column has all 0’s. 4} = 0 0 1 1 = 21 + 20 . could still get one 1 Solution: Interpret vector over base 3m. 4} = 0 1 1 1 = 22 + 21 + 20 . {2. 52 + 51 + 50 = 31 51 + 50 = 6 {3. 4} = 0101 = 167 / 177 . 3. could get 1 from carry-over If a column has more than one 1.

2 0 {2. 52 + 51 + 50 = 31 51 + 50 = 6 {3. could still get one 1 Solution: Interpret vector over base 3m. not base 2! {2. could get 1 from carry-over If a column has more than one 1.A Solution There are actually two different problems due to carrying: If a column has all 0’s. 4} = 0 1 1 1 = 22 + 21 + 20 . 4} = 0 0 1 1 = 21 + 20 . 168 / 177 . 4} = 0 1 0 1 =2 +2 . 3.

not base 2! {2. 2 0 52 + 50 = 26 {2. 169 / 177 . could still get one 1 Solution: Interpret vector over base 3m.A Solution There are actually two different problems due to carrying: If a column has all 0’s. could get 1 from carry-over If a column has more than one 1. 4} = 0 1 1 1 = 22 + 21 + 20 . 4} = 0 0 1 1 = 21 + 20 . 52 + 51 + 50 = 31 51 + 50 = 6 {3. 3. 4} = 0 1 0 1 =2 +2 .

3. 0011 + 0101 + 0111 170 / 177 . could still get one 1 Solution: Interpret vector over base 3m. 4} = 0 1 0 1 =2 +2 . could get 1 from carry-over If a column has more than one 1. not base 2! {2.A Solution There are actually two different problems due to carrying: If a column has all 0’s. 52 + 51 + 50 = 31 51 + 50 = 6 {3. 4} = 0 1 1 1 = 22 + 21 + 20 . 4} = 0 0 1 1 = 21 + 20 . 2 0 52 + 50 = 26 {2.

could still get one 1 Solution: Interpret vector over base 3m. could get 1 from carry-over If a column has more than one 1. 52 + 51 + 50 = 31 51 + 50 = 6 {3. 3. 4} = 0 1 0 1 =2 +2 . not base 2! {2. 2 0 52 + 50 = 26 {2.A Solution There are actually two different problems due to carrying: If a column has all 0’s. 4} = 0 0 1 1 = 21 + 20 . 0011 + 0101 + 0111 = 0223 171 / 177 . 4} = 0 1 1 1 = 22 + 21 + 20 .

A Solution There are actually two different problems due to carrying: If a column has all 0’s. 4} = 0 1 0 1 =2 +2 . 4} = 0 0 1 1 = 21 + 20 . 2 0 52 + 50 = 26 {2. 0 0 1 1 + 0 1 0 1 + 0 1 1 1 = 0 2 2 3 = 63 = 1 1 1 1 172 / 177 . 3. not base 2! {2. could get 1 from carry-over If a column has more than one 1. 52 + 51 + 50 = 31 51 + 50 = 6 {3. 4} = 0 1 1 1 = 22 + 21 + 20 . could still get one 1 Solution: Interpret vector over base 3m.

4} = 0 0 1 1 = 21 + 20 . 3. could get 1 from carry-over If a column has more than one 1. 2 0 52 + 50 = 26 {2. not base 2! {2. 4} = 0 1 1 1 = 22 + 21 + 20 . 0 0 1 1 + 0 1 0 1 + 0 1 1 1 = 0 2 2 3 = 63 = 1 1 1 1 Adding at most n 1’s =⇒ no carry-over at any digit 173 / 177 . 4} = 0 1 0 1 =2 +2 . 52 + 51 + 50 = 31 51 + 50 = 6 {3. could still get one 1 Solution: Interpret vector over base 3m.A Solution There are actually two different problems due to carrying: If a column has all 0’s.

could still get one 1 Solution: Interpret vector over base 3m. not base 2! {2. 52 + 51 + 50 = 31 51 + 50 = 6 {3. 4} = 0 0 1 1 = 21 + 20 .A Solution There are actually two different problems due to carrying: If a column has all 0’s. 0 0 1 1 + 0 1 0 1 + 0 1 1 1 = 0 2 2 3 = 63 = 1 1 1 1 Adding at most n 1’s =⇒ no carry-over at any digit This solves both the problems since: 174 / 177 . 3. 4} = 0 1 1 1 = 22 + 21 + 20 . 4} = 0 1 0 1 =2 +2 . could get 1 from carry-over If a column has more than one 1. 2 0 52 + 50 = 26 {2.

2 0 52 + 50 = 26 {2. 4} = 0 0 1 1 = 21 + 20 . 3. 4} = 0 1 0 1 =2 +2 . could get 1 from carry-over If a column has more than one 1. 4} = 0 1 1 1 = 22 + 21 + 20 . 175 / 177 . 0 0 1 1 + 0 1 0 1 + 0 1 1 1 = 0 2 2 3 = 63 = 1 1 1 1 Adding at most n 1’s =⇒ no carry-over at any digit This solves both the problems since: If a column has all 0’s.A Solution There are actually two different problems due to carrying: If a column has all 0’s. not base 2! {2. 52 + 51 + 50 = 31 51 + 50 = 6 {3. no carry-over ensures it gets a 0. could still get one 1 Solution: Interpret vector over base 3m.

it will get the sum. could get 1 from carry-over If a column has more than one 1. 2 0 52 + 50 = 26 {2. no carry-over ensures it gets a 0. 176 / 177 . If a column has more than one 1.A Solution There are actually two different problems due to carrying: If a column has all 0’s. 3. 4} = 0 1 0 1 =2 +2 . not 1. 0 0 1 1 + 0 1 0 1 + 0 1 1 1 = 0 2 2 3 = 63 = 1 1 1 1 Adding at most n 1’s =⇒ no carry-over at any digit This solves both the problems since: If a column has all 0’s. 4} = 0 1 1 1 = 22 + 21 + 20 . 52 + 51 + 50 = 31 51 + 50 = 6 {3. 4} = 0 0 1 1 = 21 + 20 . not base 2! {2. could still get one 1 Solution: Interpret vector over base 3m.

Reductions So Far SAT 3-SAT ECOV HPATH VC IS IP SC HS CL SSUM KNAP 177 / 177 .