  Detecting the dimensionality of graphs is a central topic in machine
learning. While the problem has been tackled empirically as well as
theoretically, existing methods have several drawbacks. On the one hand,
empirical tools are computationally heavy and lack theoretical foundation. On
the other hand, theoretical approaches do not apply to graphs with
heterogeneous degree distributions, which is often the case for complex
real-world networks. To address these drawbacks, we consider geometric
inhomogeneous random graphs (GIRGs) as a random graph model, which captures a
variety of properties observed in practice. These include a heterogeneous
degree distribution and non-vanishing clustering coefficient, which is the
probability that two random neighbours of a vertex are adjacent. In GIRGs, $n$
vertices are distributed on a $d$-dimensional torus and weights are assigned to
the vertices according to a power-law distribution. Two vertices are then
connected with a probability that depends on their distance and their weights.
  Our first result shows that the clustering coefficient of GIRGs scales
inverse exponentially with respect to the number of dimensions, when the latter
is at most logarithmic in $n$. This gives a first theoretical explanation for
the low dimensionality of real-world networks observed by Almagro et. al.
[Nature '22]. Our second result is a linear-time algorithm for determining the
dimensionality of a given GIRG. We prove that our algorithm returns the correct
number of dimensions with high probability when the input is a GIRG. As a
result, our algorithm bridges the gap between theory and practice, as it not
only comes with a rigorous proof of correctness but also yields results
comparable to that of prior empirical approaches, as indicated by our
experiments on real-world instances.
