  Photonic structures with high-$Q$ resonances are essential for many practical
applications, and they can be relatively easily realized by modifying ideal
structures with bound states in the continuum (BICs). When an ideal photonic
structure with a BIC is perturbed, the BIC may be destroyed (becomes a resonant
state) or may continue to exist with a slightly different frequency and a
slightly different wavevector (if appropriate). Some BICs are robust against
certain structural perturbations, but most BICs are nonrobust. Recent studies
suggest that a nonnegative integer $n$ can be defined for any generic
nondegenerate BIC with respect to a properly defined set of structural
perturbations. The integer $n$ is the minimum number of tunable parameters
needed to preserve the BIC for perturbations arbitrarily chosen from the set.
Robust and nonrobust BICs have $n=0$ and $n\ge 1$, respectively. A larger $n$
implies that the BIC is more difficult to find. If a structure is given by $m$
real parameters, the integer $n$ is the codimension of a geometric object
formed by the parameter values at which the BIC exists in the $m$-dimensional
parameter space. In this paper, we suggest a formula for $n$, give some
justification for the general case, calculate $n$ for different types of BICs
in two-dimensional structures with a single periodic direction, and illustrate
the results by numerical examples. Our study improves the theoretical
understanding on BICs and provides useful guidance to their practical
applications.
