edited by
388 views
0 votes
0 votes
I just want to confirm whether all optimization problems are in NP or not say to find the shortest path this can be done in polynomial time and If I am given a graph and I have to find whether there exists any path between 2 vertices of length K so after calculating shortest path I can check whether path exists so that means I can do it in polynomial time but in general given a graph and If I have to find whether path exists or not ,its an NPC problem ,so is it that the optimization version of a problem is polynomial solvable and its similar decision version is NP.
edited by

1 Answer

0 votes
0 votes

not all optimization problem are in p,np. some are NP hard like longest path e.t.c.

what u have to understand -

DECISION PROBLEM ARE EASIER THAN SOLVING OPTIMIZATION PROBLEM.

i.e. a function is computable only when it is decidable.

decision problem are the problem which have answer in yes or no form

see this theory and u may understand.-

we convert our optimization problem into decision problem so that it can become easy.

Take for example the Halting Problem of a Turing Machine, suppose someone asked you after how many steps the Turing Machine will halt on a given input. To answer the exact number you first have to answer whether the Turing Machine is going to halt or not. Then i may count the steps.
What we do is to convert our optimization problem to a decision problem. And if we are not able to give answer of that decision problem we cannot compute it. So, computing is harder than saying yes or no. So if the problem is undecidable then it will be also non computable.
so now u may understand where u are wrong if u can solve it in polynomial time definitely the decision problem will be solved in polynomial time.

Related questions