code: func (g *Graph) deleteVertex_locked(vertexType vertexType, namespace, name string) {
  	vertex, exists := g.getVertex_rlocked(vertexType, namespace, name)
  	if !exists {
  		return
  	}
  
  	// find existing neighbors with a single edge (meaning we are their only neighbor)
  	neighborsToRemove := []graph.Node{}
  	neighborsToRecompute := []graph.Node{}
  	g.graph.VisitFrom(vertex, func(neighbor graph.Node) bool {
  		// this downstream neighbor has only one edge (which must be from us), so remove them as well
  		if g.graph.Degree(neighbor) == 1 {
  			neighborsToRemove = append(neighborsToRemove, neighbor)
  		}
  		return true
  	})
  	g.graph.VisitTo(vertex, func(neighbor graph.Node) bool {
  		if g.graph.Degree(neighbor) == 1 {
  			// this upstream neighbor has only one edge (which must be to us), so remove them as well
  			neighborsToRemove = append(neighborsToRemove, neighbor)
  		} else {
  			// recompute the destination edge index on this neighbor
  			neighborsToRecompute = append(neighborsToRemove, neighbor)
  		}
  		return true
  	})
  
  	// remove the vertex
  	g.removeVertex_locked(vertex)
  
  	// remove neighbors that are now edgeless
  	for _, neighbor := range neighborsToRemove {
  		g.removeVertex_locked(neighbor.(*namedVertex))
  	}
  
  	// recompute destination indexes for neighbors that dropped outbound edges
  	for _, neighbor := range neighborsToRecompute {
  		g.recomputeDestinationIndex_locked(neighbor)
  	}
  }
docs: // must be called under write lock