






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Solutions and explanations for exam questions related to complexity classes, np-completeness, and reductions. It covers concepts like p, np, np-hard, np-complete, and reduction techniques. Useful for students studying computer science or related fields.
Typology: Exams
1 / 10
This page cannot be seen from the preview
Don't miss anything!
The |!||!|Class |!||!|P |!||!|- |!||!|correct |!||!|answer |!||!| ✔ A |!||!|solution |!||!|may |!||!|be |!||!|found |!||!|in |!||!|polynomial |!||!|time The |!||!|Class |!||!|NP |!||!|- |!||!|correct |!||!|answer |!||!| ✔ A |!||!|solution |!||!|may |!||!|be |!||!|verified |!||!|in |!||!|polynomial |!||!|time NP-Hard |!||!|- |!||!|correct |!||!|answer |!||!| ✔ We |!||!|are |!||!|yet |!||!|to |!||!|find |!||!|a |!||!|polynomial |!||!|time |!||!|solution NP-Complete |!||!|- |!||!|correct |!||!|answer |!||!| ✔ Both |!||!|in |!||!|NP |!||!|and |!||!|at |!||!|least |!||!|as |!||!|hard |!||!|as |!||!|NP-Hard |!||!| problems NP |!||!|Reduction |!||!|- |!||!|Steps |!||!|- |!||!|correct |!||!|answer |!||!| ✔ 1. |!||!|Demonstrate |!||!|that |!||!|problem |!||!|B |!||!|is |!||!|in |!||!|the |!||!|class |!||!|of |!||!|NP |!||!|Problems
B) a) |!||!|Show |!||!|how |!||!|an |!||!|instance |!||!|of |!||!|A |!||!|is |!||!|converted |!||!|to |!||!|B |!||!|in |!||!|polynomial |!||!|time b) |!||!|Show |!||!|how |!||!|a |!||!|solution |!||!|to |!||!|B |!||!|can |!||!|be |!||!|converted |!||!|to |!||!|a |!||!|solution |!||!|for |!||!|A, |!||!|again |!||!|
in |!||!|polynomial |!||!|time c) |!||!|Show |!||!|that |!||!|a |!||!|solution |!||!|for |!||!|B |!||!|exists |!||!|IF |!||!|AND |!||!|ONLY |!||!|IF |!||!|a |!||!|solution |!||!|to |!||!|A |!||!|exists
LP: |!||!|Why |!||!|optimum |!||!|occurs |!||!|at |!||!|a |!||!|vertex |!||!|- |!||!|correct |!||!|answer |!||!| ✔ Feasible |!||!|region |!||!|is |!||!| convex LP: |!||!|Optimum |!||!|achieved |!||!|at |!||!|a |!||!|vertex |!||!|except: |!||!|- |!||!|correct |!||!|answer |!||!| ✔ 1. |!||!|Infeasible |!||!|- |!||!| feasible |!||!|region |!||!|is |!||!|empty
Output: |!||!|An |!||!|array |!||!|of |!||!|integers |!||!|that |!||!|is |!||!|a |!||!|subset |!||!|of |!||!|A |!||!|and |!||!|sums |!||!|to |!||!|t KnapsackSearch |!||!|- |!||!|correct |!||!|answer |!||!| ✔ Input: |!||!|W |!||!|is |!||!|an |!||!|array |!||!|of |!||!|weights, |!||!|V |!||!|is |!||!|an |!||!| array |!||!|of |!||!|values, |!||!|B |!||!|is |!||!|the |!||!|capacity |!||!|of |!||!|the |!||!|knapsack, |!||!|and |!||!|g |!||!|is |!||!|the |!||!|goal. Output: |!||!|Array |!||!|of |!||!|items |!||!|of |!||!|value |!||!|at |!||!|least |!||!|g |!||!|with |!||!|weight |!||!|less |!||!|than |!||!|or |!||!|equal |!||!|to |!||!|B TSP |!||!|- |!||!|correct |!||!|answer |!||!| ✔ Input: |!||!|G |!||!|is |!||!|a |!||!|weighted, |!||!|fully |!||!|connected |!||!|graph |!||!|with |!||!| weights |!||!|for |!||!|each |!||!|n(n-1)/2 |!||!|edges; |!||!|b |!||!|is |!||!|a |!||!|budget Output: |!||!|A |!||!|path |!||!|that |!||!|visits |!||!|every |!||!|vertex |!||!|in |!||!|the |!||!|graph |!||!|exactly |!||!|once |!||!|and |!||!|has |!||!|a |!||!|total |!||!|cost |!||!|of |!||!|b |!||!|or |!||!|less 3DMatching |!||!|- |!||!|correct |!||!|answer |!||!| ✔ Input: |!||!|disjoint |!||!|sets |!||!|X, |!||!|Y, |!||!|Z |!||!|of |!||!|items |!||!|to |!||!|be |!||!| matched. |!||!|Collection |!||!|of |!||!|compatibility |!||!|triples |!||!|(X, |!||!|Y, |!||!|Z) Output: |!||!|A |!||!|disjoint |!||!|set |!||!|(no |!||!|elements |!||!|in |!||!|common) |!||!|of |!||!|n |!||!|compatible |!||!|triples ZOE |!||!|- |!||!|correct |!||!|answer |!||!| ✔ Input: |!||!|an |!||!|mXn |!||!|matrix |!||!|A, |!||!|all |!||!|of |!||!|whose |!||!|entries |!||!|are |!||!| 0 |!||!| or |!||!| 1 Output: |!||!|An |!||!|n-vector |!||!|x, |!||!|all |!||!|of |!||!|whose |!||!|entries |!||!|are |!||!| 0 |!||!|or |!||!|1, |!||!|such |!||!|that |!||!|AX |!||!|= |!||!| 1 Clique, |!||!|Independent |!||!|Set |!||!|and |!||!|Vertex |!||!|Cover |!||!|Relation |!||!|- |!||!|correct |!||!|answer |!||!| ✔ Lemma: |!||!| Given |!||!|an |!||!|undirected |!||!|graph |!||!|G |!||!|= |!||!|(V, |!||!|E) |!||!|with |!||!|n |!||!|vertices |!||!|and |!||!|a |!||!|subset |!||!|V |!||!| ′ |!||!|⊆ |!||!|V |!||!|of |!||!|size |!||!|k. |!||!|The |!||!|following |!||!|are |!||!|equivalent: (i) |!||!|V |!||!| ′ |!||!|is |!||!|a |!||!|clique |!||!|of |!||!|size |!||!|k |!||!|for |!||!|the |!||!|complement |!||!|Graph (ii) |!||!|V |!||!| ′ |!||!|is |!||!|an |!||!|independent |!||!|set |!||!|of |!||!|size |!||!|k |!||!|for |!||!|Graph (iii) |!||!|V |!||!|- |!||!|V ′ |!||!|is |!||!|a |!||!|vertex |!||!|cover |!||!|of |!||!|size |!||!|n−k |!||!|for |!||!|G, |!||!|(where |!||!|n=|V|)
NP-Complete |!||!|relationship |!||!|to |!||!|NP-Hard |!||!|- |!||!|correct |!||!|answer |!||!| ✔ All |!||!|NP-Complete |!||!|Problems |!||!|are |!||!|NP-Hard, |!||!|but |!||!|not |!||!|all |!||!|NP-Hard |!||!|Problems |!||!|are |!||!|NP-Complete You |!||!|are |!||!|given |!||!|two |!||!|problems |!||!|A |!||!|and |!||!|B |!||!|such |!||!|that |!||!|A |!||!|is |!||!|NP-complete, |!||!|B |!||!|does |!||!| not |!||!|belong |!||!|to |!||!|the |!||!|class |!||!|NP |!||!|and |!||!|A |!||!|-> |!||!|B |!||!|- |!||!|correct |!||!|answer |!||!| ✔ 1. |!||!|B |!||!|is |!||!|NP-Hard
LP |!||!|Check |!||!|Unbounded |!||!|- |!||!|correct |!||!|answer |!||!| ✔ - |!||!|check |!||!|if |!||!|primal |!||!|and |!||!|dual |!||!|are |!||!| infeasible LP |!||!|Strong |!||!|Duality |!||!|- |!||!|correct |!||!|answer |!||!| ✔ Theorem: |!||!|Primal |!||!|LP |!||!|is |!||!|feasible |!||!|and |!||!| bounded |!||!|iff |!||!|Dual |!||!|LP |!||!|is |!||!|feasible |!||!|and |!||!|bounded --> |!||!|Primal |!||!|has |!||!|optimal |!||!|x* |!||!|iff |!||!|dual |!||!|has |!||!|optimal |!||!|y* --> |!||!|c^T |!||!|* |!||!|x |!||!|= |!||!|b^T |!||!|* |!||!|y LP |!||!|Max |!||!|Flow |!||!|- |!||!|Min |!||!|Cut |!||!|- |!||!|correct |!||!|answer |!||!| ✔ c^T |!||!|* |!||!|x |!||!|= |!||!|max |!||!|flow b^T |!||!|* |!||!|y |!||!|= |!||!|min |!||!|cut LP |!||!|Ek-SAT |!||!|approximation: |!||!|Simple |!||!|and |!||!|LP-Based |!||!|- |!||!|correct |!||!|answer |!||!| ✔ Simple: |!||!| 1 |!||!|- |!||!| 2^-k LP: |!||!| 1 |!||!|- |!||!|(1 |!||!|- |!||!|1/k)^k