public static < V > void addAllVertices ( DirectedGraph < V , DefaultEdge > graph , Set < V > vertices ) { // add all of the new vertices to prep for linking for ( V vertex : vertices ) { graph . addVertex ( vertex ) ; } }
Add all of the vertices to the graph without any edges . If the the graph already contains any one of the vertices that vertex is not added .