Problem Solving 5 Applications of NP-hardness Knapsack Knapsack max c1 x1 c 2 x 2 cnxn s. t. s1 x1 s 2 x 2 snxn S xi {0, 1}. Assume ci 0 and si S . Knapsack is NP-hard max c1 x1 c 2 x 2 cnxn s. t. s1 x1 s 2 x 2 snxn S xi {0, 1}. Assume ci 0 and si S . Decision Version of Knapsack Given c1 , c2 ,..., cn , s1 , s2 ,..., sn , S and k 0, determine whether th ere exist x1 , x2 ,..., xn such that c1 x1 c2 x2 cn xn k s1 x1 s2 x2 sn xn S . Partition mp Knapsack Partition Given a set of n positive integers, A {a1 , a2 ,..., an }, is there a partition A A1 A2 such that a a. a A1 a A2 Partition mp Decision v ersion of Knapsack 1 n Set ci si ai and k S i 1 ai . 2 Then Yes for Partition Yes for Knapsack. Set-Cover 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 setcover.) Vertex - Cover mp Set - Cover Vertex-Cover Given a graph G (V , E ), find a minimum vertex cover where a vertex cover is a subset of vertices such that every edge has an endpoint in the subset. Decision Version of Vertex-Cover Given a graph G (V , E ) and k ,1 k | V |, determine whether th ere exists a vertex cover with at most k vertices. Decision Version of Set-Cover Given a collection C of subsets of a finite set X and an integer k 0, determine whether t here exists a set cover with at most k subsets. Decision Version of Vertex - Cover mp Decision Version of Set - Cover Let S (v) be the set of edges covered by v V . Set C {S (v) | v V } and X E. Then G has a vertex cover of size at most k C contains a set cover of size at most k . Broadcast in Multi-Channel Wireless Networks Problem Consider a network G (V , E ) that at each node v V , there exists a set of channels (postive integers), A(v) that v can use to send/recei ve messages. Given a source node s, find F (v) A(v) for every v V such that (1) {( u,v) | F (u ) A(u ) } contains a broadcast tree; (2) vV | F (v) | is minimized. Nonunique Probe Selection and Group Testing DNA Hybridization Polymerase Chain Reaction (PCR) • cell-free method of DNA cloning Advantages • much faster than cell based method • need very small amount of target DNA Disadvantages • need to synthesize primers • applies only to short DNA fragments(<5kb) Preparation of a DNA Library • DNA library: a collection of cloned DNA fragments • usually from a specific organism DNA Library Screening 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. Binary Matrix viruses probes p1 p2 p3 pi pt c1 0 0 1 0 . . 0 . . 0 c2 0 1 0 0 c3 0 0 0 1 … … … … 0 0 0 0 … … … … 0 0 0 0 cj … 0 … 0 … 0 … 0 … … … … 0 0 0 0 … … … … 0 0 0 0 … … … … 0 0 0 0 … … … … cn 0 0 0 0 0 0 … 0 … 0 … 1 … 0 … 0 … 0 … 0 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 The cell (i, j) contains 1 iff the ith probe hybridizes the jth virus. Binary Matrix of Example virus probes p1 p2 p3 c1 1 0 0 1 0 0 c2 1 0 0 0 1 0 c3 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 cj 0 0 1 1 0 0 0 0 1 0 1 0 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! _ d-Separable Matrix viruses p1 p2 p3 probes pi pt c1 0 0 1 0 . . 0 . . 0 c2 c3 cj 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 1 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 0 1 … 0 … 0 … 0 … 0 … 0 … 0 … 0 0 0 … 0 … 0 … 1 … 0 … 0 … 0 … 0 0 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 All unions of up to d columns are distinct. Decoding: O(nd) cn d-Disjunct Matrix c1 c2 p1 0 0 p2 0 1 p3 1 0 probes 0 0 . . pi 0 0 . . pt 0 0 0 … 0 … 0 c3 0 0 0 1 … … … … 0 0 0 0 viruses cj … 0 … 0 … 0 … 0 … 0 … 0 … 0 … 0 … … … … 0 0 0 0 … … … … 0 0 0 0 … … … … 0 0 0 0 … … … … cn 0 0 0 0 0 … 0 … 0 … 1 … 0 … 0 … 0 … 0 0 … 0 … 0 … 0 … 0 … Each column is different from the union of every d other columns Decoding: O(n) Remove all clones in negative pools. Remaining clones are all positive. 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 Problem What complexity class do Nonunique Probe Selection problems belong to? Do they belong to NP? Complexity? • All three problems may not be in NP, why? • Guess a t x n matrix M, verify if M is dseparable (d-separable, d-disjunct). d-Separability Test • Given a matrix M and d, is M d-separable? • It is co-NP-complete. - 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. (b) Reduction from vertexcover • Given a graph G and h > 0, does G have a vertex cover of size at most h? VC mp Complement of d - Separabili ty Test Suppose G (V , E ). Choose v* V . Design the following pools : {v} for v V ; {v*} e for e E , and set d h 1. - 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. d-Disjunct Test • Given a matrix M and d, is M d-disjunct? • This is co-NP-complete. 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 NPhard. • In general, the problem is conjectured to p be Σ2 –complete. What is 2p ? What is Σ - complete? p 2