code: public static Graph<String, String> loadUndirectedGraphEdgeListFile(String path, int numVertices, String delim,
                      boolean allowMultipleEdges) throws IOException {
          Graph<String, String> graph = new Graph<>(numVertices, allowMultipleEdges, new StringVertexFactory());
          EdgeLineProcessor<String> lineProcessor = new DelimitedEdgeLineProcessor(delim, false);
  
          try (BufferedReader br = new BufferedReader(new FileReader(new File(path)))) {
              String line;
              while ((line = br.readLine()) != null) {
                  Edge<String> edge = lineProcessor.processLine(line);
                  if (edge != null) {
                      graph.addEdge(edge);
                  }
              }
          }
          return graph;
      }
docs: Simple method for loading an undirected graph, where the graph is represented by a edge list with one edge
  per line with a delimiter in between<br>
  This method assumes that all lines in the file are of the form {@code i<delim>j} where i and j are integers
  in range 0 to numVertices inclusive, and "<delim>" is the user-provided delimiter
  @param path Path to the edge list file
  @param numVertices number of vertices in the graph
  @param allowMultipleEdges If set to false, the graph will not allow multiple edges between any two vertices to exist. However,
  checking for duplicates during graph loading can be costly, so use allowMultipleEdges=true when
  possible.
  @return graph
  @throws IOException if file cannot be read