Analysis of a class of models was performed in which the key selection criterion for network topology is optimality. Optimality leads to the emergence of several distinct network structures including an apparent scale-free arrangement in the treelike topology limit. The optimization method used in the numerical simulations is a Metropolis scheme at zero temperature. The results indicate that the emergence of the topologies observed in nature may arise both from growth mechanisms and the interplay of dynamical mechanisms with a selection process.