Explain how you would structure an optimization function to solve a resource allocation problem under strict operational constraints.