  Community detection is a fundamental problem in complex network data
analysis. Though many methods have been proposed, most existing methods require
the number of communities to be the known parameter, which is not in practice.
In this paper, we propose a novel goodness-of-fit test for the stochastic block
model. The test statistic is based on the linear spectral of the adjacency
matrix. Under the null hypothesis, we prove that the linear spectral statistic
converges in distribution to $N(0,1)$. Some recent results in generalized
Wigner matrices are used to prove the main theorems. Numerical experiments and
real world data examples illustrate that our proposed linear spectral statistic
has good performance.
