Preface
A data set becomes a graph as soon as we decide which samples are neighbors. The decision sounds modest, yet it changes what can be seen: a cluster becomes a set of samples that can reach each other in short steps, the distance between two samples becomes the length of a path along the data instead of a straight line through empty space, and a two-dimensional map becomes a drawing of the graph that keeps neighbors together. This book develops clustering and visualization methods built on that decision and shows, for each of them, how to run it in Python and how its parameters change the result.
From the monograph to this book. In 2013 the authors published a short monograph on graph-based clustering and data visualization [1]. It summarized a line of research carried out at the University of Pannonia: the hybrid minimal spanning tree–Gath–Geva clustering algorithm [2], the fuzzy neighborhood similarity that refines Jarvis–Patrick clustering [3], and the topology representing network map [4, 5], together with the vector quantization, topology learning, and mapping methods they rest on. The algorithms were implemented as a MATLAB toolbox. The present book is a new text written from scratch. It re-derives the methods of the monograph in a unified notation, re-implements every one of them in the open-source Python package graphclust, and adds the main developments of the field since 2013: density-based hierarchies such as HDBSCAN* and the validity index DBCV, density peaks clustering, community detection with Louvain and Leiden on neighborhood graphs, the improved visual assessment of cluster tendency, the co-ranking framework for judging maps, and the neighbor-graph embeddings (Laplacian eigenmaps, diffusion maps, t-SNE, and UMAP) that now dominate data visualization. Where the newer methods turn out to be descendants of the older ones—HDBSCAN* is a density-corrected minimal spanning tree, and the edge weights of PhenoGraph-style community detection are the first-order fuzzy neighborhood similarity—the text says so.
Who the book is for. It addresses data scientists, engineers, and graduate students who know k-means and principal component analysis and want to understand what graphs add. The mathematics requires linear algebra, elementary probability, and the notion of a shortest path. Every algorithm is stated in a box and summarized in a few bullets; every example uses data whose structure is known, so that the reader can see whether a method finds it. Readers interested mainly in applications can read the Using it in graphclust and Examples sections of each chapter; readers interested in the methods can skip the code.
How to run the examples. The package is installed with pip install graphclust. The scripts that produce the figures are in the examples/ directory of the repository, grouped by chapter, and are listed in chapter C. The online documentation renders them as a gallery and offers each as a Jupyter notebook, so the experiments can be rerun and modified without a local installation. The code snippets printed in the chapters are cut out of the same scripts.
Acknowledgments. The methods of the monograph were developed together with Attila Kiss, Balázs Feil, Ágnes Werner-Stark, and Balázs Gál, whose contributions are cited in the chapters. The research summarized in this book was supported by the National Research, Development and Innovation Office of Hungary (NKFIH) through the OTKA 143482 project.
Veszprém, November 2026 Ágnes Vathy-Fogarassy and János Abonyi