abstract:  This article is a brief guide to the field of algorithmic information theory (AIT), its underlying philosophy, and the most important concepts. AIT arises by mixing information theory and computation theory to obtain an objective and absolute notion of information in an individual object, and in so doing gives rise to an objective and robust notion of randomness of individual objects. This is in contrast to classical information theory that is based on random variables and communication, and has no bearing on information and randomness of individual objects. After a brief overview, the major subfields, applications, history, and a map of the field are presented. =-2.5ex
author: **Marcus Hutter**
RSISE$\,$@$\,$ANU and SML$\,$@$\,$NICTA
Canberra, ACT, 0200, Australia
`email@example.com   www.hutter1.net`
date: March 2007
title: ****
  .
  .
  ------------------------------------------------------------------------
  .
  height5pt Algorithmic Information Theory
  \[ a brief non-technical guide to the field \]
  .
  .
  ------------------------------------------------------------------------
  .
  height2pt

# Overview

Algorithmic Information Theory (AIT) is a the [information theory](http://www.scholarpedia.org/article/Information_Theory) of individual objects, using [computer science](http://www.scholarpedia.org/article/Computer_Science), and concerns itself with the relationship between computation, information, and randomness.

The information content or complexity of an object can be measured by the length of its shortest description. For instance the string "0101010101010101010101010101010101010101010101010101010101010101" has the short description "32 repetitions of '01"', while "1100100001100001110111101110110011111010010000100101011110010110" presumable has no simple description other than writing down the string itself. More formally, the [Algorithmic "Kolmogorov" Complexity](http://www.scholarpedia.org/article/Algorithmic_Complexity) (AC) of a string $x$ is defined as the length of the shortest program that computes or outputs $x$, where the program is run on some fixed universal computer.

A closely related notion is the probability that a universal computer outputs some string $x$ when fed with a program chosen at random. This [Algorithmic "Solomonoff" Probability](http://www.scholarpedia.org/article/Algorithmic_Probability) (AP) is key in addressing the old philosophical problem of [induction](http://www.scholarpedia.org/article/Induction) in a formal way.

The major drawback of AC and AP are their incomputability. Time-bounded "Levin" complexity penalizes a slow program by adding the logarithm of its running time to its length. This leads to computable variants of AC and AP, and [Universal "Levin" Search](http://www.scholarpedia.org/article/Universal_Search) (US) that solves all inversion problems in optimal (apart from some huge multiplicative constant) time.

AC and AP also allow a formal and rigorous definition of randomness of individual strings that does not depend on physical or philosophical intuitions about nondeterminism or likelihood. Roughly, a string is [Algorithmically "Martin-Loef" Random](http://www.scholarpedia.org/article/Algorithmic_Randomness) (AR) if it is incompressible in the sense that its algorithmic complexity is equal to its length.

AC, AP, US, and AR are the core subdisciplines of AIT, but AIT spans into many other areas. It serves as the foundation of the [Minimum Description Length](http://www.scholarpedia.org/article/Minimum_Description_Length) (MDL) principle, can simplify proofs in computational complexity theory, has been used to define a universal similarity metric between objects, solves the Maxwell demon problem, and many others.

# Algorithmic "Kolmogorov" Complexity (AC)

[Algorithmic complexity](http://www.scholarpedia.org/article/Algorithmic_Complexity) formalizes the concept of simplicity and complexity. Intuitively, a string is simple if it can be described in a few words, like "the string of one million ones", and is complex if there is no such short description, like for a random string whose shortest description is specifying it bit by bit. Typically one is only interested in descriptions or *codes* that are effective in the sense that decoders are [*algorithms*](http://www.scholarpedia.org/article/Algorithm) on some computer. The universal [Turing machine](http://www.scholarpedia.org/article/Turing_machine) $U$ is the standard abstract model of a general-purpose computer in theoretical computer science. We say that program $p$ is a description of string $x$ if $p$ run on $U$ outputs $x$, and write $U(p)=x$. The length of the shortest description is denoted by $$K(x) := \min_p\{\ell(p): U(p)=x\}$$ where $\ell(p)$ is the length of $p$ measured in bits. One can show that this definition is nearly independent of the choice of $U$ in the sense that $K(x)$ changes by at most an additive constant independent of $x$. The statement and proof of this invariance theorem in is often regarded as the birth of algorithmic information theory. This can be termed Kolmogorov's Thesis: the intuitive notion of 'shortest effective code' in its widest sense is captured by the formal notion of Kolmogorov complexity, and no formal mechanism can yield an essentially shorter code. Note that the shortest code is one for which there is a general decompressor: the Kolmogorov complexity establishes the ultimate limits to how short a file can be compressed by a general purpose compressor.

There are many variants, mainly for technical reasons: The historically first "plain" complexity, the now more important "prefix" complexity, and many others. Most of them coincide within an additive term logarithmic in the length of the string.

In this article we use $K$ for the prefix complexity variant. A [prefix Turing machine](http://www.scholarpedia.org/article/Prefix_Turing_Machine) has a separate input tape which it reads from left-to-right without backing up, a separate worktape on which the computation takes place, and a separate output tape on which the output is written. We define a [halting program](http://www.scholarpedia.org/article/Halting_Program) as the initial segment of the input that is scanned at the time when the machine halts, and the [output](http://www.scholarpedia.org/article/Output) is the string that has been written to the separate output tape at that time. The conditional prefix complexity $$K(x|y):=\min_p\{\ell(p):U(y, p)=x\}$$ is the length of the shortest binary program $p\in\{0,1\}^*$ on a universal prefix Turing machine $U$ with output $x$ and input $y$ . For non-string objects (like numbers $n$, pairs of strings $(x,y)$, or computable functions $f$) one can specify some default coding $\langle\cdot\rangle$ and define $K(\mbox{\it
object}):=K(\langle\mbox{\it object}\rangle)$. The most important properties are:

-   that $K$ is approximable from above in the limit but not computable,

-   the upper bounds $K(x|\ell(x))\leq\ell(x)$ and $K(n)\leq \log n+2\log\log n$,

-   Kraft's inequality implies $\sum_x 2^{-K(x)}\leq 1$,

-   the lower bound $K(x)\geq\ell(x)$ for "most" $x$ and $K(x)\to\infty$ for $\ell(x)\to\infty$,

-   extra information bounds $K(x|y)\leq K(x)\leq K(x,y)$,

-   subadditivity $K(xy)\leq K(x,y)\leq K(y)+K(x|y)$,

-   symmetry of information $K(x,y)=K(x|y,K(y))+K(y)=K(y,x)$,

-   information non-increase $K(f(x))\leq K(x)+K(f)$ for computable functions $f$,

-   and coding relative to a probability distribution (MDL)
    $K(x)\leq -\log P(x)+K(P)$ for computable probability distributions $P$,

where all (in)equalities hold within an additive constant. Furthermore, it shares many properties with Shannon's entropy (information measure), but $K$ has many advantages. The properties above allow us to draw a schematic graph of $K$ as depicted in Figure .

# Algorithmic "Solomonoff" Probability (AP)

Solomonoff (1964) considered the probability that a universal computer outputs some string when fed with a program chosen at random. This Algorithmic "Solomonoff" Probability (AP) is key in addressing the old philosophical problem of induction in a formal way. It is based on

-   [Occam's razor](http://www.scholarpedia.org/article/Occam's_razor) (choose the simplest model consistent with the data),

-   Epicurus' principle of multiple explanations (keep all explanations consistent with the data),

-   Bayes's Rule (transform the a priori distribution to a posterior distribution according to the evidence, experimentally obtained data),

-   (universal) Turing machines (to compute, quantify and assign codes to all quantities of interest), and

-   algorithmic complexity (to define what simplicity/complexity means).

Occam's razor (appropriately interpreted and in compromise with Epicurus' principle of indifference) tells us to assign high/low a priori plausibility to simple/complex strings $x$. Using $K$ as the complexity measure, one could choose any monotone decreasing function of $K$, e.g. $2^{-K(x)}$. The precise definition of [Algorithmic "Solomonoff" Probability](http://www.scholarpedia.org/article/Algorithmic_Probability) (AP), also called universal a priori probability, $M(x)$ is the probability that the output of a (so-called monotone) universal Turing machine $U$ starts with $x$ when provided with fair coin flips on the input tape. Formally, $M$ can be defined as $$M(x) \;:=\; \sum_{p\;:\;U(p)=x*} 2^{-\ell(p)}$$ where the sum is over all (so-called minimal, not necessarily halting, denoted by \*) programs $p$ for which $U$ outputs a string starting with $x$. Since the shortest programs $p$ dominate the sum, $M(x)$ is roughly $2^{-K(x)}$.

$M$ has similar remarkable properties as $K$. Additionally, the predictive distribution $M(x_{n+1}|x_1...x_n):=M(x_1...x_{n+1})/M(x_1...x_n)$ converges rapidly to 1 on (hence predicts) any computable sequence $x_1 x_2 x_3 ...$. It can also be shown that $M$ leads to excellent predictions and decisions in general stochastic environments. If married with sequential [decision theory](http://www.scholarpedia.org/article/Decision_Theory), it leads to an optimal reinforcement learning agent embedded in an arbitrary unknown environment , and a formal definition and test of intelligence.

A formally related quantity is the probability that $U$ halts when provided with fair coin flips on the input tape (i.e. that a random computer program will eventually halt). This halting probability, also known as Chaitin's constant $\Omega$, or 'the number of wisdom' has numerous remarkable mathematical properties, and can be used for instance to quantify Goedel's Incompleteness Theorem.

# Universal "Levin" Search (US)

Consider a problem to solve for which we have two potential algorithms $A$ and $B$, for instance breadth versus depth first search in a finite (game) tree. Much has been written about which algorithm is better under which circumstances. Consider the following alternative very simple solution to the problem: A meta-algorithm $US$ runs $A$ and $B$ in parallel and waits for the first algorithm to halt with the answer. Since $US$ emulates $A$ and $B$ with half-speed, the running time of $US$ is the minimum of $2\times$time$(A)$ and $2\times$time$(B)$, i.e. $US$ is as fast as the faster of the two, apart from a factor of 2. Small factors like 2 are often minor compared to potentially much larger difference in running time of $A$ and $B$.

[Universal "Levin" Search](http://www.scholarpedia.org/article/Universal_Search) (US) extends this idea from two algorithms to *all* algorithms. First, since there are infinitely many algorithms, computation time has to be assigned non-uniformly. The optimal way is that $US$ devotes a time fraction of $2^{-\ell(p)}$ to each (prefix) program $p$. Second, since not all programs solve the problem (some never halt, some just print "Hello World", etc.) $US$ has to verify whether the output is really a solution, and if not discard it and continue.

How does this fit into AIT? A problem of AC $K$ is its incomputability. Time-bounded "Levin" complexity penalizes a slow program by adding the logarithm of its running time to its length: $$Kt(x) \;=\; \min_p \{\ell(p)+\log(\mbox{time}(p)) : U(p)=x \}$$ It is easy to see that $Kt(x)$ is just the logarithm of the running time (without verification) of $US$, and is therefore computable.

While universal search is nice in theory, it is not applicable in this form due to huge hidden multiplicative constants in the running time. Another restriction is that verification needs to be fast. Hutter developed a more general asymptotically fastest algorithm, which removes the multiplicative constant and necessity of verification, unfortunately at the expense of an even larger additive constant. Schmidhuber developed the first practical variants of $US$ by carefully choosing the programming language ($U$), allocating time in $US$ adaptively, designing training sequences of increasing complexity, reusing subroutines from earlier simpler problems, and various other "tricks". He also defined the Speed Prior, which is to $Kt$ what AP is to AC.

# Algorithmic "Martin-Loef" Randomness (AR)

The mathematical formalization of the concept of probability or chance has a long intertwined history. The (now) standard axioms of probability, learned by all students, are due to Kolmogorov (1933).

While mathematically convincing, the semantics is far from clear. Frequentists interpret probabilities as limits of observed relatives frequencies, objectivists think of them as real aspects of the world, subjectivists regard them as one's degree of belief (often elicited from betting ratios), while Cournot only assigns meaning to events of high probability, namely as happening for sure in our world.

None of these approaches answers the question of whether some *specific individual* object or observation, like the binary strings above, is random. Kolmogorov's axioms do not allow one to ask such questions.

Von Mises (1919), with refinements to his approach by Wald (1937), and Church (1940) attempted to formalize the intuitive notion of one string looking more random than another (see the example in the introduction) with partial success. For instance, if the relative frequency of 1s in an infinite sequence does not converge to 1/2 it is clearly non-random, but the reverse is not true: For instance "0101010101..." is not random, since the pair "01" occurs too often. Pseudo-random sequences, like the digits of $\pi$, cause the most difficulties. Unfortunately no sequence can satisfy "all" randomness tests. The Mises-Wald-Church approach seemed satisfactory untill Ville (1939) showed that some sequences are random according to their definition and yet lack certain properties that are universally agreed to be satisfied by random sequences. For example, the relative frequency of '1's in increasingly long initial segments should infinitely often switch from above 1/2 to below 1/2 and vice versa.

Martin-Loef (1966), rather than give a definition and check whether it satisfied all requirements, took the approach to formalize the notion of all effectively testable requirements in the form of tests for randomness. The tests are constructive (namely all and only lower semi-computable) ones, which are typically all one ever cares about. Since the tests are constructed from Turing machines, they can be effectively enumerated according to the effective enumeration of the Turing machines they derive from. Since the set of sequences satisfying a test (having the randomness property the test verifies) has measure one, and there are only countably many tests, the set of sequences satisfying "all" such tests also has measure one. These are the ones called Algorithmic Random\|Algorithmically "Martin-Loef" Random (AR). The theory is developed for both finite strings and infinite sequences. In the latter case the notion of test is more complicated and we speak of sequential tests.

For infinite sequences one can show that these are exactly the sequences which are incompressible in the sense that the algorithmic prefix complexity of every initial segment is at least equal to their length. More precisely, the infinite sequence $$x_1 x_2 x_3... \mbox{ is AR}
  \quad\Longleftrightarrow\quad K(x_1...x_n)\geq n\;\;
  \mbox{for all suff.\ large } n$$ an important result due to G.J. Chaitin and C. Schnorr. This notion makes intuitive sense: A string can be compressed "iff" there are some regularities in the string "iff" the string is non-random.

-   ML-random sequences cannot be effectively constructed. Yet we can give a natural example: The [halting probability](http://en.wikipedia.org/wiki/Halting_Probability), $\Omega$ is a real number between 0 and 1, and the sequence of bits in its binary expansion is an infinite ML-random sequence.

-   Randomness of other objects than strings and sequences can also be defined.

-   Coupling the theory of AR with recursion theory (Downey and Hirschfeldt 2007), we find a hierarchy of notions of randomness, at least if we leave the realm of computability according to Turing. Many variants can be obtained depending on the precise definition of "constructive". In particular "relative randomness" based on (halting) oracle machines leads to a rich field connected to recursion theory.

-   Finally, the crude binary separation of random versus non-random strings can be refined, roughly by considering strings with $K(x_1...x_n)=\alpha n$ for some $0<\alpha<1$. If strings are interpreted as (the expansion of) real numbers, this leads to the notion of constructive or effective Hausdorff (fractal) dimension.

# Applications of AIT

Despite the incomputability of its core concepts, AIT has many, often unexpected, applications.

AIT helps to tackle many philosophical problems in the sense that it allows one to formalize and quantify many intuitive but vague concepts of great importance as we have seen above, and hence allows one to talk about them in a meaningful and rigorous way, thus leading to a deeper understanding than without AIT.

Most importantly, AC formalizes and quantifies the concepts of simplicity and complexity in an essentially unique way. A core scientific paradigm is Occam's razor, usually interpreted as "among two models that describe the data equally well, the simpler one should be preferred." Using AC to quantify "simple" allowed Solomonoff and others to develop their universal theories of induction and action, in the field of [artificial intelligence](http://www.scholarpedia.org/article/Artificial_Intelligence).

AIT is also useful in the foundations of thermodynamic and its second theorem about entropy increase, and in particular for solving the problem of [Maxwell's demon](http://en.wikipedia.org/wiki/Maxwell's_demon).

By (often crudely) approximating the "ideal" concepts, AIT has been applied to various problems of practical interest, e.g. in linguistics and genetics. The principle idea is to replace the universal Turing machine $U$ by more limited "Turing" machines, often adapted to the problem at hand. The major problem is that the approximation accuracy is hard to assess and most theorems in AIT break down.

The universal similarity metric by Vitanyi and others is probably the greatest practical success of AIT: A reasonable definition for the similarity between two objects is how difficult it is to transform them into each other. More formally one could define the similarity between strings $x$ and $y$ as the length of the shortest program that computes $x$ from $y$ (which is $K(x|y)$). Symmetrization and normalization leads to the universal similarity metric. Finally, approximating $K$ by standard compressors like Lempel-Ziv (zip) or bzip(2) leads to the normalized compression distance, which has been used to fully automatically reconstruct language and phytogenetic trees, and many other clustering problems.

See [Applications of AIT](http://www.scholarpedia.org/article/Applications_of_Algorithmic_Information_Theory) for details and references.

In science itself, AIT can constructivize other fields: For instance, statements in Shannon information theory and classical probability theory necessarily only hold in expectation or with high probability. Theorems are typically of the form "there exists a set of measure X for which Y holds", i.e. they are useful for (large) samples. AR on the other hand can construct high-probability sets, and results hold for individual observations/strings. [Hausdorff dimension](http://en.wikipedia.org/wiki/Hausdorff_Dimension) and real numbers also have constructive counterparts.

Naturally, AIT concepts have also been exploited in theoretical computer science itself: AIT, via the incompressibility method, has resolved many open problems in computational complexity theory and mathematics, simplified many proofs, and is important in understanding (dissipationless) reversible computing. It has found applications in Statistics, Cognitive Sciences, Biology, Physics, and Economics.

AIT can also serve as an umbrella theory for other more practical fields, e.g., in machine learning, the Minimum Description Length (MDL) principle can be regarded as a downscaled practical version of AC.

# History, References, Notation, Nomenclature

[Andrey Kolmogorov](http://en.wikipedia.org/wiki/Andrey_Kolmogorov) suggested to define the information content of an object as the length of the shortest program computing a representation of it. [Ray Solomonoff](http://en.wikipedia.org/wiki/Ray_Solomonoff) invented the closely related universal a priori probability distribution and used it for time series forecasting. Together with [Gregory Chaitin](http://en.wikipedia.org/wiki/Gregory_Chaitin) , this initiated the field of algorithmic information theory in the 1960s. [Leonid Levin](http://en.wikipedia.org/wiki/Leonid_Levin) and others significantly contributed to the field in the 1970s (see e.g. ). In particular the prefix complexity and time-bounded complexity are (mainly) due to him.

Li and Vitanyi is the standard AIT textbook. The book by Calude focusses on AC and AR, Hutter on AP and US, and Downey and Hirschfeldt on AR. The at http://www.hutter1.net/ait.htm

contains further references, a list of active researchers, a mailing list, a list of AIT events, and more.

There is still no generally agreed upon notation and nomenclature in the field. One reason is that researchers of different background (mathematicians, logicians, and computer scientists) moved into this field. Another is that many definitions are named after their inventors, but if there are many inventors or one definition is a minor variant of another, things become difficult. This article uses descriptive naming with contributors in quotation marks.

Not even the name of the whole field is generally agreed upon. *Algorithmic Information Theory*, coined by Gregory Chaitin, seems most appropriate, since it is descriptive and impersonal, but the field is also often referred to by the more narrow and personal term *Kolmogorov complexity*.

# Map of the Field

The AIT field may be subdivided into about 4 separate subfields: AC, AP, US, and AR. The fifth item below refers to applications.

-   [Algorithmic "Kolmogorov" Complexity](http://www.scholarpedia.org/article/Algorithmic_Complexity) (AC)

    -   Philosophical considerations

    -   Properties of AC

    -   Plain (Kolmogorov) complexity

    -   Prefix complexity

    -   Resource bounded complexity

    -   Other complexity variants

-   [Algorithmic "Solomonoff" Probability](http://www.scholarpedia.org/article/Algorithmic_Probability) (AP)

    -   Occam's razor and Epicurus' principle

    -   Discrete algorithmic probability

    -   Continuous algorithmic probability = a priori semimeasure

    -   Universal sequence prediction

    -   The halting probability = Chaitin's Omega = The number of Wisdom

-   [Universal "Levin" Search](http://www.scholarpedia.org/article/Universal_Search) (US)

    -   Levin search

    -   Levin complexity and speed prior

    -   Adaptive Levin search

    -   Fastest algorithms for general problems

    -   Optimal ordered problem solver

    -   Goedel machines

-   [Algorithmic "Martin-Loef" Randomness](http://www.scholarpedia.org/article/Algorithmic_Randomness) (AR) / Recursion Theory

    -   Recursion theory

    -   Effective real numbers

    -   Randomness of reals

    -   van Mises-Wald-Church randomness

    -   Martin-Loef randomness

    -   More randomness concepts and relative randomness

    -   Effective Hausdorff Dimension

-   [Applications of AIT](http://www.scholarpedia.org/article/Applications_of_AIT)

    -   Minimum Description/Message Length

    -   Machine Learning

    -   Artificial Intelligence

    -   Computational Complexity

    -   The Incompressibility Method

    -   (Shannon) information theory

    -   Reversible computing

    -   Universal similarity metric

    -   Thermodynamics

    -   Entropy and Maxwell demon

    -   Compression in nature

I would like to thank Paul Vitányi for his help on improving the first draft of this article.


author: Michele Trenti & Piet Hut
title: N-body Simulations

**Gravitational N-body Simulations**

Michele Trenti[^1]

Space Telescope Science Institute, Baltimore, MD, 21210, U.S.

AND

Piet Hut

Institute for Advanced Study, Princeton, NJ, 08540, U.S.

*published in Scholarpedia, 3(5):3930 — accepted May 20, 2008*

**ABSTRACT**

Gravitational *N-body simulations*, that is numerical solutions of the equations of motions for N particles interacting gravitationally, are widely used tools in astrophysics, with applications from few body or solar system like systems all the way up to galactic and cosmological scales. In this article we present a summary review of the field highlighting the main methods for N-body simulations and the astrophysical context in which they are usually applied.

# Introduction

The underlying dynamics relevant in the astrophysical context for of a system of N particles interacting gravitationally is typically Newton's law plus, in case, an external potential field (see however below for a discussion of N-body simulations in general relativity). The force $\vec{F}_i$ acting on particle $i$ of mass $m_i$ is:

$$\label{eq:newton}
\vec{F}_i = - \sum_{j \ne i}  G \frac{m_i m_j (\vec{r}_i-\vec{r}_j)}{|\vec{r_i}-\vec{r_j}|^3 } - \vec{\nabla} \cdot \phi_{ext}(\vec{r}_i),$$

where $G=6.67300 \cdot 10^{-11}$ $m^{3}$ $kg^{-1}$ $s^{-2}$ is the gravitational constant, and $\phi_{ext}$ is the external potential. The problem is thus a set of non-linear second order ordinary differential equations relating the acceleration $\partial^2 \vec{r_i} /
\partial t^2 = \vec{F}_i /m_i$ with the position of all the particles in the system.

Once a set of initial condition is specified (for example the initial positions $\vec{r}_i$ and velocities $\vec{v}_i \equiv
\partial \vec{r}_i / \partial t$ of all particles) it exists a unique solution, analytical only for up to two bodies, while larger N require numerical integration (e.g. see Press et al. 2007). However special care must be employed to ensure both accuracy and efficiency. In fact, the gravitational force (eq. ) presents a singularity when the distance of two particles approaches 0, which can lead to arbitrarily large relative velocities. In addition, given the non-linear nature of the equations, the singularities are movable, that is they depend on the specific choice of initial conditions. In contrast, all singularities in linear ordinary differential equations are independent of initial conditions and thus easier to treat. Therefore constant timestep methods are unable to guarantee a given accuracy in the case of gravitational dynamics and lead to unphysical accelerations during close encounters, which in turn may create unbound stars. A shared adaptive timestep scheme can correctly follow a close encounter, but the price is paid in terms of efficiency as all the other particles of the system are evolved on the timescale of the encounter, which may be several orders of magnitude smaller than the global timescale, resulting essentially in a freezing of the system.

The singularity may be avoided by introducing a smoothing length in Eq.  (e.g. see Aarseth 1963), that is by modifying the gravitational interaction at small scales. For example: $$\vec{F}_i = - \sum_{j \neq i} \frac{G m_i m_j
    (\vec{r}_i - \vec{r}_j)}{(|\vec{r}_i - \vec{r}_j|^2 + \epsilon^2)^{3/2}} ,$$ where $\epsilon > 0$ is the softening, or smoothing length, that is a typical distance below which the gravitational interaction is suppressed. To minimize the force errors and the global impact of the softening for distances larger than $\epsilon$, finite size kernels that ensure continuous derivatives of the force may be employed (e.g., see Dehnen 2001). This strategy effectively suppresses binary formation and strong gravitational interactions, but at the price of altering the dynamics of the system.

The computational complexity of the numerical solution of a N-body system for a fixed number of timesteps scales as $N^2$, as the evaluation of the force on each particle requires to take into account contributions from all other members of the system. For example, considering a single state of the art cpu core (speed $\approx 5$ GFlops), a single force evaluation through a direct method would require about 1 second for a system with $N=10^4$ particles (assuming 10 floating point operations per pair of particles) and more than a week for $N=10^7$.

The arbitrarily large dynamic range in the unsoftened dynamics and the expensive evaluation of the force have led to the development of a wide number of numerical techniques aimed at obtaining a reliable numerical solution with the minimum amount of computational resources, depending on the astrophysical problem of interest. Here we start by discussing the different astrophysical contexts where N-body simulations are routinely employed and we then present the state of the art techniques for these problems.

# Astrophysical domains and timescales

N-body simulations are applied to a wide range of different astrophysical problems so that the most appropriate technique to use depends on the specific context, and in particular on the timescale and collisionality of the problem.

## Timescales, Equilibrium and Collisionality

A system of N particles interacting gravitationally with total mass M and a reference dimension R (for example the radius containing half of the total mass) reaches a dynamic equilibrium state on a timescale comparable to a few times the typical time ($T_{cr}$) needed for a particle to cross the system ($T_{cr} \approx 1/\sqrt{GM/R^3}$). This is the response time needed to settle down to virial equilibrium, that is $2K/|W|=1$, where $K$ is the kinetic energy of the system: $K=1/2
\sum_{i=1,N} m_i |\vec{v}_i|^2$, and W is its potential energy: $W =
- 1/2 \sum_{i \ne j} G m_i m_j /|\vec{r}_i-\vec{r}_j|$ (assuming no external field). If the system is initially out of equilibrium, this is reached through mixing in phase space due to fluctuations of the gravitational potential, a process called violent relaxation (Lynden-Bell 1967).

Once the system is in dynamic equilibrium a long term evolution is possible, driven by two-body relaxation. Energy is slowly exchanged between particles and the system tends to evolve toward thermodynamic equilibrium and energy equipartition. The timescale ($T_{rel}$) for this process depends on the number of particles and on the geometry of the system: $T_{rel} \propto N/log(0.11 N) T_{cr}$ (e.g. see Spitzer 1987). N-body systems such as galaxies and dark matter halos have a relaxation time much longer than the life of the Universe and are thus considered collisionless systems. Smaller systems, such as globular and open clusters, are instead collisional, as the relaxation time is shorter than their age. Two body relaxation is also suppressed when one particle in the system dominates the gravitational potential, such as in the case of solar system dynamics, where planets are essentially quasi-test particles.

Close encounters between three or more particles not only contribute to energy exchange, but can also lead to the formation of bound subsystems (mainly binaries). The formation and evolution of a binary population is best followed through direct, unsoftened, N-body techniques.

A self-gravitating N-body system made of single particles has a negative specific heat, that is it increases its kinetic energy as a result of energy losses (Lynden-Bell & Wood 1968). This is a consequence of the virial theorem and qualitatively it is analogous to the acceleration of a Earth artificial satellite in presence of atmospheric drag. A negative specific heat system is thermodynamically unstable and over the two body relaxation timescale it evolves toward a gravothermal collapse, creating a core-halo structure, where the core progressively increases its concentration, fueling an overall halo expansion. The collapse is eventually halted once three body interactions lead to the formation of binaries. The so called "core collapsed globular clusters" are considered to be formed as a result of this mechanism.

## Mean field approach: the Boltzmann equation

A system of N particles interacting gravitationally defines a 6N+1 dimensional phase space given by the N position and velocity vectors associated to each particle at each time t. The solution of the N-body problem defines a trajectory in this phase space. If the number of particles is large enough, that is if the two body relaxation time is long compared to the time-frame one is interested in, then a statistical description of the problem is possible. This allows us to pass from a 6N+1 to a 6+1 dimension phase space. The idea is to construct a mean field description of the dynamical system in terms of a single particle distribution function $f(\vec{x},\vec{v},t)$, where $f(\vec{x},\vec{v},t) d^3x d^3v$ is proportional to the probability of finding a particle in a 6D element of volume $d^3x d^3v$ centered around position $\vec{r}$ and velocity $\vec{v}$ at time t. Within this simplified framework the knowledge of the distribution function uniquely defines all the properties of the system. The dynamic is described by the collisionless Boltzmann equation, which derives essentially from the Liouville theorem: $$\frac{D f}{D t} = \frac{\partial f}{\partial t} + \vec{v} \cdot \frac{\partial f}{\partial \vec{x}} - \frac{\partial \phi_T}{\partial \vec{x}} \cdot \frac{\partial f}{\partial \vec{v}}= 0,$$ where the total potential field $\phi_T = \phi_{ext}(\vec{x},t)+
\phi(\vec{x},t)$ is the sum of an external potential plus the self-consistent field $\phi(\vec{x},t)$ defined from the distribution function itself through the solution of the Poisson equation: $$\nabla^2 \phi(\vec{x},t) = 4 \pi G  \rho(\vec{r},t),$$ where $\rho(\vec{r},t) = \int f(\vec{x},\vec{v},t) d^3v$.

Given its high dimensionality (6+1), the collisionless Boltzmann equation is usually solved by sampling the initial distribution function and then by evolving the resulting N-body system by means of a numerical method that suppresses two body interactions at small scales. The interaction is softened not only for computational convenience to limit the maximum relative velocity during close encounters but especially to prevent artificial formation of binaries. This is because a simulation particle in a collisionless run represents in reality an ensemble of real particles (e.g. galaxies contain $10^{11}$ stars but simulations typically use only $N \in
[10^6:10^9]$). Note however that two body relaxation is driven by close as well as by distant encounters, so softening does not suppress it. In principle any numerical method that has a small scale softening is appropriate for following collisionless dynamics.

A mean field description for an N-body system is possible also for collisional systems, that is when the relaxation time is comparable to or shorter than the timeframe of interest. In this case the collisionless Boltzmann equation is modified by the introduction of a collision operator $C[f]$ on its right side:

$$\frac{D f}{D t} = \frac{\partial f}{\partial t} + \vec{v} \cdot \frac{\partial f}{\partial \vec{x}} - \frac{\partial \phi_T}{\partial \vec{x}} \cdot \frac{\partial f}{\partial \vec{v}}= C[f].$$

In this framework the operator $C[f]$ describes the probability for particles to enter/leave a phase space element as a result of gravitational encounters. The collision operator C is generally constructed assuming that encounters are:

1.  Markov processes, that is C depends only on the present state of the system;

2.  local, that is only the velocity of the particles are changed and not their positions;

3.  weak, that is the typical velocity change is much smaller than the velocity itself.

Under these assumptions Monte Carlo methods are available to solve the dynamics of the system (see next section). Applications of the collision operator include dynamics of globular clusters and of self-interacting dark matter.

## Mean Field Approach: analogies and differences with fluid dynamics

The velocity moments of the Boltzmann Equation define a set of equations known as the Jeans Equations (e.g. Binney & Tremaine 2007). The first three equations of the set are formally identical to the Navier-Stokes equations for a self-gravitating gas and, like in the fluid-dynamics analogy, express the conservation of mass, momentum and energy. Therefore the numerical algorithms developed to follow the dynamics of N-body systems find a wide application also in the context of fluid-dynamics, with one important example being the Smoothed Particle Hydrodynamics (SPH) method (Gingold & Monaghan 1977). The fundamental difference between the two cases is that the Jeans equations are derived in the limit of a collisionless system, while the Navier-Stokes equations assume a highly collisional system, with the mean free path of a particle approaching zero. For fluids, this leads to the definition of an equation of state, which closes the Navier-Stokes equations. The Jeans Equations are instead an infinite open set, where the *n-th* velocity moment depends on the *n-th+1* moment.

## Astrophysical domains

Based on the previous considerations about collisionality and timescales, four main astrophysical domains for N-body simulations can be identified, each requiring a different numerical technique to guarantee maximum performance and accuracy:

*Celestial mechanics* (solar and extrasolar planetary systems). Here a single body dominates the gravitational field and all the other objects move almost like test particles, subject to reciprocal perturbations. In this framework very high accuracy is required to correctly evaluate the perturbative terms and to avoid being dominated by numerical noise such as time discretization and round-offs errors.

*Dense stellar systems*, such as open clusters and globular clusters. These collisional systems made of components of roughly equal mass present a rich dynamics, with multiple close encounters of stars. The evolution requires to be followed on a relaxation timescale with a correct description of the short range interactions.

*Sphere of influence of a massive BH* at the center of a stellar system. The sphere of influence of a BH is the volume within which the gravity of the BH dominates over that of the other particles. The situation resembles that of solar system dynamics, but here given the very high density of stars two body encounters are frequent, making the problem a difficult hybrid between the two previous cases. In addition, Post Newtonian physics may need to be included if high accuracy is required in the proximity of the BH.

*Galaxy dynamics and cosmology*. Galaxies, and especially dark matter halos, are constituted by a very large number of particles, so that their dynamics can be well described in terms of a mean field. Close encounters are not important and softening is usually employed in these N-body simulations to avoid the unphysical formation of binaries. Within this class, Self-Interacting Dark Matter Particles need a special mention: if dark matter halos are made of Weakly Interacting Massive Particles, then their dynamics can be modified by non-gravitational self-interactions, especially effective at the center of cuspy dark halos. The dynamics of such a system is described by the Collisional Boltzmann Equation, which can be approximately solved using Fokker-Plank methods.

# Newtonian gravity: methods

The history of N-body simulations starts with a pioneering attempt by Holmberg (1941), who followed the evolution of a 37 particle system, where the force was calculated using lightbulbs and galvanometers (taking advantage of the same $r^{-2}$ scaling of electromagnetic and gravitational interactions). Computer simulations started in the early sixties using up to 100 particles (e.g. see von Hoerner 1960 and Aarseth 1963) and had their full bloom in the eighties with the development of fast and efficient algorithms to deal with collisionless systems, such as particle-mesh codes (see Hockney & Eastwood 1988 and references therein) and the tree method (Barnes & Hut 1986). At the same time regularization techniques were developed to deal with close encounters and binary dynamics in the case of direct simulations of a collisional system (e.g. see Aarseth's NBODY-X code series based on KS and chain regularization - Aarseth 2003 and references therein). These algorithm advancements were coupled with tremendous progresses in the hardware, with the cpu speed growing exponentially. In addition to parallelization of serial codes, the field advanced also thanks to special purpose hardware, such as the GRAPE (Makino et al. 1997). Today's (2008) N-body simulations are performed with up to $N=10^5$ (e.g. see Baumgardt & Makino 2003) for direct integration codes over a two-body relaxation timescale and up to $N=10^{10}$ for collisionless dynamics/cosmology (e.g. see the Millennium Run - Springel et al. 2005). In the context of planetary dynamics, self-gravitating systems of disk/ring particles with $N\approx 10^6$ can be followed over hundreds of dynamical times (e.g. Richardson et al. 2000). Major breakthroughs are also expected in the near future thanks both to the next generation GRAPE-DR and to double precision graphic processing units, which provide extremely cost competitive high performance computing capabilities.

## Direct methods

Direct methods do not introduce approximations in the solution of the equations of motions and thus deliver the highest accuracy at the price of the longest computation time, of order $O(N^2)$ per timestep. Integration is performed using adaptive (individual) timesteps and commonly a fourth order Hermite integrator. Close encounters and bound subsystems are treated exactly in terms of Kustaanheimo-Steifel transformations. These essentially consist in transformations of coordinates using a perturbative approach over the analytical two body solution. If more than two particles have a strong mutual interaction, then a chain regularization strategy (Mikkola 1990) can be used, which consists in recasting the problem in terms of a series of separate Kustaanheimo-Steifel interactions. A state of the art, publicly available, serial direct N-body integrator is Aarseth's NBODY6. Even with this specialized software, the number of particles that can be effectively followed for timescales comparable to the Hubble time is limited. For example, if one is interested in the dynamical evolution of globular clusters, currently about $N=20000$ is the practical limit for a serial run, as such a run takes about $1000$ cpu hours. A run with $10^6$ particles carried out for a similar number of relaxation times $T_{rel}$ would require about $10^8$ cpu hours. The algorithm can be parallelized, but in practice load imbalances may saturate the gain in efficiency, so some of the most cpu demanding simulations have been carried out on special purpose hardware, such as the GRAPE, where the chip architecture has been optimized to compute gravitational interactions, thus delivering Teraflops performance.

## Tree codes

The tree code method (Barnes & Hut 1986) provides a fast, general integrator for collisionless systems, when close encounters are not important and where the force contributions from very distant particles does not need to be computed at very high accuracy. In fact, with a tree code, small scale, strong interactions are typically softened (but see McMillan & Aarseth 1993), while the potentials due to distant groups of particles are approximated by multipole expansions about the group centers of mass. The resulting computation time that scale as $O(N log(N))$ but the approximations introduce some (small) errors. The errors in the long-range component of the gravitational acceleration are controlled by a single parameter (the so called opening angle) that determines how small and distant a group of particles must be to use the approximation. This strategy works well to keep the average force error low, but a worst case scenario analysis highlights that unbound errors can arise for rare, but astrophysically reasonable configurations, such as that of the classic "exploding galaxy" (Salmon & Warren 1994). In addition, force errors from the tree code may lead to violation of momentum conservation. Typical implementations of the tree code expand the potentials to quadrupole order and construct a tree hierarchy of particles using a recursive binary splitting algorithm. The tree does not need to be recomputed from scratch at every timestep, saving significant cpu time. Systems with several hundred thousands of collisionless particles can be easily simulated on a GFlops workstation for a Hubble time using this method.

## Fast Multipole Methods

A standard tree code implementation does not take advantage of the fact that nearby particles will be subject to a similar acceleration due to distant groups of particles. The Fast Multipole Method (Greengard & Rokhlin 1987) exploit this idea and uses a multipole expansion to compute the force from a distant source cell within a sink cell. This additional approximation of the gravitational interaction was claimed to reduce the complexity from $O(N log(N))$ to $O(N)$, but the exact scaling seems implementation dependent and has been debated in the literature (e.g. see Dehnen 2000 and references therein). One advantage of the fast multipole method is that the symmetry in the treatment of sink and source cells with respect to the multipole expansion can guarantee an exact conservation of the momentum. Recent successful implementations of fast multipole codes or hybrids with tree code scheme, include Dehnen's Cartesian expansion scheme (the GyrfalcON code- Dehnen 2000) and PKDGRAV (Stadel 2001).

## Particle-mesh codes

The particle mesh method represents another route to speed up direct force evaluation for collisionless systems. In this case the gravitational potential of the system is constructed over a grid starting from the density field and by solving the associated Poisson equation. Particles do not interact directly between each other but only through a mean field. The method essentially softens the gravitational interactions at small scales, that is below the cell length. The density field is constructed using a kernel to split the mass of the particles to the grid cells around the particle position. The simplest choice is to assign all the mass to a single cell, but this leads to significant force fluctuations, which can be reduced using a cloud in cell (8 points) or a triangular shaped cloud (27 points) kernel. The Poisson equation is typically solved using a Fast Fourier Transform, but other grid methods such as successive overrelaxation can also be used - e.g. see Bodenheimer et al. (2007). The deriving force, defined on the grid, is then assigned back to the particles using the same kernel employed for the density field construction, in order to avoid spurious self forces. The method achieves a linear complexity in the number of particles and ($O(N_g log(N_g)$) in the number of grid cells (this latter scaling is that of the FFT method). The price to pay is in terms of short range accuracy as the force is a poor approximation of Newton's law up to several grid spacing of distance.

## Adaptive Mesh Refinement method

The dynamic range of particle-mesh codes can be increased by using an adaptive rather than a static grid to solve the Poisson Equation. In the Adaptive Mesh Refinement (AMR) method the grid elements are concentrated where a higher resolution is needed, for example around the highest density regions. One possibility to obtain an adaptive resolution is to first construct a low-resolution solution of the Poisson Equation and then to progressively refine regions where the local truncation error (estimated through the Richardson extrapolation) is highest. A multigrid structure needs to take into account issues such as matching the solution at the grid interfaces. AMR codes are well suited for cosmological simulations (e.g. see the ENZO code, Bryan & Norman 1998).

## Self consistent field methods

A variant over the Particle Mesh code is the expansion of the density and potential of the system in terms of a basis of orthogonal eigenfunctions. Clutton-Brock (1972) was one of the first to apply this idea in stellar dynamics, while a modern implementation is that of Hernquist & Ostriker (1992). This method guarantees at fixed computational resources a higher accuracy than the tree code and the particle mesh algorithms, provided that the set of basis function is appropriately selected. This limits in practice a general application of the method, which remains however very competitive for the study of the dynamical stability of collisionless systems constructed from distributions functions models.

## P3M and PM-Tree codes

In order to increase the force resolution of particle mesh codes it has been proposed to couple a mean field description on large scales with a direct, softened, treatment of the gravitational interactions on distances of the order of or below a few grid spacing. This method is called $P^3M$ (Hockney & Eastwood 1988): Particle-Particle-Particle-Mesh and efficiently increases the dynamic range of the parent PM algorithm. However in presence of strong clustering a large number of particles will interact directly between each other, slowing down significantly the computation to $O(N^2)$. This problem can be resolved by using adaptive meshes, so that the spatial resolution is refined in regions of high density. Adaptive $P^3M$ codes have a computational cost which scales as $O(N log(N))$, like in a tree code. Finally another possibility is to resort to a tree code for the short range force evaluation leading to a hybrid PM-Tree scheme. These methods are generally extremely well suited for cosmological simulations, for example see Gadget2 (Springel 2005).

## Celestial mechanics codes

Computational Celestial Mechanics refers to a series of methods targeted at studying the dynamics of small N systems ($N \lesssim 20$). The smallest non trivial N is N=3, that is the three body problem, which has many applications ranging from space flight to planets satellite motions and to binary-single stars encounters. Celestial mechanics requires extremely high precision given the chaotic nature of the N-body problem. Numerical methods are based on the use of local system of coordinates, to fight round-off errors in systems with a wide dynamic range, such as in the study of star-planet-satellite problems, as well as on the variational equations formalism and on perturbation theory to take advantage of the analytical, unperturbed motion of planets in the gravitation field of their star (e.g. see Beutler 2005). In this context symplectic integrators are widely used (e.g. see Wisdom & Holman 1991; Leimkuhler & Reich 2005).

# Mean Field Methods

As an alternative to particle based N-body methods, the dynamics of a system of particles interacting gravitationally can be followed by solving the time dependent Boltzmann Equation coupled with the self-consistent Poisson equation.

## Grid based solvers for the Collisionless Boltzmann Equation

This approach can take advantage of standard computational methods developed to solve partial differential equations, such as successive over-relaxation and conjugate gradient methods. However it requires to solve a highly dimensional (6D+time) non-linear system of partial differential equations. In general, the bottleneck is thus the very large amount of memory needed (for example, Terabites just to have a moderate resolution grid with 100 elements in each dimension). However this method is competitive if the astrophysical problem of interest presents symmetries that reduce the number of dimensions needed in the model. For example, in the case of globular cluster dynamics a very good approximation can be obtained via a 3 dimensional model by assuming spherical symmetry in the position space (1D) and radial anisotropy in the velocity space (2D).

## Fokker-Planck and Monte Carlo methods

These methods solve the collisional Boltzmann equation starting from a given distribution function and by following test particles in the six dimensional position-velocity phase space. At each timestep the velocity of the particles is perturbed by random fluctuations accordingly to the assumed form for the collision operator $C[f]$, which depends on computed cross sections for two, three and four body encounters. The complexity of Monte Carlo codes is linear with the number of particles and thus a realistic number of particles can be used for simulations of collisional systems with $N>10^5$ with a serial code. The method is ideal for exploring grids of initial conditions, after proper validation through comparison with direct integration (e.g. see Heggie et al. 2006).

## Beyond Newton: strong gravitational fields

In presence of a strong gravitational field, such as that in the proximity of the event horizon of a black hole, N-body simulations cannot be based on Newtonian physics, but must take into account a general relativity framework. As a numerical solution of the Einstein equation is extremely challenging, Post-Newtonian approximations are used when the gravitational field does not deviate too much from the Newtonian case. Post-Newtonian corrections are typically good enough to treat most astrophysical problems of the dynamics of stars around a black hole. A full general relativity framework is only required to study the merging and gravitational waves emission of two black-holes (e.g. see Baker et al. 2006).

# Hardware

An alternative approach to increase the efficiency of numerical solution of the N-body problem is to optimize the hardware. For direct simulations this approach can be very effective, thanks to the fact that the bottle neck of computation is just the evaluation of the gravitational force, which has a very simple expression. Along this route the GRAPE (GRavityPipE) concept has been extremely effective. The basic idea is to optimize a hardware pipeline to compute $(\vec{r_i}-\vec{r_j})/| \vec{r_i}-\vec{r_j}|^3$. This special purpose hardware can then be interfaced with a general purpose computer, which takes care of all the other numerical operations required to solve the equations of motions. With the GRAPE-6, the largest simulation on a collisional timescale published to date has N=131028 (Baumgardt & Makino 2003).

Another recent promising hardware development is the possibility to use Graphic Cards (GPUs) to carry out the cpu intensive force evaluation. The performance of current generation of GPUs appears to be superior (in terms of Flops/\$ ratio) to that of the GRAPE6 series (Portegies-Zwart et al. 2007) even if one important limitation of GPUs is that they currently operate in single precision.

# Simulation environments

In addition to the availability of stand-alone codes, several software environments have been created that contain various tools to set up initial conditions, run simulations, and analyze and visualize their results. Some examples are NEMO, Starlab, ACS and MUSE (see below for links to their web-pages).

# Suggested readings

## Books

-   "Computer Simulation Using Particles" Hockney, R.W. and Eastwood, J.W. 1988

-   "Gravitational N-Body Simulations: Tools and Algorithms" Aarseth, S. 2003

-   "The Gravitational MillionBody Problem" Heggie, D.C. and Hut, P. 2003

-   "Methods of Celestial Mechanics" Beutler, G. 2005

-   "Numerical Recipes" Press, W.H., Teukolsky, S.A., Vetterling, W.T. and Flannery B.P. 2007

-   "Numerical Methods in Astrophysics: An Introduction" Bodenheimer, P., Laughlin, G.P., Rozyczka, M. and Yorke, H.W. 2007

## Review articles

\* "Simulations of Structure Formation in the Universe" Bertschinger, E. 1998, ARA&A, 36, 599

## Web Material

-   "The N-body Constitution" by Lake, G, Katz, N., Quinn T. and Stadel. J. (http://www-hpcc.astro.washington.edu/old_content/siamhtml/siamhtml.html)

# Open source codes

-   Aarseth's direct integration codes: http://www.ast.cam.ac.uk/s̃verre/web/pages/nbody.htm

-   ACS, a collection of tools and introductory texts: http://www.artcompsci.org/

-   ENZO, a cosmological AMR code: http://lca.ucsd.edu/portal/software/enzo

-   Gadget2, a cosmological PM-tree+SPH code (massively parallel): http://www.mpa-garching.mpg.de/gadget/

-   Mercury (a mixed variable symplectic integrator code for planetary dynamics): http://www.arm.ac.uk/j̃ec/home.html

-   MUSE, a software framework for simulations of dense stellar systems: http://muse.li/

-   NEMO collection (includes particle-grid and tree codes): http://bima.astro.umd.edu/nemo/

-   Starlab (including the direct integration Kira code): http://www.ids.ias.edu/s̃tarlab/starlab.html

# Acknowledgments

We thank Douglas Heggie, Derek Richardson and two anonymous referees for useful comments and suggestions. Further suggestions and comments are very welcome as it is in the spirit of Scholarpedia to keep the articles up-to-date.

# References

1.  Aarseth, S. 1963, MNRAS, 126, 223

2.  Aarseth, S. 2003, "Gravitational N-Body Simulations: Tools and Algorithms", Cambridge University Press

3.  Baker, J.G. et al. 2006, ApJ, 653, 93

4.  Barnes, J.E. and Hut, P. 1986, Nature, 324, 466

5.  Baumgardt, H. and Makino, J. 2003, MNRAS, 340, 227

6.  Beutler G. 2005, "Methods of Celestial Mechanics", Springer

7.  Binney J. & Tremaine S. 1987, "Galactic Dynamics", Princeton University Press

8.  Bodenheimer, P., Laughlin, G.P., Rozyczka, M. and Yorke, H.W. 2007, "Numerical Methods in Astrophysics: An Introduction", Taylor & Francis

9.  Bryan G.L. and Norman, M.L. 1998, ApJ, 495, 80

10. Clutton-Brock, M. 1972, Ap&SS, 16, 101

11. Dehnen, W. 2001, MNRAS, 324, 273

12. Dehnen, W. 2000, ApJL, 536, 39

13. Gingold, R.A. and Monaghan, J.J. 1977, MNRAS, 181, 375

14. Greengard, L. & Rokhlin, V. 1987, J. comput. Phys., 73, 325

15. Heggie, D.C., Trenti, M. and Hut, P. 2006, MNRAS, 368, 677

16. Hernquist, L and Barnes, J.E. 1990, ApJ, 349, 562

17. Hockney, R.W. and Eastwood, J.W. 1988, "Computer Simulation Using Particles", Taylor & Francis

18. Holmberg, E. 1941, ApJ, 94, 385

19. Leimkuhler, B. and Sebastian R. 2005, "Simulating Hamiltonian Dynamics", Cambridge University Press

20. Lynden-Bell, D. 1967, MNRAS, 136, 101

21. Lynden-Bell, D. and Wood, R. 1968, MNRAS, 138, 495

22. Makino, J., Fukushige, T., Koga, M. and Namura, K. 2003, PASJ, 55, 1163

23. Portegies-Zwart, S.F., Belleman, R.G. and Geldof, P.M. 2007, New Astronomy, 12, 641

24. Press, W.H., Teukolsky, S.A., Vetterling, W.T. and Flannery B.P. 2007, "Numerical Recipes", Cambridge University Press

25. Richardson, D.C., Quinn, T., Stadel, J. and Lake, G. 2000, Icarus, 143, 45

26. Salmon J.K. and Warren M.S. 1994, J. Comp. Phys., 111, 136.

27. Spitzer, L. 1987, "Dynamical Evolution of Globular Clusters", Princeton University Press

28. Springel, V. 2005, MNRAS, 364, 1105

29. Springel, V. et al. 2005, Nature, 435, 629

30. Stadel J. 2001, PhD. Thesis, University of Washington

31. von Hoerner, S. 1960, Z. Astrophys. 50, 184

32. Wisdom, J. and Holman, M. 1991, AJ, 102, 1528

[^1]: email@example.com


abstract: Citation networks have been widely used to study the evolution of science through the lenses of the underlying patterns of knowledge flows among academic papers, authors, research sub-fields, and scientific journals. Here we focus on citation networks to cast light on the salience of homophily, namely the principle that similarity breeds connection, for knowledge transfer between papers. To this end, we assess the degree to which citations tend to occur between papers that are concerned with seemingly related topics or research problems. Drawing on a large data set of articles published in the journals of the American Physical Society between 1893 and 2009, we propose a novel method for measuring the similarity between articles through the statistical validation of the overlap between their bibliographies. Results suggest that the probability of a citation made by one article to another is indeed an increasing function of the similarity between the two articles. Our study also enables us to uncover missing citations between pairs of highly related articles, and may thus help identify barriers to effective knowledge flows. By quantifying the proportion of missing citations, we conduct a comparative assessment of distinct journals and research sub-fields in terms of their ability to facilitate or impede the dissemination of knowledge. Findings indicate that Electromagnetism and Interdisciplinary Physics are the two sub-fields in physics with the smallest percentage of missing citations. Moreover, knowledge transfer seems to be more effectively facilitated by journals of wide visibility, such as Physical Review Letters, than by lower-impact ones. Our study has important implications for authors, editors and reviewers of scientific journals, as well as public preprint repositories, as it provides a procedure for recommending relevant yet missing references and properly integrating bibliographies of papers.
author: Valerio Ciotti; Moreno Bonaventura; Vincenzo Nicosia; Pietro Panzarasa; Vito Latora
title: Homophily and missing links in citation networks

# Introduction

Among the broad category of information networks, including the Word Wide Web , email exchange networks , and phone call networks , the networks of citations between academic papers have been widely investigated to uncover patterns and dynamics of knowledge transfer, sharing, and creation in science . The nodes of citation networks are academic papers, each containing a bibliography with references to previously published work. Typically, a directed link is established from one paper to another if the former cites the latter in its bibliography. Because papers can only cite other papers that have already been published, all directed links in citation networks necessarily point backward in time. Citation networks are therefore *directed acyclic graphs*, i.e., they do not contain any closed loops of directed links .

Since the seminal work by Derek de Solla Price on the distribution of citations received by scientific articles , citation networks have extensively been studied to shed light on the mechanisms underpinning the evolution, diffusion, recombination, and sharing of knowledge over time . The reason why citation networks are crucial to understanding and modelling scientific production is clear. Although citations can serve different functions – for instance, they acknowledge the relevance of previous work, they help the reader of a paper to gather additional information about a specific topic, they point to related work or, sometimes, they can also express disagreement with, or level criticism against, a position endorsed in a paper – the number of citations received is generally regarded as an indication of the relevance and quality of a paper as well as of its authors' prestige and scientific success . Certainly, citation networks can be used to reconstruct the communication flows among different scientific communities and infer the relation among different research topics and sub-fields . Recent work on citation networks has indeed proposed a new method for highlighting the role of citations as conduits of knowledge. For instance, Clough et al.   have proposed reduction methods to filter out the relevant citations preserving the causal structure of the underlying network and of knowledge flows.

In this paper, we study citations from a different perspective. First, we assess the extent to which the occurrence of a citation between two papers is driven by the similarity between them. Specifically, we investigate empirically a large data set of articles published in the journals of the American Physical Society (APS) , and we measure the similarity between any two articles by drawing on, and extending, a method originally proposed by Tumminello et al. in Ref.  that enables us to statistically validate the overlap between the bibliographies of the two articles. Results suggest that the number citations made by one article to another is indeed an increasing function of the similarity between the two articles. Our findings thus indicate that the creation of links in citation networks can be seen as governed by *homophily*, namely the principle that similarity breeds connection .

Second, we propose a novel method for identifying missing links in citation networks. The gist of our argument is simple. We focus on pairs of articles characterised by high degrees of similarity; if a citation between them is missing, we regard the lack of a directed link as a signature of a relevant yet unrecorded flow of knowledge in the network. By uncovering pairs of published articles with missing citations, we rank the APS journals and topics according to the incidence of missing data on knowledge flows.

Our method has important implications for the analysis not only of published articles, but also of newly posted preprints on online archives, or of manuscripts submitted to scientific journals. Specifically, our method can be used to suggest interesting work and relevant literature that could, in principle, be included in the bibliography of recently posted or submitted preprints. As we witness a continuously increasing production of preprints and publication of new articles, it has become particularly difficult for authors to keep abreast of scientific developments and relevant works related to the domain of interest. As a result, lack of knowledge of prior or current related work and missing relevant citations may occur quite often. The method presented in this paper can help the scientific community precisely to address this problem. In particular, it can be used not only by authors to integrate the bibliographies of their work, but also by editors of scientific journals to uncover missing citations and identify the appropriate reviewers for the papers they are considering for publication.

The paper is organised as follows. In Section , we introduce and discuss our method for evaluating similarity between articles based on the statistical significance of the overlap between their respective bibliographies. In Section , we apply our method to all articles published in the journals of the APS. We show that citations between articles are positively correlated with their similarity, and we then identify missing links between similar articles published in different fields and in different journals. In Section , we summarise our findings and discuss implications, limitations, and avenues for future work. Finally, in Section , we describe the data set and the validation technique used in our analysis.

# Quantifying similarity between articles

Similarity between two articles can be measured in a number of ways. A straightforward, yet labour-intensive way of comparing articles is to semantically analyse their entire texts. Alternatively, similarity can be simply based on the co-occurence of a few relevant concepts or keywords in the titles or abstracts of the articles. Moreover, similarity can be measured through the co-occurrence of classification codes, such as those included in the Physics and Astronomy Classification Scheme (PACS), which help identify the research areas to which each article belongs . Here, we propose an alternative measure of similarity based on the comparison between the bibliographic lists of references included in two articles. Our hypothesis is that, if two articles are concerned with related aspects of the same discipline or research problem, then their bibliographies will exhibit a substantial overlap. We shall therefore introduce a method for assessing the statistical significance of the overlap between the lists of references of two articles, and we shall then use the statistically validated overlap as as measure of the similarity between the two articles.

## Overlap between reference lists as a measure of similarity between articles

A natural way to quantify the overlap between two given sets $Q_i$ and $Q_j$ is the Jaccard index, which is defined as the ratio between the number of common elements in the two sets and the total number of elements in the union of the two sets: $$J_{ij} = \frac{ |Q_i \cap Q_j|}{|Q_i \cup  Q_j|}.
\label{eq:jacard}$$ Notice that, in general, if two sets share a higher number of elements, then their Jaccard index will increase, and in particular $J_{ij} = 1$ only if $Q_i \equiv Q_j$, while $J_{ij} = 0$ if the two sets do not share any element. An example of the suitability of the Jaccard index for measuring the similarity between the bibliographies of two papers is provided in Fig. (a)-(b). Here the two sets $Q_i$ and $Q_j$ represent, respectively, the articles in the two reference lists of the two articles $i$ and $j$. Since article P1 and article P2 share only one reference over a total of five, their Jaccard index is equal to $0.2$. Conversely, the two articles P3 and P4 in panel (b) have a Jaccard index equal to $1.0$, since the overlap between their reference lists is complete.

However, the use of the Jaccard index has some drawbacks. First, the value of $J_{ij}$ is always bounded from above by $\frac{\min(|Q_i|,
  |Q_j|)}{|Q_i| + |Q_j|}$. This means that if the sizes of the two sets are remarkably different, their similarity is primarily determined by the size of the smallest of the two sets. As a consequence, large sets tend to be characterised by relatively small values of similarities with other smaller sets. In addition to this, the Jaccard index does not distinguish between pairs of identical sets having different sizes. In particular, if we consider two identical sets $(Q_i, Q_j)$ of size $N_1$ and two other identical sets $(Q_m,
Q_n)$ of size $N_2$, then we have $J_{ij} = J_{mn} = 1$, regardless of the values of their sizes $N_1$ and $N_2$. For instance, the Jaccard index of articles P5 and P6 is equal to $1.0$ and is identical to that of articles P3 and P4, even though P3 and P4 share a larger number of references. In the case of bibliographic references, this degeneracy of the Jaccard index is very important. In fact, if we interpret references as proxies for knowledge flows from cited to citing articles, then it would be reasonable to associate a higher value of similarity to a pair of articles that share a large number of references than to a pair sharing only few references, since the former pair is expected to draw on a more similar scientific background. In particular, we would expect the two articles in panel (b) to be assigned a value of similarity larger than the two articles in panel (c).

Another drawback of a bare count of the number of common references is that some citations can, in principle, be more important than others. Consider the two cases depicted in Fig. (d)-(e). In panel (d), articles P7 and P8 have an identical set of references, consisting in the citation of a single highly-cited article. Also in panel (e), both articles P9 and P10 cite the same article. However, in this case the cited article does not receive any citation from other articles. Now, since our aim is to quantify the similarity between articles, a citation to a highly-cited paper, such as a review article, should be considered less relevant than a citation to a more specialised or less visible article, which is cited only by articles concerned with a certain specific topic. In other words, it would be preferable to associate a higher relevance to the single citation shared by articles P9 and P10 in Fig. (e) than to the citation to other highly cited articles shared by articles P7 and P8 in Fig. (d), and thus to conclude that articles P9 and P10 are more similar than article P7 and P8.

## Defining statistically significant bibliographic overlaps

The method we propose here allows us to overcome the drawbacks of the Jaccard index discussed above and illustrated in Fig. . The method is based on an extension of the so-called *Statistically Validated Network (SVN)* approach to the case of directed unipartite graphs. Statistically Validated Networks were introduced by Tumminello et al.  as a method to filter out statistically irrelevant information from bipartite graphs, such as user-item networks deriving from purchase systems or product reviews. In such systems, a set $A$ of nodes (e.g., buyers, users) express preferences over another set $B$ of nodes (e.g., books, movies, services). Those preferences or selections are represented by directed links from nodes in set $A$ to nodes in set $B$. The idea behind SVNs is that the similarity between two nodes $i$ and $j$ in the set $A$ can be expressed in terms of the co-occurrence of their selections of nodes in $B$, and in particular that it is possible to attach a statistical significance, namely a $p$-value, to each set of common selections made by $i$ and $j$.

Citation networks are not bipartite graphs. They are also different from user-item networks because each article in general can only cite other articles that have already been published, and can only receive citations from other articles that will be published after its publication date. Nevertheless, it is possible to draw upon the same idea used to construct bipartite statistically validated networks, and define a similarity between two articles based on the overlap between their reference lists.

Let us consider two sets of nodes, $A$ and $B$. The set $A$ contains all the articles with more than zero outgoing citations, $A = \{ i \in
V \, | \, k_i^{\rm out}>0\}$, while the set $B$ contains all the articles that have received at least two citations, $B = \{ i \in V \,
| \, k_i^{\rm in}>1\}$. It is worth noticing that $A\cap B \neq
\emptyset$, i.e., the two sets may share some articles, since in general each article cites and is cited by other articles. We denote by $N_A = |A|$ and $N_B=|B|$ the cardinality of the two sets. The method associates a statistical significance to the similarity between a pair of nodes $(i,j)$ in $A$ by comparing the number of co-occurrences of citations in their reference lists against the null hypothesis of random co-occurrence of citations to one or more articles in $B$. In this way, the method allows us to identify pairs of nodes in $A$ characterised by overlaps between citations to elements in $B$ which are statistically different from those expected in the null model.

The method works as follows. For each value $k$ of in-degree observed in the citation network, we consider the set of nodes $S^k = S^k_B
\cup S^k_A$, where $S^k_B \subset B$ contains all $N_B^k = |S^k_B|$ articles with in-degree equal to $k$, and $S^k_A \subset A$ contains all articles that cite at least one element in $S^k_B$. Notice that the set $S^k$ is, by construction, homogeneous with respect to the in-degree of the elements belonging to the set $B$. Then, for each pair of articles $i,j\in S_A^{k}$, we indicate by $d_i$ and $d_j$ their respective number of citations directed towards the elements of $S^k_B$. Under the hypothesis that the articles $i$ and $j$ cite, respectively, $d_i$ and $d_j$ distinct elements uniformly at random from $S^k_B$, the probability that they select the same $X$ articles is given by the hypergeometric probability function:

$$\mathcal{P}(X \,| \,N_B^k,d_i ,d_j) = \frac{{{d_i}\choose{X}} {{N_B^k-d_i}\choose{d_j - X}}}{{{N_B^k}\choose{d_j}}}.
\label{hyper}$$ Thus, we can associate a $p$-value to each pair of nodes $i,j\in S_A^{k}$:

$$q_{ij}(k) = 1 - \sum_{X=0}^{N_{ij}^k -1} \mathcal{P}(X \, | \,
N_B^k,d_i,d_j),
\label{eq:p_value}$$ where $N_{ij}^k$ is the measured number of references that $i$ and $j$ have in common in the set $S^k_B$. The $p$-value, $q_{ij}(k)$, is therefore the probability that the number of articles in the set $S^k_B$ that both $i$ and $j$ happen to jointly cite by chance is $N_{ij}^k$ or more. We repeat the procedure for all possible values of in-degree $k$ from $k_{\rm min}$ to $k_{\rm max}$, so that each pair of articles $(i,j)$ is, in general, associated with several $p$-values, one for each value of in-degree $k$ of the articles in their reference lists. Once all the $p$-values have been computed, we set a significance threshold $p^*$ and validate all the pairs of nodes that are associated with a $p$-value smaller than the threshold $p^*$. Given a value of the statistical threshold, only the validated pairs of articles are considered similar at that significance level.

However, because each pair of articles $(i,j)$ can be associated with multiple $p$-values, it is necessary to perform hypothesis-testing multiple times. In this case, if we choose a confidence level or significance threshold $p^*$, say $1\%$ confidence level ($p^*=0.01$), the various $p$-values associated with the same pair of nodes are not compared directly with the chosen significance threshold $p^*$, but with a rescaled threshold that appropriately takes the number of tests performed into account. As a method for multiple testing we use the False Discovery Rate (FDR)  (see Section  for details). Ultimately, we identify the set $\mathcal{M}(p^*)$ of all pairs of nodes whose similarity is statistically significant at the confidence threshold $p^*$. In what follows, we shall denote by $M(p^{*})=\left|\mathcal{M}(p^*)\right|$ the cardinality of such set. In principle, since each pair of articles $(i,j)$ can belong to different sets $S^k$ (and, as a result, can be associated with several $p$-values $q_{ij}(k)$), it would be possible to define a similarity weight $w_{ij}(p^*)$ for each pair $(i,j)$ as the number of times that the pair is validated at the confidence threshold $p^*$. In other words, $w_{ij}(p^*)$ would be the number of sets $S^{k}$ for which $q_{ij}(k)$ passes the statistical test. However, we do not consider this possibility here, but simply assume that a pair of articles $(i,j)$ belongs to the set $\mathcal{M}(p^*)$ if at least one of the $p$-values $q_{ij}(k)$ passes the statistical test at the confidence threshold $p^*$.

Notice that the definition of the $p$-value associated with a pair of articles in terms of the hypergeometric null model provided in Eq.  does not depend on the order in which two articles are assessed. The resulting symmetric value of similarity between any two papers is rooted in the invariance of the hypergeometric distribution in Eq.  under permutation of the pair $i$ and $j$, i.e., of the two quantities $d_i, d_j$. Moreover, Eq.  rectifies some of the problems of measures of similarity based on a bare count of co-occurrences. In particular, two articles that share a small number $N_{ij}^k$ of citations will be assigned a higher $p$-value (i.e., a smaller statistical significance of their similarity) than two articles sharing a large number of citations. This means that, for instance, the $p$-value $q_{P3, P4}(2)$ associated with the pairs of articles $(P3, P4)$ in Fig. (b) will be smaller than the $p$-value $q_{P5,P6}(2)$ associated with the pair of articles $(P5,
P6)$ in Fig. (c), since $P3$ and $P4$ share a larger number of references (namely, four instead of two) to other articles each receiving two citations. Moreover, the $p$-value associated with the pair $(P7, P8)$ will be larger (i.e., the similarity between the pair is less statistically significant) than the $p$-value associated with the pair $(P9, P10)$. The reason lies in the fact that, according to the hypergeometric null-model, the co-occurrence of a reference to a highly-cited article is more likely to take place by chance than the co-occurrence of a reference to an article with a relatively small number of citations.

# Results

We now show how the proposed method for assigning a statistical significance level to the similarity between any pair of articles based on the statistically validated overlap between the respective bibliographies can indeed turn very useful and help uncover important properties of a citation network.

As an example of the possible applications of the method, we analyse the citation network among articles published in the journals of the APS during the period between 1893 and 2009. The data set is described in detail in Section . We shall start by studying empirically the probability $P_{i\to j}(p^*)$ of the occurrence of a citation from an article $i$ to an article $j$ validated at a certain statistical threshold $p^*$. We shall then discuss how the method can be used to identify missing and potentially relevant references and also to rank journals and scientific topics based on the relative occurrence of missing citations.

## Homophily in citation patterns

We start from the observation that if we consider progressively smaller values of the statistical threshold $p^*$, the set $\mathcal{M}(p^*)$ will shrink and contain only pairs of articles characterised by an overlap between bibliographies that is highly significant, since it has passed a more stringent statistical test. Thus, small values of $p^*$ single out pairs of articles that have a highly significant combination of common cited articles. But if two articles share significantly similar bibliographies, then there is a high probability that they are concerned with the same topic or research problem. As a result, it would be reasonable to expect a citation to occur from the more recently published article to the one published at an earlier date. For each value of the statistical threshold $p^*$, we computed the number of pairs of articles $M(p^*)$ validated at that threshold in the APS citation network, and the number $K(p^*)$ of existing citations between those validated pairs. Then, we define the probability $P_{i\to j}(p^*)$ that there exists a citation between any two articles whose similarity is validated at the threshold $p^*$ as: $$P_{i\to j}(p^*) = \frac{K(p^*)}{M(p^*)}.$$

The obtained values of $P_{i\to j}(p^*)$ are reported in Fig.  as a function of $p^*$. The plot clearly suggests that the probability of finding a citation between two articles characterised by a highly statistically significant overlap between the respective reference lists (i.e., the similarity between that pair of articles is validated at a small value of $p^*$) is higher than the probability of finding a citation between articles whose reference lists are only moderately significantly similar. For instance, a citation between a pair of articles $(i,j)$ whose overlap between reference lists is validated at $p^*=10^{-2}$ occurs only with probability $P_{i\to j}\simeq 0.35$, while citations occur within up to $73\%$ of the pairs of articles validated at $p^*=10^{-7}$. In other words, the probability that an article $i$ cites another article $j$ is an increasing function of the similarity between the two articles.

In the social sciences, the principle that similarity breeds connection is traditionally referred to as homophily. This principle has been documented in a variety of empirical domains . It is interesting to observe that homophily can also be found to govern citation networks where it plays an important role in shaping the structure and evolution of knowledge transfer between academic papers.

## Suggesting missing references

The identification of a statistically significant similarity between two articles can be used to uncover potentially missing references. For instance, the implementation of a recommendation procedure based on statistically significant overlaps between bibliographies might be useful to assist the editor of a scientific journal in suggesting a list of possibly relevant (and missing) references to the authors of a submitted paper.

Fig.  shows a typical problem that could be fruitfully addressed through an appropriate reference recommendation system based on the identification of statistically significant overlaps between bibliographies of papers. We report a subgraph of the APS citation network consisting of several pairs of articles validated at $p^{*}=10^{-7}$. Each article is represented as a node, and validated pairs of nodes are connected through a link. The color of each link indicates whether the older article was (green) or was not (red) cited by the more recent one. Note that there is a prevalence of green links, which is consistent with the fact that, for a significance level $p^*=10^{-7}$, a citation between a validated pair of articles occurs in more than $73\%$ of the cases (see Fig. ). However, we notice that article A has a considerable number of missing citations, resulting from the fact that it was not cited by any of the four articles that were published after its publication date and with which it shares a statistically significant portion of its bibliography (namely, nodes C, D, E, F). This could mean that either the authors of articles C-F were not aware of the existence of article A, despite the substantial overlap between their reference lists, or that article A was not particularly relevant to the topics addressed in the other articles.

Surprisingly, a more in-depth analysis of the articles in Fig.  suggests that, not only did all of them appear in the same journal (Physical Review E), but indeed they are all concerned with the same topic (electric discharges) and share a relatively large fraction of PACS codes (05.45.-a, 52.80.Hc). The high degree of similarity between topics can also be easily inferred from the abstracts and introductions of these articles. Interestingly, we found that articles B-F (yellow nodes) were all co-authored by the same research group $G_1$, while article A (the only blue node) was the result of the work of a different research group $G_2$. The fact that also article A does not cite article B suggests that the researchers in group $G_1$ were likely to be unaware of the work conducted by group $G_2$ in the same research field, and vice-versa.

In this particular case, the quantification of statistically significant overlaps between bibliographies could have been used to facilitate the flow of knowledge between different research groups. For instance, the editor of Physical Review E or the selected reviewers could have brought article B to the attention of the authors of article A, and similarly, when articles C-F were submitted to the same journal, the editor or the reviewers could have advised the authors of group $G_2$ to include article A in the bibliographies of their submitted papers.

## Ranking journals and disciplines by (lack of) knowledge flows

So far our analysis has been focused on the whole APS citation network. Physics is a very broad disciplinary area, including sub-fields as diverse as atomic physics, astronomy, particle physics, statistical mechanics, just to mention a few . It is therefore reasonable to perform our analysis of the probability $P_{i\to j}(p^*)$ at the level of sub-fields. Specifically, we argue that the percentage $P_{i\to
  j}(p^*)$ of citations occurring between pairs of articles associated with a similarity that is validated at the statistical threshold $p^*$ can serve as a proxy for the knowledge flows taking place within a sub-field. In what follows we restrict our analysis to the six citation sub-graphs induced by the articles published in each of the six research journals published by APS (in order to quantify the ability of each journal to facilitate or impede the dissemination of knowledge), and to the ten sub-graphs associated with the highest levels in the PACS taxonomy (which could shed light on the typical patterns of knowledge dissemination in different sub-fields). The lack of knowledge flows within a journal or a sub-field at a certain confidence level $p^*$ can be quantified by the fraction of missing links:

$$U(p^*) = 1 - \frac{K(p^*)}{M(p^{*})} = 1 - P_{i\to j}(p^*).$$

In general, the lower the value of $U(p^*)$, the more likely it is that a citation occurs between a pair of articles characterised by a similarity validated at the statistical threshold $p^*$. Fig. (a)-(b) shows how $U(p^*)$ behaves as a function of $p^*$, respectively, for all articles whose main PACS code is either in group 40 (Electromagnetism) or in group 50 (Gases and Plasmas), and for all the articles published in Physical Review Letters and in Physical Review C. The figure clearly shows that, even though in all cases $U(p^*)$ decreases when $p^*\to 0$, different journals and different sub-fields tend to be characterised by slightly different profiles of $U(p^*)$, namely by different propensities to obstruct knowledge flows between similar academic papers. A comparative assessment of journals and sub-fields according to their typical ability to facilitate the dissemination of knowledge would, of course, be based on $\frac{K(p^*)}{M(p^{*})}$. Moreover, the ranking will in general depend on the chosen value of the statistical threshold $p^*$.

From a theoretical point of view, a suitable approach to the ranking would be to compute the quantity:

$$U_{0} = \lim_{p^*\to 0} U(p^*),$$ namely the limiting value of $U(p^*)$ when we let the statistical threshold $p^*$ go to zero. However, this quantity cannot be computed accurately for a finite network, since for a certain value $p^*>0$ the number $M(p^*)$ of validated pairs at $p^*$ will be equal to $0$, and the ratio $\frac{K(p^*)}{M(p^*)}$ would therefore be undetermined. Here we employ a simple workaround, namely we consider the tangent at the curve $U(p^*)$ at the smallest value of $p^*$ for which the number of validated pairs is still large enough for the construction of a network of a reasonable size (we found that $10^{-7}$ is an appropriate choice in our case), and we compute the intercept at which this tangent crosses the vertical axis. The value obtained is denoted as $\widetilde{U}_{0}$, and is used as an approximation of $U_{0}$. The procedure used to determine $\widetilde{U}_{0}$ is sketched in Fig. (c).

In Fig. (d)-(e) we report the ranking induced by $\widetilde{U}_{0}$ respectively for the ten high-level families of PACS codes (panel d) and for the journals published by APS (panel e). It is worth noticing that Electromagnetism and Interdisciplinary Physics are the two sub-fields with the smallest percentage of missing links, i.e., those in which knowledge flows effectively among articles (and authors), as would be expected if the occurrence of citations were driven by overlaps between topics or research problems. Interestingly, the rate of occurrence of missing citations in Physical Review C ($\widetilde{U}_0\simeq 0.27$) is almost nine times as large as the one observed in Physical Review Letters ($\widetilde{U}_0\simeq 0.03$), which is the APS journal with the widest visibility and largest impact.

# Conclusions

In our study we have proposed a novel method for quantifying the similarity between papers based on their bibliographies. The identification of a statistically significant similarity between papers can be used to uncover potentially interesting or relevant references that are missing from their bibliographies. Our method can thus assist the authors of scientific papers in compiling a list of relevant references, or the editors and reviewers of scientific journals in suggesting otherwise neglected references to the authors of manuscripts submitted for publication. Moreover, public preprint repositories, such as arXiv.org, could automatically quantify the similarity between the bibliography of a newly posted paper and the bibliographies of all other papers in their data set, and then propose a list of papers that the authors might find relevant to their work. The implementation of a recommendation procedure based on statistically significant overlaps between bibliographies might also facilitate the dissemination of scientific results within a scientific field. Problems such as the one shown in Fig.  can be aptly overcome through the use of our method that enables missing and relevant references to be promptly identified.

Since our analysis was based on the APS data set, the evaluation of the similarity between any two articles was restricted to the overlap between the citations the two papers made only to other papers published in the APS journals. The assessment of similarity could not therefore reflect the entire bibliographies of the two articles. This limitation can be easily overcome through further analysis of other citation networks extracted from different data sets, such as ISI Web Of Science, or arXiv.org. Moreover, our framework can be extended beyond the domain of citations between academic papers, and used for uncovering missing and potentially relevant links in other citation networks, such as those between patents or between the US Supreme Court verdicts .

# Materials and Methods

## The APS data set

The APS data set includes bibliographic information on all the articles published by the American Physical Society between 1893 and 2009 . The citation graph $G=(V,E)$ includes $|V| = 450,084$ articles, and $|E| = 4,710,547$ directed links. The citations refer only to articles that have been published on APS journals. For each article we extracted the publication date, the main research subject (according to the PACS taxonomy), and its bibliography. Each article belongs to a specific journal. We restrict the analysis to the seven major journals, namely Physics Review A, B, C, D, E and Letter, which are specialised in different sub-fields of physics.

We performed our analysis at three levels, namely the entire citation network, the sub-graphs of the citation network induced by articles in each of the ten main sub-fields of physics, as identified by the highest levels of the PACS hierarchy, and the six sub-graphs induced by articles published in Physical Review Letters and in Physical Review A-E. In our analysis, we discarded articles appeared in Review of Modern Physics, which publishes almost exclusively review articles. In Table  we report the description of the ten main categories in the PACS taxonomy and the topics covered by each of the six journals here considered.

```latex
\begin{table*}[h!]\caption{The scientific domains associated with the PACS codes and journals}
    \begin{tabularx}{\textwidth}{c|X}
    %  \begin{tabular*}{\textwidth}{c|c}
        \hline
            \\
        \textbf{PACS code} &  \textbf{Domain} \\
        \\
        \hline
        \\
        00 & General \\
        10 & The Physics of Elementary Particles and Fields\\
        20 & Nuclear Physics\\
        30 & Atomic and Molecular Physics\\
        40 & Electromagnetism, Optics, Acoustics, Heat Transfer, Classical Mechanics, and Fluid Dynamics \\
        50 & Physics of Gases, Plasmas, and Electric Discharges\\
        60 & Condensed Matter: Structural, Mechanical and Thermal Properties\\
        70 & Condensed Matter: Electronic Structure, Electrical, Magnetic, and Optical Properties \\
        80 & Interdisciplinary Physics and Related Areas of Science and Technology\\
        90 & Geophysics, Astronomy, and Astrophysics\\
        \\
        \hline
        \\
        \textbf{Journal} &  \textbf{Domain}\\
        \\
        \hline
        \\
        Physics Review A & Atomic, molecular, and optical physics\\
        Physics Review B & Condensed matter and materials physics\\
        Physics Review C & Nuclear physics\\
        Physics Review D & Particles, fields, gravitation, and cosmology\\
        Physics Review E & Statistical, non-linear, and soft matter physics\\
        Physics Review Letter & Moving physics forward\\
        \\
        \hline
     % \end{tabular*}
      \end{tabularx}
      \label{MacroPacs}
\end{table*}
```

## False Discovery Rate (FDR) statistical test

The validation of a given pair $(i,j)$ in the FDR method is performed as follows . We set a statistical threshold $p^*$ and we assume that there are in total $N_t$ tests. Then, the $p$-values of different tests are first arranged in increasing order $(q_1 < q_2
<...< q_{N_t})$, and the rescaled threshold is obtained by finding the largest $t_{max}$ such that $$q_{t_{max}} < \frac{p^* t_{max}}{N_t},$$ where $N_t$ is the number of tests. In this specific case, $N_t$ is the number of distinct pairs of papers that are tested over all the sets $S^{k}$ of in-degree classes in the citation network. Then we compare each $p$-value $q_{ij}(k)$ with the rescaled threshold, and we validate the pair $(i,j)$ if $q_{ij}(k) < p^*
\,t_{max} /N_t$.