  Inspired by studies on the airports' network and the physical Internet, we
propose a general model of weighted networks via an optimization principle. The
topology of the optimal network turns out to be a spanning tree that minimizes
a combination of topological and metric quantities. It is characterized by a
strongly heterogeneous traffic, non-trivial correlations between distance and
traffic and a broadly distributed centrality. A clear spatial hierarchical
organization, with local hubs distributing traffic in smaller regions, emerges
as a result of the optimization. Varying the parameters of the cost function,
different classes of trees are recovered, including in particular the minimum
spanning tree and the shortest path tree. These results suggest that a
variational approach represents an alternative and possibly very meaningful
path to the study of the structure of complex weighted networks.
