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.
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.
3. How Leiden searches
Trying every possible split is impossible, so Leiden improves a split step by step:
- 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.
- 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).
- 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.
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:
| Topic | Geant4's links there | All links of the topic's papers | Expected by chance (γ = 16) | Gain |
|---|---|---|---|---|
| Geant4 and detector simulation | 1,348 | 117,958 | 434 | +914 |
| LHC experiments and the Higgs discovery | 3,919 | 1,097,765 | 4,038 | −119 |
| Silicon trackers and LHC detector upgrades | 360 | 179,020 | 659 | −299 |
- The LHC topic is huge: its papers carry about 1.1 million links, nine times those of the simulation topic. Almost every LHC paper cites Geant4, the way it cites the Review of Particle Physics, so 3,919 links is just what chance gives to a paper with 20,392 links.
- The detector-simulation papers cite Geant4 three times more than chance, and cite each other around it: they are about Geant4. That excess is what makes a topic, and the topic is built around this paper.
- The resolution matters. With γ = 1 the expected numbers are 16 times smaller (27, 252 and 41 links) and, if the topics stayed the same, the LHC topic would give a gain of 3,667 against 1,321, and Geant4 would join the LHC topic. At the resolution of the board, the fine subject wins over the big field.
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
- Network: all 1,872,221 papers of the tables, every author count; a line for each citation between two of them, 44.3 million once each pair is counted once.
- Topics: Leiden with the score above, γ = 16, repeated until the score stops rising (at most 20 rounds). Groups under 100 papers join the topic they share most links with. The 288,870 papers with no citation link to another paper of the tables get no topic.
- Areas: Leiden again, on the network of the 304 topics (each topic a dot), with γ = 0.3: 6 areas, from particle physics to accelerator physics.
- Stability: Leiden visits the papers in a random order, so four runs (seeds) were made; they agree on most topics, and the board uses the most typical one. The names were written by hand from each topic's most cited papers, arXiv categories and journals.
- Code:
reproduce/topics/(cluster.pyruns Leiden with igraph). The same approach, direct citations clustered with Leiden (Waltman & van Eck 2012), is the one CWTS at Leiden University used to build the clusters behind the OpenAlex topics (OpenAlex, “Topics”; van Eck & Waltman 2024), but nothing here is taken from OpenAlex or any other classification.
References
- V. A. Traag, L. Waltman, N. J. van Eck, "From Louvain to Leiden: guaranteeing well-connected communities", Scientific Reports 9, 5233 (2019). doi:10.1038/s41598-019-41695-z
- L. Waltman, N. J. van Eck, "A new methodology for constructing a publication-level classification system of science", JASIST 63, 2378 (2012). doi:10.1002/asi.22748
- OpenAlex, “Topics”, OpenAlex help center (official documentation of the OpenAlex topic classification, developed with CWTS at Leiden University). help.openalex.org/hc/en-us/articles/24736129405719-Topics
- N. J. van Eck, L. Waltman, “An open approach for classifying research publications”, Leiden Madtrics, CWTS, 24 January 2024. leidenmadtrics.nl; data: N. J. van Eck, “Classification of research publications based on data from OpenAlex”, Zenodo (2024), doi:10.5281/zenodo.10560276
- J. Reichardt, S. Bornholdt, "Statistical mechanics of community detection", Phys. Rev. E 74, 016110 (2006). doi:10.1103/PhysRevE.74.016110
- M. E. J. Newman, "Modularity and community structure in networks", PNAS 103, 8577 (2006). doi:10.1073/pnas.0601602103