  Given a family $\mathcal{F}$ of subsets of $[n]$, we say two sets $A, B \in
\mathcal{F}$ are comparable if $A \subset B$ or $B \subset A$. Sperner's
celebrated theorem gives the size of the largest family without any comparable
pairs. This result was later generalised by Kleitman, who gave the minimum
number of comparable pairs appearing in families of a given size.
  In this paper we study a complementary problem posed by Erd\H{o}s and Daykin
and Frankl in the early '80s. They asked for the maximum number of comparable
pairs that can appear in a family of $m$ subsets of $[n]$, a quantity we denote
by $c(n,m)$. We first resolve an old conjecture of Alon and Frankl, showing
that $c(n,m) = o(m^2)$ when $m = n^{\omega(1)} 2^{n/2}$. We also obtain more
accurate bounds for $c(n,m)$ for sparse and dense families, characterise the
extremal constructions for certain values of $m$, and sharpen some other known
results.
