should this be not just f(edgeCount) instead of having to iterate over the nodes