  Random geometric graphs (RGG) can be formalized as hidden-variables models
where the hidden variables are the coordinates of the nodes. Here we develop a
general approach to extract the typical configurations of a generic
hidden-variables model and apply the resulting equations to RGG. For any RGG,
defined through a rigid or a soft geometric rule, the method reduces to a non
trivial satisfaction problem: Given $N$ nodes, a domain $\mathcal{D}$, and a
desired average connectivity $\langle k\rangle$, find - if any - the
distribution of nodes having support in $\mathcal{D}$ and average connectivity
$\langle k\rangle$. We find out that, in the thermodynamic limit, nodes are
either uniformly distributed or highly condensed in a small region, the two
regimes being separated by a first order phase transition characterized by a
$\mathop{O}(N)$ jump of $\langle k\rangle$. Other intermediate values of
$\langle k\rangle$ correspond to very rare graph realizations. The phase
transition is observed as a function of a parameter $a\in[0,1]$ that tunes the
underlying geometry. In particular, $a=1$ indicates a rigid geometry where only
close nodes are connected, while $a=0$ indicates a rigid anti-geometry where
only distant nodes are connected. Consistently, when $a=1/2$ there is no
geometry and no phase transition. After discussing the numerical analysis, we
provide a combinatorial argument to fully explain the mechanism inducing this
phase transition and recognize it as an easy-hard-easy transition. Our result
shows that, in general, ad hoc optimized networks can hardly be designed,
unless to rely to specific heterogeneous constructions, not necessarily scale
free.
