# Can optimization version problem whose decision version is NP-complete be solved in poly-time iff P=NP?

I have proved the decision version of my problem be $$\mathcal{NP}$$-complete. And I know that if I can solve the optimization version in poly-time, then I can just to compare the obtained minimum (or maximum) with target value in decision version. Thus, the decision version can be solved in poly-time as well. Since the decision version is $$\mathcal{NP}$$-hard, so is the optimization version, i.e., the optimization version is $$\mathcal{NP}$$-hard.

My question is how to prove the converse direction: if the decision version can be solved in poly-time, can the optimization version be solved in poly-time as well?

You can make a polynomial number of calls to your solver for the NP-complete problem to find the optimal solution. E.g., for the travelling salesman problem you would perform a binary search with a series of queries asking whether there is a tour with some cost $$c$$, gradually adjusting $$c$$ and bracketing the solution space until you have the optimal solution.