0

What I know (NOT strictly speaking): I know that there is an open question about the equality of P and NP Classes and as long as there is no known algorithm that solves NP problems in P time then we make a distinction about the space-time solvability of such problems. Also, I know that you can make reductions (of polynomial time) between problems, so if you know that a problem belongs to a certain class, then the other problem will also belong to this class. Also, I know that the Simplex algorithm solves problems for linear programming

What I would like to know I would like to know how to "guess" if a problem belongs to NP Class. Does it have to do with the constraints of the problem, the number of constraints, the "type" of constraints?

An example In this link https://www.geeksforgeeks.org/maximum-profit-by-buying-and-selling-a-share-at-most-k-times/ we can see an algortihm that solves "Maximum profit by buying and selling a share at most k times" with dynamic programming.

However, what if we increase the constraints. Let's say that we are limited to a net worth (we don't have unlimited money) or we can buy and sell more than one stock at a time but we are limited to the ammount of stocks we can buy or sell in the given time, or there are multiple stocks of various companies we can choose from but we are limited in the total number of stocks we can have.

How can we know what kind of constraints make the problem harder and harder "moving" it from P to NP Class ? What kind of constraints should a problem have to be sure that this problem certain belongs either to P or NP Class ?

  • `I would like to know how to "guess" if a problem belongs to NP Class.` For this it's enough that the correctness of a solution can be verified in polynomial time. I suggest to give a look at https://cs.stackexchange.com/questions/9556/what-is-the-definition-of-p-np-np-complete-and-np-hard – abc Jan 08 '20 at 21:25

1 Answers1

1

You can prove NP-Hardness of a problem by reducing a problem known to be NP-Hard to the problem at hand. More correctly, you should first formulate the decision problem version of the optimization at hand. Then, reduce a NP-Complete problem to the decision version. By finding a valid reduction, you can prove your optimization problem is NP-Hard. Check out the idea of reduction on: https://www.wikiwand.com/en/Reduction_(complexity)

MWPMC
  • 11
  • 1