Optimized loop in test_isolated_networks
Loop now breaks when 4 nodes are attached to a network, instead of iterating
over all the nodes anyways.