I just read this definition for the longest path problem:
LONGEST PATH
Input: A graph $G=(V,E)$, an integer $k$.
Question: Is there a path with at least $k$ vertices in $G$
This seems a decision problem and a certificate can be verified easily. But, what is the usage of such a problem? Isn't the main concern finding the longest path in the graph? I guess that would be an optimization problem, and verifying a given certificate can't be done in polynomial time, so that is not $NP$. right?
If yes, then what is the usage of the decision problem (which is $NP$) and what is its relation to the main problem?
My question is different from "NP-complete" optimization problems because I also asked about the relationship between a decision problem and a relevant optimization problem, and how a decision problem may help us in solving the optimization problem, and basically what is their usage in such cases.