Optimising the topology of complex neural networks