adds a check for edge-case of a network with 0 nodes