0

I'm trying to write a MATLAB algorithm that will resolve the following problem

For some symmetric, positive semi-definite matrix S

minimize (over vector x)  x'*S*x

             subject to     sum(x)==n
                            x(i) is either 1 or 0 for all i
                            n is an integer < the row/column size of S

I'd asked about this question here. Although no answer there satisfies the problem, some of the responses provide me with leads as to how I might answer the question myself. It's been suggested to me that this problem is NP-Hard, but because I have only a CS101 understanding of complexity classes I'm having trouble understanding this.

How can I tell whether this is the case? If it is NP-Hard, should I just give up on trying to find a solution?

Community
  • 1
  • 1
  • Dunno about how the positive semi-definite part affects things, but there's a fairly straightforward reduction from the NP-complete maximum clique problem to the version of your problem where the matrix just has to be symmetric. – user2357112 Nov 22 '15 at 04:31
  • 1
    Note that if it is NP-Hard, you'd *only* need to give up on finding the optimal solution. There are plenty of ways to find good approximate solutions, which can be practically useful even if they aren't the best solutions. – Nuclearman Nov 22 '15 at 04:51

3 Answers3

0

NP-Hard is a way of saying that a problem can not be solvable in polynomial time. So, to give up on this problem, you must prove that your problem can not be solvable in polynomial time. I am really confused about your problem formulation as above since your constraints (1) and (3) basically are the same. In constraint (2), it should be an inequality condition since you want to optimize it, like sum()<=n.

 subject to
      0 <= x(i) <= 1        for all i (1)
      sum(x)==n                       (2) 
      x(i) is either 1 or 0 for all i (3)

If you want to stick with Matlab, Yalmip is one of the options you could consider.

Tung Le
  • 109
  • 1
  • 3
  • 11
0

The problem in question is a general quadratic 0-1 problem, and therefore is NP-hard. A source for this assertion is Pardalos & Jha (1992). I learned of this paper from this answer to a related question I raised.

Pardalos, P. M., & Jha, S. (1992). Complexity of uniqueness and local search in quadratic 0–1 programming. Operations Research Letters, 11(2), 119-123.

Community
  • 1
  • 1
0

When parameterized by n, your problem is W[1]-hard, by reduction from independent set.
That applies even if the entries of S are given in unary.

S ​ ​ ​ ​ ​ ​ ​ = ​ ​ ​ ​ ​ ​ ​ adjacency_matrix ​ ​ ​ + ​ ​ ​ ( number_of_vertices - 1 ) ​ * ​ identity_matrix

By the Gershgorin Circle Theorem, such matrices S are always positive semi-definite.