The modularity of a given partition is defined as, where M is the number of modules, L is the total number of connections in the network, is the number of connections between vertices in module s, and is the sum of the degrees of the vertices in modules.