  In the framework of homogeneous susceptible-infected-recovered (SIR) models,
we use a control theory approach to identify optimal pandemic mitigation
strategies. We derive rather general conditions for reaching herd immunity
while minimizing the costs incurred by the introduction of societal control
measures (such as closing schools, social distancing, lockdowns, etc.), under
the constraint that the infected fraction of the population does never exceed a
certain maximum corresponding to public health system capacity. Optimality is
derived and verified by variational and numerical methods for a number of model
cost functions. The effects of immune response decay after recovery are taken
into account and discussed in terms of the feasibility of strategies based on
herd immunity.
