  Consider a team of $k \leq n$ autonomous mobile robots initially placed at a
node of an arbitrary graph $G$ with $n$ nodes. The dispersion problem asks for
a distributed algorithm that allows the robots to reach a configuration in
which each robot is at a distinct node of the graph. If the robots are
anonymous, i.e., they do not have any unique identifiers, then the problem is
not solvable by any deterministic algorithm. However, the problem can be solved
even by anonymous robots if each robot is given access to a fair coin which
they can use to generate random bits. In this setting, it is known that the
robots require $\Omega(\log{\Delta})$ bits of memory to achieve dispersion,
where $\Delta$ is the maximum degree of $G$. On the other hand, the best known
memory upper bound is $min \{\Delta, max\{\log{\Delta}, \log{D}\}\}$ ($D$ =
diameter of $G$), which can be $\omega(\log{\Delta})$, depending on the values
of $\Delta$ and $D$. In this paper, we close this gap by presenting an optimal
algorithm requiring $O(\log{\Delta})$ bits of memory.
