  Why complex structures emerge in a real world environment is a fascinating
question which has not found any fully satisfactory answer at the point of
today. At the border between statistical physics, machine learning and network
theory, we provide some computational empirical evidence indicating that the
emergence of complex structures in the outer world is the macroscopic
thermodynamic result of the optimal trade-off between the ability to encode
information about the environment in the very features of the network and the
ability to transmit information across it. While the former is quantified by
the von Neumann network entropy and the latter by the Helmholtz free energy,
the two are combined into a single quantity tantamount to the thermodynamic
efficiency. We take as a case study an algorithm originally proposed for
creating and searching trees of patterns under the assumption that, akin to
living system, the algorithm seeks the best internal representation of the
outer world, namely a real world dataset of patterns. Remarkably, the optimal
thermodynamic efficiency overlaps with the optimal pattern-matching efficiency,
defined in terms of accuracy and computational cost, whether the former is
measured at the resolution scale where the network transits from exhibiting a
specific heat with a single peak to a scale-invariant region. Moreover the
critical hypothesis is investigated and empirical evidence suggests that the
system benefits from the vicinity to the critical point whether it is faced
with higher-complexity environments, while it does not when the environment is
simpler.
