code: public boolean remove(int vertex) {
          // If we can remove the vertex from the global set, then at least one of
          // the type-specific graphs has this vertex.
          SparseDirectedTypedEdgeSet<T> edges = vertexToEdges.remove(vertex);
          if (edges != null) {
              size -= edges.size();
              for (int other : edges.connected()) {
                  vertexToEdges.get(other).disconnect(vertex);
              }
  
              // Check whether removing this vertex has caused us to remove
              // the last edge for this type in the graph.  If so, the graph
              // no longer has this type and we need to update the state.
              for (DirectedTypedEdge<T> e : edges)
                  updateTypeCounts(e.edgeType(), -1);
  
              // Update any of the subgraphs that had this vertex to notify them
              // that it was removed
              Iterator<WeakReference<Subgraph>> iter = subgraphs.iterator();
              while (iter.hasNext()) {
                  WeakReference<Subgraph> ref = iter.next();
                  Subgraph s = ref.get();
                  // Check whether this subgraph was already gc'd (the subgraph
                  // was no longer in use) and if so, remove the ref from the list
                  // to avoid iterating over it again
                  if (s == null) {
                      iter.remove();
                      continue;
                  }
                  // If we removed the vertex from the subgraph, then check
                  // whether we also removed any of the types in that subgraph
                  if (s.vertexSubset.remove(vertex)) {
                      Iterator<T> subgraphTypesIter = s.validTypes.iterator();
                      while (subgraphTypesIter.hasNext()) {
                          if (!typeCounts.containsKey(subgraphTypesIter.next()))
                              subgraphTypesIter.remove();
                      }
                  }
              }
              return true;
          }
          return false;        
      }
docs: {@inheritDoc}