  The aim of the paper is to reduce one spectral optimization problem, which
involves the minimization of the decay rate $|\mathrm{Im} \, k |$ of a
resonance $k$, to a collection of optimal control problems on the Riemann
sphere $\widehat{\mathbb{C}}$. This reduction allows us to apply methods of
extremal synthesis to the structural optimization of layered optical cavities.
We start from a dual problem of minimization of the resonator length and give
several reformulations of this problem that involve Pareto optimization of the
modulus $|k|$ of a resonance, a minimum-time control problem on
$\widehat{\mathbb{C}}$, and associated Hamilton-Jacobi-Bellman equations.
Various types of controllability properties are studied in connection with the
existence of optimizers and with the relationship between the Pareto optimal
frontiers of minimal decay and minimal modulus. We give explicit examples of
optimal resonances and describe qualitatively properties of the Pareto
frontiers near them. A special representation of bang-bang controlled
trajectories is combined with the analysis of extremals to obtain various
bounds on optimal widths of layers. We propose a new method of computation of
optimal symmetric resonators based on minimum-time control and compute with
high accuracy several Pareto optimal frontiers and high-Q resonators.
