  It is now generally assumed that the heterogeneity of most networks in nature
probably arises via preferential attachment of some sort. However, the origin
of various other topological features, such as degree-degree correlations and
related characteristics, is often not clear and attributed to specific
functional requirements. We show how it is possible to analyse a very general
scenario in which nodes gain or lose edges according to any (e.g., nonlinear)
functions of local and/or global degree information. Applying our method to two
rather different examples of brain development -- synaptic pruning in humans
and the neural network of the worm C. Elegans -- we find that simple
biologically motivated assumptions lead to very good agreement with
experimental data. In particular, many nontrivial topological features of the
worm's brain arise naturally at a critical point.
