We study the vertex classification problem on a graph whose vertices are in k (k >= 2) different communities, edges are only allowed between distinct communities, and the number of vertices in different communities are not necessarily equal. The observation is a weighted adjacency matrix, perturbed by a scalar multiple of the Gaussian Orthogonal Ensemble (GOE), or Gaussian Unitary Ensemble (GUE) matrix. For the exact recovery of the maximum likelihood estimation (MLE) with various weighted adjacency matrices, we prove sharp thresholds of the intensity sigma of the Gaussian perturbation. Roughly speaking, when sigma is below (resp. above) the threshold, exact recovery of MLE occurs with probability tending to 1 (resp. 0) as the size of the graph goes to infinity. These weighted adjacency matrices may be considered as natural models for the electric network. Surprisingly, these thresholds of sigma do not depend on whether the sample space forMLE is restricted to such classifications that the number of vertices in each group is equal to the true value. In contrast to the Z(2)-synchronization, a new complex version of the semi-definite programming (SDP) is designed to efficiently implement the community detection problem when the number of communities k is greater than 2, and a common region (independent of k) for sigma such that SDP exactly recovers the true classification is obtained.