{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sol12 - NP We reduce 3 − SAT to 0 − 1 integer...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 435 DL, Fall 2001, Jim Calvin Homework #12 Solutions 34.1-4. The dynamic programming solution ran in time O ( nW ), which at frst glance appears to be polynomial time. However, it requires lg( W ) bits to store W , and so the running time is O ( n · 2 lg( W ) ), or exponential in the size oF the problem input. Notice that here we accept that the weights and values oF the items are bounded as n increases, but W is not. You might want to think about whether this is reasonable. 34.1-5. Suppose that the i th procedure call takes time n i ,and n calls are made. ±or n 2, the total time is n X i =1 n i n X i = n/ 2 n i n 2 n n/ 2 > 2 n . 34.5-2. IF we are given an n -vector x we can check iF Ax b in time O ( mn ), and check that each x i ∈{ 0 , 1 } in O ( n ) time, so the problem is in
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: NP . We reduce 3 − SAT to 0 − 1 integer programming. Suppose we have m clauses (with three literals each) over variables u 1 , ··· , u n . ±or each clause, construct an inequality by replacing ∨ with +, u i with x i , and ¯ u i by 1 − x i , and requiring the sum to be at least 1. This gives m inequalities over n variables x 1 , ··· , x n . ±or example, the clause u 2 ∨ ¯ u 4 ∨ u 5 becomes x 2 + 1 − x 4 + x 5 ≥ 1, with x i ∈ { , 1 } For each i . Clearly the original set oF clauses is satisfable iF and only iF the set oF m inequalities constructed has a solution. 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online