Convenience method to allow adding multiple nodes at once in a graph.