Remove a vertex from the graph, disconnecting all edges from/to it.
558908
def remove(self, key):
        
        self._vertices.remove(key)
        for f in self._forwards.pop(key):
            self._backwards[f].remove(key)
        for t in self._backwards.pop(key):
            self._forwards[t].remove(key)
765681
def delete(node)
      unless @nodes.key?(node.key)
        raise NoSuchNodeError.new(node.key)
      end

      (node.edges(:out) + node.edges(:in)).each do |edge|
        edge.from.disconnect_via(edge)
        edge.to.disconnect_via(edge)
      end

      @nodes.delete(node.key)
    end
230099
int removeVertexInternal_(int vertex, boolean b_left_segment) {
		int prev = getPrevVertex(vertex);
		int next = getNextVertex(vertex);
		if (prev != -1)
			setNextVertex_(prev, next);

		if (next != -1)
			setPrevVertex_(next, prev);

		if (prev != -1 && next != -1) {
			int vindex_prev = getVertexIndex(prev);
			int vindex_next = getVertexIndex(next);
			if (b_left_segment) {
				Segment seg = getSegmentFromIndex_(vindex_prev);
				if (seg != null) {
					Point2D pt = new Point2D();
					m_vertices.getXY(vindex_next, pt);
					seg.setEndXY(pt);
				}
			} else {
				int vindex_erased = getVertexIndex(vertex);
				Segment seg = getSegmentFromIndex_(vindex_erased);
				setSegmentToIndex_(vindex_prev, seg);
				if (seg != null) {
					Point2D pt = new Point2D();
					m_vertices.getXY(vindex_prev, pt);
					seg.setStartXY(pt);
				}
			}
		}
		freeVertex_(vertex);
		return next;
	}
1286131
public function destroy()
    {
        foreach ($this->getEdges()->getEdgesDistinct() as $edge) {
            $edge->destroy();
        }
        $this->graph->removeVertex($this);
    }
1338264
def remove_edges(*edges)
      edges = to_edges(edges).sort{|e1,e2| e2<=>e1}
      edges.each do |edge|
        edge.source.remove_out_edge(edge)
        edge.target.remove_in_edge(edge)
        @edges.delete_at(edge.index)
        edge.index = -1
      end
      @edges.each_with_index {|edge,i| edge.index=i}
      self
    end
281300
public void removeEdge(AtlasEdge edge) {
        String edgeString = null;

        if (LOG.isDebugEnabled()) {
            edgeString = string(edge);

            LOG.debug("Removing {}", edgeString);
        }

        graph.removeEdge(edge);

        if (LOG.isDebugEnabled()) {
            LOG.info("Removed {}", edgeString);
        }
    }
321514
def disconnect(self):
        

        for name, wire in self.wires():
            self.cut(name, disconnect=True)
309071
def disconnect(self, node):
        
        rel = _rel_helper(lhs='a', rhs='b', ident='r', **self.definition)
        q = "MATCH (a), (b) WHERE id(a)={self} and id(b)={them} " \
            "MATCH " + rel + " DELETE r"
        self.source.cypher(q, {'them': node.id})
