We can show that the clique problem is NP-hard by proving that
3-CNF_SAT ≤P CLIQUE
A problem X is NP-hard if every problem in NP reduces to it in polynomial time. In practice we take a problem Y already known to be NP-complete and prove Y ≤P X.
The direction matters: Y ≤P X means any instance of Y can be converted in polynomial time into an instance of X, so X is at least as hard as Y. Reducing X to some other problem only shows that the other problem is at least as hard as X.
3-CNF_SAT is NP-complete. The standard construction turns a 3-CNF formula with k clauses into a graph with one vertex per literal in each clause, joining two vertices when they lie in different clauses and are not complementary; the formula is satisfiable exactly when the graph has a clique of size k. This proves 3-CNF_SAT ≤P CLIQUE, so CLIQUE is NP-hard.
Reductions of the form CLIQUE ≤P VERTEX_COVER or CLIQUE ≤P SUBSET_SUM go from CLIQUE to another problem; they establish hardness of VERTEX_COVER or SUBSET_SUM, not of CLIQUE.
Hence, the answer is 3-CNF_SAT ≤P CLIQUE.
Match the following :
| List – I | List – II | ||
| a. | Bucket sort | i. | \(O(n^3 \lg n)\) |
| b. | Matrix chain multiplication | ii. | \(O(n^3)\) |
| c. | Huffman codes | iii. | \(O(n \lg n)\) |
| d. | All pairs shortest paths | iv. | \(O(n)\) |
Codes :
a b c d
To determine the efficiency of an algorithm the time factor is measured by :
Given the following statements :
\(S_{1}\) : The subgraph-isomorphism problem takes two graphs \(G_{1}\) and \(G_{2}\) and asks whether \(G_{1}\) is a subgraph of \(G_{2}\).
\(S_{2}\) : The set-partition problem takes as input a set S of numbers and asks whether the numbers can be partitioned into two sets A and \(\bar{A} = S - A\) such that
\(\sum_{x \in A} x = \sum_{x \in \bar{A}} x\)
Which of the following is true ?
An algorithm is made up of 2 modules \(M_{1}\) and \(M_{2}\). If time complexity of modules \(M_{1}\) and \(M_{2}\) are h(n) and g(n) respectively, the time complexity of the algorithm is
If new item (P=5, W=2) is added to the list, total items is 8 and capacity is 25, then the best-case time of fractional knapsack for this case is __________.
Arrange the following search and sort algorithms in ascending order of their worst-case complexities.
A. Merge sort
B. Linear Search
C. Bubble Sort
D. Binary Search
Choose the correct answer from the options given below:
Choose the correct statement(s)
A. A problem which is NP-Complete will have the property that it can be solved in polynomial time iff all other NP-complete problems can also be solved in polynomial time.
B. All NP-complete problem are NP-hard problems.
C. If an NP-hard problem can be solved in polynomial time, then all NP-complete problem can be solved in polynomial time
D. Not all NP-hard-problems are NP-complete.
Choose the correct answer from the options given below:
Match the LIST-I with LIST-II
| LIST-I Algorithm | LIST-II Complexity |
|---|---|
| A. Insertion Sort | I. O(log n) |
| B. Binary Search | II. O(n2) |
| C. Quick Sort | III. O(n-1) |
| D. Selection Sort | IV. O(n log n) |
Choose the correct answer from the options given below:
Red-black trees are one of many search tree schemes that are “balanced” in order to guarantee that basic dynamic-set operations take ________ time in the worst case.
Arrange the following in ascending order of their average case complexity.
Selection-sort, Quick-sort, Linear search, Binary search
Match the following :
| List – I | List – II | ||
| a. | Bucket sort | i. | \(O(n^3 \lg n)\) |
| b. | Matrix chain multiplication | ii. | \(O(n^3)\) |
| c. | Huffman codes | iii. | \(O(n \lg n)\) |
| d. | All pairs shortest paths | iv. | \(O(n)\) |
Codes :
a b c d
To determine the efficiency of an algorithm the time factor is measured by :
Given the following statements :
\(S_{1}\) : The subgraph-isomorphism problem takes two graphs \(G_{1}\) and \(G_{2}\) and asks whether \(G_{1}\) is a subgraph of \(G_{2}\).
\(S_{2}\) : The set-partition problem takes as input a set S of numbers and asks whether the numbers can be partitioned into two sets A and \(\bar{A} = S - A\) such that
\(\sum_{x \in A} x = \sum_{x \in \bar{A}} x\)
Which of the following is true ?
An algorithm is made up of 2 modules \(M_{1}\) and \(M_{2}\). If time complexity of modules \(M_{1}\) and \(M_{2}\) are h(n) and g(n) respectively, the time complexity of the algorithm is