public Graph < K , VV , EV > addVertices ( List < Vertex < K , VV > > verticesToAdd ) { // Add the vertices DataSet < Vertex < K , VV > > newVertices = this . vertices . coGroup ( this . context . fromCollection ( verticesToAdd ) ) . where ( 0 ) . equalTo ( 0 ) . with ( new VerticesUnionCoGroup <> ( ) ) . name ( "Add vertices" ) ; return new Graph <> ( newVertices , this . edges , this . context ) ; }
Adds the list of vertices passed as input to the graph . If the vertices already exist in the graph they will not be added once more .