In the other extreme case, where all nodes are in the same community, δ(ci, cj) is always 1. So the modularity is as follows:
Q = 1/(2m) * Σij [ Aij - kikj / (2m)]
The sum over all pairs of nodes of the Aij term corresponds to the sum of the weights of all edges, counted twice (for ij and ji pairs). So, we have the following:
Σij Aij = 2m
Let's rewrite the second term of the equation:
Σij kikj / (2m) = Σi (ki (Σj kj )) / 2m = Σi (ki (2m) / 2m = Σi ki = 2m
So, in the special case where all nodes are in the same community, then the modularity Q=0.