  To obtain the optimal number of communities is an important problem in
detecting community structure. In this paper, we extend the measurement of
community detecting algorithms to find the optimal community number. Based on
the normalized mutual information index, which has been used as a measure for
similarity of communities, a statistic $\Omega(c)$ is proposed to detect the
optimal number of communities. In general, when $\Omega(c)$ reaches its local
maximum, especially the first one, the corresponding number of communities
\emph{c} is likely to be optimal in community detection. Moreover, the
statistic $\Omega(c)$ can also measure the significance of community structures
in complex networks, which has been paid more attention recently. Numerical and
empirical results show that the index $\Omega(c)$ is effective in both
artificial and real world networks.
