Given $X$ the set of all possible solutions, and $A \subseteq X$ the set of admissible solutions; a cost function is defined like this: $f:X \rightarrow R$.

But it is not clear to me what the function intuitively represents (for example, how is it possible that the solutions are only real numbers? Can't they be, say, strings, pairs of numbers, etc?)


We want to measure the quality of a solution, that is given two solutions, $x, y \in A$, I want to tell if $x$ is a better solution than $y$.

Real numbered as an ordered field enable us to compare two solutions conveniently.

For example, for a minimization problem, we can say that $x$ is a better solution than $y$ if $f(x) < f(y)$.

It can carry meaning of operation cost or approximation error, something that you want to minimize.

However, in general, of course, it is possible that you might want to measure something based on different quantity and obtained a tuple instead. You can define own notion of comparison, $<$. For example, we might want to define things to be compared lexicographically. It is possible but for the scope of the text/paper that you read, they might want to study a particular class of problem.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.