Hostname: page-component-74656f9884-c52kr Total loading time: 0 Render date: 2026-11-09T04:47:40.571Z Has data issue: false hasContentIssue false

Randomized near-neighbor graphs, giant components and applications in data science

Published online by Cambridge University Press:  16 July 2020

Ariel Jaffe*
Affiliation:
Yale University
Yuval Kluger*
Affiliation:
Yale University
George C. Linderman*
Affiliation:
Yale University
Gal Mishne*
Affiliation:
Yale University
Stefan Steinerberger*
Affiliation:
Yale University
*
*Postal address: Program in Applied Mathematics, Yale University, New Haven, CT 06511, USA. Email address: a.jaffe@yale.edu; george.linderman@yale.edu
**Postal address: Department of Pathology and Applied Mathematics, Yale University, New Haven, CT 06511, USA. Email address: yuval.kluger@yale.edu
*Postal address: Program in Applied Mathematics, Yale University, New Haven, CT 06511, USA. Email address: a.jaffe@yale.edu; george.linderman@yale.edu
*Postal address: Program in Applied Mathematics, Yale University, New Haven, CT 06511, USA. Email address: a.jaffe@yale.edu; george.linderman@yale.edu
***Postal address: Halicioğlu Data Science Institute, UC San Diego, La Jolla, CA 92093, USA. Email address: gmishne@ucsd.edu
Rights & Permissions [Opens in a new window]

Abstract

If we pick n random points uniformly in $[0,1]^d$ and connect each point to its $c_d \log{n}$ nearest neighbors, where $d\ge 2$ is the dimension and $c_d$ is a constant depending on the dimension, then it is well known that the graph is connected with high probability. We prove that it suffices to connect every point to $ c_{d,1} \log{\log{n}}$ points chosen randomly among its $ c_{d,2} \log{n}$ nearest neighbors to ensure a giant component of size $n - o(n)$ with high probability. This construction yields a much sparser random graph with $\sim n \log\log{n}$ instead of $\sim n \log{n}$ edges that has comparable connectivity properties. This result has non-trivial implications for problems in data science where an affinity matrix is constructed: instead of connecting each point to its k nearest neighbors, one can often pick $k'\ll k$ random points out of the k nearest neighbors and only connect to those without sacrificing quality of results. This approach can simplify and accelerate computation; we illustrate this with experimental results in spectral clustering of large-scale datasets.

Information

Type
Research Papers
Copyright
© Applied Probability Trust 2020
Figure 0

Figure 1: Random points: every point is connected to its 2 nearest neighbors.

Figure 1

Table 1. Monte Carlo estimates for the value of $c_{d,k}$ (e.g. $k=2$ nearest neighbors in $[0,1]^2$ yield roughly $\sim 0.049n$ clusters). Larger values are difficult to obtain via sampling because $c_{d,k}$ decays very rapidly

Figure 2

Figure 2: Theorems 1.1 and 1.2 illustrated: 5000 uniformly distributed random points are each connected to their two nearest neighbors (a) and two out of the four nearest neighbors, randomly selected (b). Connected components are distinguished by color; we observe a giant component in (b).

Figure 3

Figure 3: Structured points: every point is connected to its four nearest neighbors (some edges lie on top of each other); a slight perturbation of the points immediately creates a cluster in the 4-nearest-neighbor graph.

Figure 4

Figure 5

Figure 4: $16\,000$ points arranged in four clusters and a spiral. We compare connecting every point to its two nearest neighbors (a) and connecting every point to two randomly chosen out of its seven nearest neighbors (b). Connected components are colored: graph (a) has $\sim 700$ connected components; graph (b) consists of the actual five clusters.

Figure 6

Table 2. Clustering quality metrics (NMI and ACC) for spectral clustering of four digits 0, 3, 6, 7 of InfiMNIST ($\sim$3.27 million points) using a k-nearest-neighbor graph compared to using the near-neighbor and partition approaches. The subspace angle between leading eigenvectors of each construction and the leading eigenvectors of nearest-100 is also computed

Figure 7

Table 3. Quality metrics as in Table 2 for spectral clustering of Reuters ($\sim 650\,000$ points)

Figure 8

Figure 5: Datapoints embedding of four digits from the InfiMNIST data set computed by the sparse graph Laplacian leading eigenvectors. Connecting to k nearest neighbors when k is too small leads to catastrophic results (a, b), while a successful embedding is obtained for $k=100$ (c). Connecting to two randomly chosen out of the 100 nearest neighbors gives a comparable embedding (d), while using far fewer edges. The partition method (Algorithm 1) also produces an embedding of equivalent quality (e).

Figure 9

Table 4. Time taken by neighbor search and computation of leading eigenvectors for the InfiMNIST dataset ($\sim$3.27 million points)

Figure 10

Table 5. Run-time as in Table 4 for the Reuters dataset ($\sim 650\,000$ points)

Figure 11

Figure 6: Removing tiny squares randomly: this random sample ends up removing a bit more from the giant component but is quite unlikely.

Figure 12

Figure 7: Fixing labels for the eight immediate neighbors.

Figure 13

Figure 8: The starting point followed by generating the connected component described by the sequence of sets $ \{4,5\}, \{3,4\}, \{\}, \{\}, \{5\}, \{4\}, \{\}$.

Figure 14

Table 6. Measures for InfiMNIST dataset

Figure 15

Table 7. Measures for Reuters dataset