Communities
Networks are lumpy. Friends form circles, scientists form fields, web pages form topics. Finding those lumps from the links alone is the art of community detection, and a karate club that split in two became its most famous test.
Look at your own phone contacts and they sort themselves almost by magic: family, school friends, colleagues, the football team. Within each group, many people know each other. Between groups, only a few links cross: you, perhaps, and a couple of others. A community in a network is exactly that: a set of nodes with many links inside and relatively few links to the outside.
Communities need names, so in this chapter only, colours are labels for groups: red, blue and green mean “group 1, 2, 3”, not the book’s usual meanings. Amber still means importance.
What makes a good split?
If you split a network into groups, how do you know the split is good? Counting links inside groups is not enough: putting everybody into one giant group puts every link inside, which tells you nothing. The useful question is whether there are more links inside the groups than you would expect by chance. That comparison has a name: modularity.
Group painter
Click a node to change its group (it cycles through three colours). Try to make the modularity score as high as you can.
Modularity compares each group with a shuffled version of the same network:
The “expected by chance” part matters: a group of very well-connected nodes will catch many links even when links fall at random, so it is only impressive if it catches more than that. Modularity runs from below zero (fewer links inside than chance) up to just under 1; values of roughly 0.3 and above usually signal clear group structure.
A community is a set of nodes with more links among themselves than chance would predict; modularity measures exactly that surplus.
The karate club that split
In the 1970s the anthropologist Wayne Zachary recorded the friendships among 34 members of a university karate club. During his study a conflict broke out between the club’s instructor and its administrator, and the club split in two: members sided with one or the other, and the instructor’s followers formed a new club. Zachary published the friendship network in 1977, and it became a standard test: from the links alone, can you predict who went where?
One simple method is label spreading. Give some nodes a label and let every node repeatedly adopt the label most common among its neighbours, until nothing changes. Communities emerge because labels flow easily inside dense groups and struggle to cross the few links between them.
Label spreading on the karate club
Choose how the labels start, then Step or Play. Shapes show the real outcome: circles joined the instructor, squares stayed with the administrator.
Weak ties and the bridges between groups
The few links that cross between communities are special. In a famous 1973 paper, The Strength of Weak Ties, the sociologist Mark Granovetter argued that acquaintances, not close friends, are often our bridges to other social worlds. Close friends tend to know the same people and the same news you do; an acquaintance from another circle knows things you don’t. In his study of how people found jobs, among people who had found their job through a personal contact, the useful tip more often came from an acquaintance than from a close friend.
Bridges also give a way to find communities. Recall betweenness from Chapter 8: a link between two groups carries every shortest path from one group to the other, so it has high betweenness. In 2002 Michelle Girvan and Mark Newman proposed: cut the link with the highest betweenness, recompute, and repeat. The network falls apart along its seams.
Cut the busiest bridge
Press Cut repeatedly. Link thickness shows betweenness: how many shortest paths each link carries.
Community detection rarely has a single right answer. Different methods can disagree, groups can overlap (you belong to a family and a team), and methods that maximise modularity can even report “communities” in purely random networks. Treat detected groups as a hypothesis to check, not a fact the network has told you.
Intuition check
Someone splits a network into groups and proudly reports that 100% of the links fall inside the groups. Is that a good community split?
What you now see
- A community is a group of nodes with more links inside than chance would predict.
- Modularity scores a split by comparing the share of inside links with a shuffled network; one giant group scores 0.
- Label spreading recovers most of the real split of Zachary’s karate club from friendships alone.
- Links between groups are weak ties and bridges: high in betweenness, rich in new information, and the first to cut when looking for seams.