Network topology optimization