1191766
protected void deleteEdgeBetweenVertices(AtlasVertex outVertex, AtlasVertex inVertex, String attributeName) throws AtlasException {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Removing edge from {} to {} with attribute name {}", string(outVertex), string(inVertex),
                    attributeName);
        }

        String typeName = GraphHelper.getTypeName(outVertex);
        String outId = GraphHelper.getGuid(outVertex);
        Id.EntityState state = GraphHelper.getState(outVertex);
        if ((outId != null && RequestContext.get().isDeletedEntity(outId)) || state == Id.EntityState.DELETED) {
            //If the reference vertex is marked for deletion, skip updating the reference
            return;
        }

        IDataType type = typeSystem.getDataType(IDataType.class, typeName);
        AttributeInfo attributeInfo = getFieldMapping(type).fields.get(attributeName);
        String propertyName = GraphHelper.getQualifiedFieldName(type, attributeName);
        String edgeLabel = EDGE_LABEL_PREFIX + propertyName;
        AtlasEdge edge = null;

        switch (attributeInfo.dataType().getTypeCategory()) {
        case CLASS:
            //If its class attribute, its the only edge between two vertices
            if (attributeInfo.multiplicity.nullAllowed()) {
                edge = graphHelper.getEdgeForLabel(outVertex, edgeLabel);
                if (shouldUpdateReverseAttribute) {
                    GraphHelper.setProperty(outVertex, propertyName, null);
                }
            } else {
                // Cannot unset a required attribute.
                throw new NullRequiredAttributeException("Cannot unset required attribute " + GraphHelper.getQualifiedFieldName(type, attributeName) +
                    " on " + GraphHelper.getVertexDetails(outVertex) + " edge = " + edgeLabel);
            }
            break;

        case ARRAY:
            //If its array attribute, find the right edge between the two vertices and update array property
            List<String> elements = GraphHelper.getListProperty(outVertex, propertyName);
            if (elements != null) {
                elements = new ArrayList<>(elements);   //Make a copy, else list.remove reflects on titan.getProperty()
                for (String elementEdgeId : elements) {
                    AtlasEdge elementEdge = graphHelper.getEdgeByEdgeId(outVertex, edgeLabel, elementEdgeId);
                    if (elementEdge == null) {
                        continue;
                    }

                    AtlasVertex elementVertex = elementEdge.getInVertex();
                    if (elementVertex.equals(inVertex)) {
                        edge = elementEdge;

                        //TODO element.size includes deleted items as well. should exclude
                        if (!attributeInfo.multiplicity.nullAllowed()
                                && elements.size() <= attributeInfo.multiplicity.lower) {
                            // Deleting this edge would violate the attribute's lower bound.
                            throw new NullRequiredAttributeException(
                                    "Cannot remove array element from required attribute " +
                                            GraphHelper.getQualifiedFieldName(type, attributeName) + " on "
                                            + GraphHelper.getVertexDetails(outVertex) + " " + GraphHelper.getEdgeDetails(elementEdge));
                        }

                        if (shouldUpdateReverseAttribute) {
                            //if composite attribute, remove the reference as well. else, just remove the edge
                            //for example, when table is deleted, process still references the table
                            //but when column is deleted, table will not reference the deleted column
                            if (LOG.isDebugEnabled()) {
                                LOG.debug("Removing edge {} from the array attribute {}", string(elementEdge),
                                        attributeName);
                            }

                            // Remove all occurrences of the edge ID from the list.
                            // This prevents dangling edge IDs (i.e. edge IDs for deleted edges)
                            // from the remaining in the list if there are duplicates.
                            elements.removeAll(Collections.singletonList(elementEdge.getId().toString()));
                            GraphHelper.setProperty(outVertex, propertyName, elements);
                            break;

                        }
                    }
                }
            }
            break;

        case MAP:
            //If its map attribute, find the right edge between two vertices and update map property
            List<String> keys = GraphHelper.getListProperty(outVertex, propertyName);
            if (keys != null) {
                keys = new ArrayList<>(keys);   //Make a copy, else list.remove reflects on titan.getProperty()
                for (String key : keys) {
                    String keyPropertyName = GraphHelper.getQualifiedNameForMapKey(propertyName, key);
                    String mapEdgeId = GraphHelper.getSingleValuedProperty(outVertex, keyPropertyName, String.class);
                    AtlasEdge mapEdge = graphHelper.getEdgeByEdgeId(outVertex, keyPropertyName, mapEdgeId);
                    if(mapEdge != null) {
                        AtlasVertex mapVertex = mapEdge.getInVertex();
                        if (mapVertex.getId().toString().equals(inVertex.getId().toString())) {
                            //TODO keys.size includes deleted items as well. should exclude
                            if (attributeInfo.multiplicity.nullAllowed() || keys.size() > attributeInfo.multiplicity.lower) {
                                edge = mapEdge;
                            } else {
                                // Deleting this entry would violate the attribute's lower bound.
                                throw new NullRequiredAttributeException(
                                        "Cannot remove map entry " + keyPropertyName + " from required attribute " +
                                                GraphHelper.getQualifiedFieldName(type, attributeName) + " on " + GraphHelper.getVertexDetails(outVertex) + " " + GraphHelper.getEdgeDetails(mapEdge));
                            }

                            if (shouldUpdateReverseAttribute) {
                                //remove this key
                                if (LOG.isDebugEnabled()) {
                                    LOG.debug("Removing edge {}, key {} from the map attribute {}", string(mapEdge), key,
                                            attributeName);
                                }

                                keys.remove(key);
                                GraphHelper.setProperty(outVertex, propertyName, keys);
                                GraphHelper.setProperty(outVertex, keyPropertyName, null);
                            }
                            break;
                        }
                    }
                }
            }
            break;

        case STRUCT:
        case TRAIT:
            break;

        default:
            throw new IllegalStateException("There can't be an edge from " + GraphHelper.getVertexDetails(outVertex) + " to "
                    + GraphHelper.getVertexDetails(inVertex) + " with attribute name " + attributeName + " which is not class/array/map attribute");
        }

        if (edge != null) {
            deleteEdge(edge, false);
            RequestContext requestContext = RequestContext.get();
            GraphHelper.setProperty(outVertex, Constants.MODIFICATION_TIMESTAMP_PROPERTY_KEY,
                    requestContext.getRequestTime());
            GraphHelper.setProperty(outVertex, Constants.MODIFIED_BY_KEY, requestContext.getUser());
            requestContext.recordEntityUpdate(outId);
        }
    }
