  We study community detection based on state observations from gossip opinion
dynamics over stochastic block models (SBM). It is assumed that a network is
generated from a two-community SBM where each agent has a community label and
each edge exists with probability depending on its endpoints' labels. A gossip
process then evolves over the sampled network. We propose two algorithms to
detect the communities out of a single trajectory of the process. It is shown
that, when the influence of stubborn agents is small and the link probability
within communities is large, an algorithm based on clustering transient agent
states can achieve almost exact recovery of the communities. That is, the
algorithm can recover all but a vanishing part of community labels with high
probability. In contrast, when the influence of stubborn agents is large,
another algorithm based on clustering time average of agent states can achieve
almost exact recovery. Numerical experiments are given for illustration of the
two algorithms and the theoretical results of the paper.
