Part III · Chapter 9

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.

A note on colours in this chapter

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.

Interactive 9.1

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.

One big group scores exactly 0: no better than chance. Random groups score about 0 or below. Colouring the three visible clumps drives the score up, and the network was in fact built with three hidden groups, so you can check your answer. Moving a single node to the “wrong” group usually costs you a little.

Modularity compares each group with a shuffled version of the same network:

modularity = (share of links inside groups) − (share expected if links were shuffled at random) Read aloud: how much more inward-looking are the groups than chance alone would make them, if every node kept its number of links but the links were rewired at random?

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.

Key idea

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.

Interactive 9.2

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.

Labels start with
Starting from just the two leaders, the labels usually settle within a few rounds into two camps that match the real split for all but one or two members, using nothing but who was friends with whom. Restart a few times: the order of updates is random, and occasionally a run goes astray, a useful reminder that these methods are not infallible. The member most often mislabelled, number 9 in Zachary’s list, is one Zachary himself singled out: his friendships leaned towards the administrator’s side, yet he joined the instructor’s club, reportedly because he was only weeks away from his black-belt exam. With “everyone different”, labels merge into a handful of groups, often finer than the two camps.

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.

Interactive 9.3

Cut the busiest bridge

Press Cut repeatedly. Link thickness shows betweenness: how many shortest paths each link carries.

The first links to go are the bridges between clumps, glowing thick and amber, because all traffic between groups must squeeze through them. After a handful of cuts the network splits into its natural groups and the modularity of the split peaks; keep cutting and you start tearing real groups apart, and the score falls.
Careful

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.