82906
def removeNode(self, node):
        
        ident = self.getIdent(node)
        if ident is not None:
            self.graph.hide_node(ident)
624038
def delete(self):
        
        branch, turn, tick = self.engine._nbtt()
        self.engine._edges_cache.store(
            self.character.name,
            self.origin.name,
            self.destination.name,
            0,
            branch,
            turn,
            tick,
            None
        )
        self.engine.query.exist_edge(
            self.character.name,
            self.origin.name,
            self.destination.name,
            branch, turn, tick, False
        )
        try:
            del self.engine._edge_objs[
                (self.graph.name, self.orig, self.dest)
            ]
        except KeyError:
            pass
        self.character.portal[self.origin.name].send(
            self.character.portal[self.origin.name],
            key='dest', val=None
        )
1059791
def remove_edge (u, v)
      @vertex_dict[u].delete(v) unless @vertex_dict[u].nil?
      @predecessor_dict[v].delete(u) unless @predecessor_dict[v].nil?
    end
444789
def clear(self):
        
        self.adj.clear()
        self.node.clear()
        self.graph.clear()
1297276
void removeVertexLabel(VertexLabel vertexLabel, boolean preserveData) {
        getTopology().lock();
        String fn = this.name + "." + VERTEX_PREFIX + vertexLabel.getName();
        if (!uncommittedRemovedVertexLabels.contains(fn)) {
            uncommittedRemovedVertexLabels.add(fn);
            TopologyManager.removeVertexLabel(this.sqlgGraph, vertexLabel);
            for (EdgeRole er : vertexLabel.getOutEdgeRoles().values()) {
                er.remove(preserveData);
            }
            for (EdgeRole er : vertexLabel.getInEdgeRoles().values()) {
                er.remove(preserveData);
            }
            if (!preserveData) {
                vertexLabel.delete();
            }
            getTopology().fire(vertexLabel, "", TopologyChangeAction.DELETE);
        }

    }
842361
protected void removeEdgeWithoutCallback(EdgeBean eBean) {
        if (eBean == null) {
            return;
        }

        // Update in and out vertices
        VertexBean outV = eBean.outVertex;
        VertexBean inV = eBean.inVertex;

        outV.outEdges = removeEdgeFromAdjList(outV.outEdges, eBean); // CompactSet.<EdgeBean>remove(outV.outEdges, eBean);
        inV.inEdges = removeEdgeFromAdjList(inV.inEdges, eBean);; // CompactSet.<EdgeBean>remove(inV.inEdges, eBean);
    }
479551
def remove_edge(self, u, v):
        
        try:
            self.edges.pop((u, v))
        except KeyError:
            raise GraphInsertError("Edge %s-%s doesn't exist." % (u, v))
        self.vertices[u].remove(v)
        self.vertices[v].remove(u)
1092731
def del_graph(self, graph):
        """"""
        g = self.pack(graph)
        self.sql('del_edge_val_graph', g)
        self.sql('del_node_val_graph', g)
        self.sql('del_edge_val_graph', g)
        self.sql('del_edges_graph', g)
        self.sql('del_nodes_graph', g)
        self.sql('del_graph', g)