NetLogo 7.0.0-beta2:

nw:modularity

nw:modularity

Modularity is a measurement of community structure in the network. It is defined based on the number of in-community links versus the number of between-community links. This primitive takes as input a list of agentsets, where each of the agentsets is one the communities that you’re separating the network into.

This measurement works on undirected, directed, and mixed-directedness networks. In the case of mixed-directedness, undirected links are treated essentially the same as two opposing directed links. It does not take weight into account.

Example:

Take me to the full Networks Extension Dictionary