  Modularity is a widely used measure for evaluating community structure in
networks. The definition of modularity involves a comparison of
within-community edges in the observed network and that number in an equivalent
randomized network. This equivalent randomized network is called the null
model, which serves as a reference. To make the comparison significant, the
null model should characterize some features of the observed network. However,
the null model in the original definition of modularity is unrealistically
mixed, in the sense that any node can be linked to any other node without
preference and only connectivity matters. Thus, it fails to be a good
representation of real-world networks. A common feature of many real-world
networks is "similarity attraction", i.e., edges tend to link to nodes that are
similar to each other. We propose a null model that captures the similarity
attraction feature. This null model enables us to create a framework for
defining a family of Dist-Modularity adapted to various networks, including
networks with additional information on nodes. We demonstrate that
Dist-Modularity is useful in identifying communities at different scales.
