Central to optimization problems, the objective function is the function being optimized. Depending on the problem, the goal can be to maximize (like profits) or minimize (like costs) the objective function. It translates the primary goal of an optimization problem into a mathematical expression.