Trees, networks and optimality