  We develop a biased Monte Carlo algorithm to measure probabilities of rare
events in cluster-cluster aggregation for arbitrary collision kernels. Given a
trajectory with a fixed number of collisions, the algorithm modifies both the
waiting times between collisions, as well as the sequence of collisions, using
local moves. We show that the algorithm is ergodic by giving a protocol that
transforms an arbitrary trajectory to a standard trajectory using valid Monte
Carlo moves. The algorithm can sample rare events with probabilities of the
order of $10^{-40}$ and lower. The algorithm's effectiveness in sampling
low-probability events is established by showing that the numerical results for
the large deviation function of constant-kernel aggregation reproduce the exact
results. It is shown that the algorithm can obtain the large deviation
functions for other kernels, including gelling ones, as well as the instanton
trajectories for atypical times. The dependence of the autocorrelation times,
both temporal and configurational, on the different parameters of the algorithm
is also characterized.
