  Global strategies to contain a pandemic, such as social distancing and
protective measures, are designed to reduce the overall transmission rate
between individuals. Despite such measures, essential institutions, including
hospitals, schools, and food producing plants, remain focal points of local
outbreaks. Here we develop a model for the stochastic outbreak dynamics in such
local communities. We derive analytical expressions for the probability of
containment of the outbreak, which is complementary to the probability of
seeding a deterministically growing epidemic. This probability depends on the
statistics of the intra-community contact network and the initial conditions,
in particular, on the contact degree of patient zero. Based on this model, we
suggest surveillance protocols by which individuals are tested proportionally
to their degree in the contact network. We characterize the efficacy of
contact-based protocols as a function of the epidemiological and the contact
network parameters, and show numerically that such protocols outperform random
testing.
