Problem Solving 5 Applications of NP-hardness. Knapsack.
-
Upload
bethanie-carroll -
Category
Documents
-
view
214 -
download
0
Transcript of Problem Solving 5 Applications of NP-hardness. Knapsack.
![Page 1: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/1.jpg)
Problem Solving 5
Applications of NP-hardness
![Page 2: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/2.jpg)
Knapsack
![Page 3: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/3.jpg)
Knapsack
. and 0 Assume
}.1 ,0{
t.s.
max
2211
2211
Ssc
x
Sxsxsxs
xcxcxc
ii
i
nn
nn
![Page 4: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/4.jpg)
Knapsack is NP-hard
. and 0 Assume
}.1 ,0{
t.s.
max
2211
2211
Ssc
x
Sxsxsxs
xcxcxc
ii
i
nn
nn
![Page 5: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/5.jpg)
Decision Version of Knapsack
Knapsack Partition
.
such that ,...,,exist erewhether th
determine ,0 and ,,...,,,,...,,Given
2211
221
21
2121
1
pm
nn
nn
n
nn
Sxsxsxs
kxcxcxc
xxx
kSsssccc
![Page 6: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/6.jpg)
Partition
1 2
. such that
partition a thereis },,...,,{ integers, positive ofset aGiven
21
21
Aa Aa
n
aaAAA
aaaAn
Knapsack ofersion Decision v Partition pm
Knapsack.for Partition for Then
.2
1 and Set
1
YesYes
aSkascn
i iiii
![Page 7: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/7.jpg)
Set-Cover
![Page 8: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/8.jpg)
Set-Cover
Given a collection C of subsets of a set X, find a minimum subcollection C’ of C such that every element of X appears in a subset in C’ . (Such a C’ is called a set-cover.)
Cover-Set Cover -Vertex pm
![Page 9: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/9.jpg)
Vertex-Cover
subset. in theendpoint an has edgeevery
such that verticesofsubset a iscover vertex a where
cover vertex minimum a find ),,(graph aGiven EVG
![Page 10: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/10.jpg)
Decision Version of Vertex-Cover
vertices.most at cover with vertex a exists erewhether th
determine |,|1, and ),(graph aGiven
k
VkkEVG
Decision Version of Set-Cover
subsets.
most at cover withset a exists here whether tdetermine ,0
integer an and set finite a of subsets of collection aGiven
k
k
XC
Cover-Set ofVersion Decision Cover -Vertex ofVersion Decision pm
.most at size ofcover set a
contains most at size ofcover vertex a has Then . and
}|)({Set .by covered edges ofset thebe )(Let
k
CkGEX
VvvSCVvvS
![Page 11: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/11.jpg)
Broadcast in Multi-Channel Wireless Networks
![Page 12: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/12.jpg)
Problem
minimized. is |)(| (2) tree;
broadcast a contains })()( | ){( (1)such that
every for )( )( find , node source aGiven
messages. vesend/recei tousecan
that )( integers), (postive channels ofset a exists there
, nodeeach at that ),(network aConsider
vF
uAuFu,v
VvvAvFs
v
vA
VvEVG
Vv
![Page 13: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/13.jpg)
Nonunique Probe Selection and Group Testing
![Page 14: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/14.jpg)
DNA Hybridization
![Page 15: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/15.jpg)
Polymerase Chain Reaction
(PCR)• cell-free method of
DNA cloning
Advantages• much faster than cell
based method• need very small
amount of target DNADisadvantages• need to synthesize
primers• applies only to short
DNA fragments(<5kb)
![Page 16: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/16.jpg)
Preparation of a DNA Library• DNA library: a collection of cloned DNA fragments• usually from a specific organism
![Page 17: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/17.jpg)
DNA Library Screening
![Page 18: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/18.jpg)
Problem
• If a probe doesn’t uniquely determine a virus, i.e., a probe determine a group of viruses, how to select a subset of probes from a given set of probes, in order to be able to find up to d viruses in a blood sample.
![Page 19: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/19.jpg)
Binary Matrixviruses
c1 c2 c3 cj cn
p1 0 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 p2 0 1 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 p3 1 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0
probes 0 0 1 … 0 … 0 … 0 … 0 … 0 … 0 … 0 ..
pi 0 0 0 … 0 … 0 … 1 … 0 … 0 … 0 … 0 ..
pt 0 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0
The cell (i, j) contains 1 iff the ith probe hybridizes the jth virus.
![Page 20: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/20.jpg)
Binary Matrix of Example
virus
c1 c2 c3 cj p1 1 1 1 0 0 0 0 0 0 p2 0 0 0 1 1 1 0 0 0 p3 0 0 0 0 0 0 1 1 1
probes 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 00 0 1 0 0 1 0 0 1
Observation: All columns are distinct.
To identify up to d viruses, all unions of up to d columns should be distinct!
![Page 21: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/21.jpg)
d-Separable Matrixviruses
c1 c2 c3 cj cn
p1 0 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 p2 0 1 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0
p3 1 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 probes 0 0 1 … 0 … 0 … 0 … 0 … 0 … 0 … 0
.
. pi 0 0 0 … 0 … 0 … 1 … 0 … 0 … 0 … 0
.
. pt 0 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0
All unions of up to d columns are distinct.Decoding: O(nd)
_
![Page 22: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/22.jpg)
d-Disjunct Matrix viruses
c1 c2 c3 cj cn
p1 0 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 p2 0 1 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 p3 1 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0
probes 0 0 1 … 0 … 0 … 0 … 0 … 0 … 0 … 0 ..
pi 0 0 0 … 0 … 0 … 1 … 0 … 0 … 0 … 0 ..
pt 0 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0
Each column is different from the union of every d other columnsDecoding: O(n)Remove all clones in negative pools. Remaining clones are all positive.
![Page 23: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/23.jpg)
Nonunique Probe Selection• Given a binary matrix, find a d-separable
submatrix with the same number of columns and the minimum number of rows.
• Given a binary matrix, find a d-disjunct submatrix with the same number of columns and the minimum number of rows.
• Given a binary matrix, find a d-separable submatrix with the same number of columns and the minimum number of rows
_
![Page 24: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/24.jpg)
Problem
NP? tobelong they Do
to?belong problemsSelection
Probe Nonunique do class complexityWhat
![Page 25: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/25.jpg)
Complexity?
• All three problems may not be in NP, why?
• Guess a t x n matrix M, verify if M is d-separable (d-separable, d-disjunct).
-
![Page 26: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/26.jpg)
d-Separability Test
• Given a matrix M and d, is M d-separable?
• It is co-NP-complete.
![Page 27: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/27.jpg)
d-Separability Test
• Given a matrix M and d, is M d-separable?
• This is co-NP-complete.
(a) It is in co-NP.
Guess two samples from space S(n,d). Check if M gives the same test outcome on the two samples.
-
-
-
![Page 28: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/28.jpg)
(b) Reduction from vertex-cover
• Given a graph G and h > 0, does G have a vertex cover of size at most h?
.1set and
,for *}{
;for }{
:pools following Design the .* Choose
).,( Suppose
hd
Eeev
Vvv
Vv
EVG
Testty Separabili- of Complement dVC pm
![Page 29: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/29.jpg)
d-Separability Test Reduces to d-Separability Test
• Put a zero column to M to form a new matrix M*
• Then M is d-separable if and only if M* is d-separable.
-
-
![Page 30: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/30.jpg)
d-Disjunct Test
• Given a matrix M and d, is M d-disjunct?
• This is co-NP-complete.
![Page 31: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/31.jpg)
Minimum d-Separable Submatrix
• Given a binary matrix, find a d-separable submatrix with minimum number of rows and the same number of columns.
• For any fixed d >0, the problem is NP-hard.
• In general, the problem is conjectured to be Σ2 –complete.
p
![Page 32: Problem Solving 5 Applications of NP-hardness. Knapsack.](https://reader036.fdocuments.us/reader036/viewer/2022070401/56649f1e5503460f94c35880/html5/thumbnails/32.jpg)
complete?- isWhat
? isWhat
2
2
p
p
Σ