-1

Help is needed, I've tried to solve it by myself but I could find any reasonable solution which is solid enough. this is what I've wrote:

Consider a 0-1 ILP, where each variable x1,x2...,xn can assume values 0 or 1. The number of constraints is m.

We can choose all possible 2n assignments of x1, x2...xn in non-deterministic manner.

Checking the feasibility of each assignment takes O(nm) time, and Computing the value of the objective function for each feasible assignment takes O(n) time Since a nondeterministic manner considers all assignments simultaneously. Thus, we have a non-deterministic polynomial time.

Due to Karp

Please provide a better solution

Dvir
  • 131
  • 5

1 Answers1

0

As stated in the comments, you can show that a problem is in NP by demonstrating the existence of a polynomial time verifier. In this case, such a verifier would be provided the values of $x_1, x_2, \dots, x_n$, and would need to answer the question "do these values of $x_1, \dots, x_n$ form a solution"? In this case, all you need to do is check that all $m$ contraints are satisfied.

theyaoster
  • 399
  • 1
  • 6