  Common experience suggests that many networks might possess community
structure - division of vertices into groups, with a higher density of edges
within groups than between them. Here we describe a new computer algorithm that
detects structure of this kind. We apply the algorithm to a number of
real-world networks and show that they do indeed possess non-trivial community
structure. We suggest a possible explanation for this structure in the
mechanism of assortative mixing, which is the preferential association of
network vertices with others that are like them in some way. We show by
simulation that this mechanism can indeed account for community structure. We
also look in detail at one particular example of assortative mixing, namely
mixing by vertex degree, in which vertices with similar degree prefer to be
connected to one another. We propose a measure for mixing of this type which we
apply to a variety of networks, and also discuss the implications for network
structure and the formation of a giant component in assortatively mixed
networks.
