ICML 2025

Dynamic Similarity Graph Construction
with Kernel Density Estimation
Steinar Laenen 1 Peter Macgregor 2 He Sun 1
Abstract
In the kernel density estimation (KDE) problem,
we are given a set X of data points in Rd, a kernel
function k : Rd × Rd →R, and a query point
q ∈Rd, and the objective is to quickly output an
estimate of P
x∈X k(q, x). In this paper, we con-
sider KDE in the dynamic setting, and introduce
a data structure that efficiently maintains the esti-
mates for a set of query points as data points are
added to X over time. Based on this, we design
a dynamic data structure that maintains a sparse
approximation of the fully connected similarity
graph on X, and develop a fast dynamic spectral
clustering algorithm. We further evaluate the ef-
fectiveness of our algorithms on both synthetic
and real-world datasets.
1. Introduction
Given a set X
= {x1, . . . , xn} of data points, a set
Q = {q1, . . . , qm} of query points, and a kernel func-
tion k : Rd × Rd →R⩾0, the KDE problem is to quickly
approximate µq ≜P
xi∈X k(q, xi) for every q ∈Q. As a
basic question in computer science, this problem has been
actively studied since the 1990s (Greengard & Strain, 1991)
and has comprehensive applications in machine learning
and statistics (Bakshi et al., 2023; Genovese et al., 2014;
Scholkopf & Smola, 2018; Schubert et al., 2014).
In this paper we first study the KDE problem in the dynamic
setting, where both the sets of data and query points change
over time. The objective is to dynamically update all the
KDE estimates µq for every q ∈Q as data points are added
to X. Building on the framework for static KDE developed
by Charikar et al. (2020), our algorithm processes: (i) in-
sertions and deletions of query points, and (ii) insertions of
1University of Edinburgh, United Kingdom 2University of
St Andrews, United Kingdom.
Correspondence to: He Sun
<h.sun@ed.ac.uk>.
Proceedings of the 42 nd International Conference on Machine
Learning, Vancouver, Canada. PMLR 267, 2025. Co...