0

I want to summarize some problem on Complexity. Which of them can be solved in poly-time?

I) finding maximal sub complete graph of given graph = Clique Problem

II) select some elements among n objects in which value and weights are given, such that sum of weights of selected elements is not bigger than an specific bound and sum of value being maximum

III) finding all cycles of a graph

IV) Finding a path that visit each vertex exactly once = Determine a graph is Hamiltonian

I think IV is Hamiltonian path that is NP-Complete, III is NP-Hard and NP-Complete, II is NP-Complete, and I is NP-Complete. so 0 of these solved in poly-time.

Who can more clearer me about NP-Hard and NP-Complete of these problem in a nice way? Am I right?

2 Answers2

1

As you've noted, parts (1), (2), and (4) are all famous NP-hard problems (max clique, knapsack, and Hamiltonian path). These problems are not in NP, though, because NP consists of decision problems (questions for which the answer is either "yes" or "no") and these are not decision problems.

Part (3) is more nuanced. This problem is a counting problem - the goal is to determine how many objects of some type exist - rather than a decision problem, so it can't be in NP. To the best of my knowledge, it's not really known how hard this problem is. It's known that if it can be solved in polynomial time, then P = NP (see this link for details), and the specific proof shows that it's NP-hard as well.

If P ≠ NP, then none of these can be solved in polynomial time. If any of these can be solved in polynomial time, then P = NP. They are all NP-hard.

Hope this helps!

templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
  • Challenging question, would you clarify which one is NP-Complete which NP and which NP-HARD? –  Apr 07 '15 at 20:31
  • @user4249446 None of these are NP-complete, since none of them are in NP (NP consists of decision problems, which ask yes/no questions, and all of these problems ask for some object instead of a yes/no question). Therefore, it's not possible for any of them to be NP-complete, since for a problem to be NP-complete it has to belong to NP. They are all NP-hard, though. – templatetypedef Apr 07 '15 at 23:59
  • decision version of Knapsack 0/1 is NP-HARD? G has a Hamilton cycle =G has a Hamilton path = NP-Complete? am I right ? –  Apr 08 '15 at 06:23
  • @user4249446 The decision versions of Q1, Q2, and Q4 are all in NP and NP-hard, so yes, they're NP-complete. I'm not sure whether the decision version of (3) is in NP, since I can't see how you'd verify the answer in polynomial time. – templatetypedef Apr 08 '15 at 15:15
  • Decision Version of Knapsack is NP-Hard not NP compete? am I Wrong ? –  Apr 08 '15 at 15:45
  • @user4249446 That's incorrect. The decision problem version of knapsack is in NP and NP-hard, so by definition it's NP-complete. – templatetypedef Apr 08 '15 at 16:55
  • While true and useful information that (1), (2) and (4) are not in NP, I would like to add that in the context of NP-hardness, people usually talk about the decision version of optimization problems. – G. Bach Apr 08 '15 at 17:04
0

Because I got asked about a reference, I am posting my comment as the answer:

II) select some elements among n objects in which value and weights are given, such that sum of weights of selected elements is not bigger than an specific bound and sum of value being maximum

This is a knapsack problem which is poly-time if weights are not a part of input size, i.e the solution is polynomial in terms of n only.

It runs in O(n * W) where W is the maximum allowed weight. Of course this can be not polynomial if W is related to n, for example if W = 2^n.

You can read about it here:

http://en.wikipedia.org/wiki/Knapsack_problem#Dynamic_programming_in_advance_algorithm

http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/Dynamic/knapsackdyn.htm

pkacprzak
  • 5,537
  • 1
  • 17
  • 37