  Detecting communities in networks and graphs is an important task across many
disciplines such as statistics, social science and engineering. There are
generally three different kinds of mixing patterns for the case of two
communities: assortative mixing, disassortative mixing and core-periphery
structure. Modularity optimization is a classical way for fitting network
models with communities. However, it can only deal with assortative mixing and
disassortative mixing when the mixing pattern is known and fails to discover
the core-periphery structure. In this paper, we extend modularity in a
strategic way and propose a new framework based on Unified Bigroups Standadized
Edge-count Analysis (UBSea). It can address all the formerly mentioned
community mixing structures. In addition, this new framework is able to
automatically choose the mixing type to fit the networks. Simulation studies
show that the new framework has superb performance in a wide range of settings
under the stochastic block model and the degree-corrected stochastic block
model. We show that the new approach produces consistent estimate of the
communities under a suitable signal-to-noise-ratio condition, for the case of a
block model with two communities, for both undirected and directed networks.
The new method is illustrated through applications to several real-world
datasets.
