It is not an unconstrained optimization problem. The constraints in which the company operates might result in a feasible region where even the most profitable point is still a net loss.
Those constraints may of course be self-imposed, like e.g. choosing a market to operate in.