We provide an exact analytical solution of the collapse dynamics of
self-gravitating Brownian particles and bacterial populations at zero
temperature. These systems are described by the Smoluchowski-Poisson system or
Keller-Segel model in which the diffusion term is neglected. As a result, the
dynamics is purely deterministic. A cold system undergoes a gravitational
collapse leading to a finite time singularity: the central density increases
and becomes infinite in a finite time t_coll. The evolution continues in the
post collapse regime. A Dirac peak emerges, grows and finally captures all the
mass in a finite time t_end, while the central density excluding the Dirac peak
progressively decreases. Close to the collapse time, the pre and post collapse
evolution is self-similar. Interestingly, if one starts from a parabolic
density profile, one obtains an exact analytical solution that describes the
whole collapse dynamics, from the initial time to the end, and accounts for non
self-similar corrections that were neglected in previous works. Our results
have possible application in different areas including astrophysics,
chemotaxis, colloids and nanoscience