  We study almost Dedekind domains with respect to the failure of ideals to
have radical factorization, that is, we study how to measure how far an almost
Dedekind domain is from being an SP-domain. To do so, we consider the maximal
space $\mathcal{M}=\mathrm{Max}(R)$ of an almost Dedekind domain $R$,
interpreting its (fractional) ideals as maps from $\mathcal{M}$ to
$\mathbb{Z}$, and looking at the continuity of these maps when $\mathcal{M}$ is
endowed with the inverse topology and $\mathbb{Z}$ with the discrete topology.
We generalize the concept of critical ideals by introducing a well-ordered
chain of closed subsets of $\mathcal{M}$ (of which the set of critical ideals
is the first step) and use it to define the class of \emph{SP-scattered
domains}, which includes the almost Dedekind domains such that $\mathcal{M}$ is
scattered and, in particular, the almost Dedekind domains such that
$\mathcal{M}$ is countable. We show that for this class of rings the group
$\mathrm{Inv}(R)$ is free by expressing it as a direct sum of groups of
continuous maps, and that, for every length function $\ell$ on $R$ and every
ideal $I$ of $R$, the length of $R/I$ is equal to the length of
$R/\mathrm{rad}(I)$.
