code: public void clear() {
          vertices.clear();
          vertexModCount++;
          Arrays.matrixFill(edges, null);
          edgeCount = 0;
          edgesArr = null;
          edgeModCount++;
          freeList.clear();
          for (int row = capacity - 1; row >= 0; row--) {
              freeList.add(row);
          }
      }
docs: Remove all vertices and edges.