HECAP worldwide boards · Topics board

How the topics are made: the Leiden algorithm

The 304 topics of the topics board come from the INSPIRE-HEP citations alone, with no list of fields decided in advance. This page explains, as simply as possible, how a computer finds them and how each paper gets its topic.

1. Papers that cite each other form a topic

Draw every paper as a dot and every citation as a line between two dots (it does not matter who cites whom). The whole of INSPIRE gives 1.87 million dots and 44.3 million lines. Papers on the same subject cite each other much more than they cite papers on other subjects, so the drawing has dense groups with only a few lines between them. A topic is one of those dense groups.

Topic ATopic B few links between
Twelve papers. Ten citations inside each group, only two (dashed) between them: the natural split is the two coloured groups.

With twelve dots the groups can be seen by eye. With 1.87 million they cannot, so the computer needs a score that says how good a split into groups is, and a fast way to find a split with a high score. The Leiden algorithm (Traag, Waltman & van Eck 2019) does both.

2. The score: more links inside than chance would give

Counting the links inside the groups is not enough: putting every paper in one single group would keep every link inside. The score therefore compares the links inside each group with the number of links the group would have by chance, if the same papers, each with the same number of citations, were wired at random. A good topic has many more links inside than chance gives. This score is the modularity of Newman (2006).

Chance gives more links between papers that have many links. A paper with k links meets a group whose papers have K links in all about k × K / (2m) times at random, where m is the number of links in the whole network. So, for one paper, the gain of joining a topic is:

gain = (its links to the topic) − γ × k × K / (2m)

The number γ is the resolution (Reichardt & Bornholdt 2006). It decides how large the topics are: with a large γ the "chance" term weighs more, big groups stop paying off, and the network splits into more, smaller topics. The topics board uses γ = 16, which gives 304 topics of typically a few thousand papers. With γ = 4 there are only 69 topics; with γ = 32, 623.

small γ: one topic larger γ: two topics very large γ: four topics
The resolution γ works like the zoom of a microscope: the same papers form broad fields at low γ and narrow subjects at high γ.

3. How Leiden searches

Trying every possible split is impossible, so Leiden improves a split step by step:

  1. Move. Start with every paper alone. Visit the papers one by one and move each to the neighbouring group where its gain is largest (or leave it where it is). Repeat until no move helps.
  2. Refine. Check that every group is really held together by its own links; a group that is two separate pieces is split. This step is what Leiden adds to the older Louvain algorithm, which could leave such broken groups (Traag, Waltman & van Eck 2019).
  3. Merge. Replace each group by one big dot (its inside links become a loop on the dot, its outside links become thick lines) and go back to step 1 with these dots, so that whole groups can move together.
1. move papers 2. refine: split broken groups no link 3. merge groups into dots loop = links inside
Left: the grey paper is moved to the blue group, where it has more links than chance gives. Middle: a group whose two halves have no link between them is split. Right: each group becomes one dot and the search continues one level up.

The three steps are repeated until the score stops rising. In the end every paper has exactly one topic: the group where, given all the other papers, it adds most to the score. That is its main topic.

4. An example: why Geant4 is not in the LHC topic

The Geant4 simulation toolkit paper (2003) is the most cited paper of the network, with 20,392 citation links. 3,919 of them go to papers of the topic LHC experiments and the Higgs discovery, but only 1,348 to the topic Geant4 and detector simulation. Still, Leiden puts it in the second one. The gain explains why:

TopicGeant4's links thereAll links of the topic's papersExpected by chance (γ = 16)Gain
Geant4 and detector simulation1,348117,958434+914
LHC experiments and the Higgs discovery3,9191,097,7654,038−119
Silicon trackers and LHC detector upgrades360179,020659−299
Geant4 and detector simulation 1,348 links 434 expected LHC experiments and Higgs 3,919 links 4,038 expected Silicon trackers, LHC upgrades 360 links 659 expected
Geant4's links to the topiclinks expected by chance (γ = 16)
Only in its own topic does Geant4 have far more links than chance gives (three times more). With the LHC topic it has about the number chance predicts.

The board also gives each paper a second and third topic: the other topics with most links, scored as their links divided by the links to the main topic (at most 1). That score counts raw links, with no correction for chance, so a widely used tool such as Geant4 gets a second topic with score 1 (the LHC topic), while Leiden's gain for it is about zero.

5. What the topics board does exactly

References