Remove a vertex from the graph
488396
def remove_vertex(vertex)
      @vertices[vertex].each do |edge|
        remove_edge(edge) if edge.include?(vertex)
      end
      delete_vertex(vertex)
      callback(vertex, :removed_from_graph, self)
    end
579381
private Graph<K, VV, EV> removeVertices(DataSet<Vertex<K, VV>> verticesToBeRemoved) {

		DataSet<Vertex<K, VV>> newVertices = getVertices().coGroup(verticesToBeRemoved).where(0).equalTo(0)
				.with(new VerticesRemovalCoGroup<>()).name("Remove vertices");

		DataSet <Edge< K, EV>> newEdges = newVertices.join(getEdges()).where(0).equalTo(0)
				// if the edge source was removed, the edge will also be removed
				.with(new ProjectEdgeToBeRemoved<>()).name("Edges to be removed")
				// if the edge target was removed, the edge will also be removed
				.join(newVertices).where(1).equalTo(0)
				.with(new ProjectEdge<>()).name("Remove edges");

		return new Graph<>(newVertices, newEdges, context);
	}
852981
public Graph<K, VV, EV> removeVertices(List<Vertex<K, VV>> verticesToBeRemoved) {
		return removeVertices(this.context.fromCollection(verticesToBeRemoved));
	}
561417
def clear(self, keep_attrs=False):
        
        if not keep_attrs:
            for a in (self.graph_attr, self.node_attr, self.edge_attr):
                a.clear()
        del self.body[:]
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
2326
def remove_edges(self, from_idx, to_idx, symmetric=False, copy=False):
    ''''''
    flat_inds = self._pairs.dot((self._num_vertices, 1))
    # convert to sorted order and flatten
    to_remove = (np.minimum(from_idx, to_idx) * self._num_vertices
                 + np.maximum(from_idx, to_idx))
    mask = np.in1d(flat_inds, to_remove, invert=True)
    res = self.copy() if copy else self
    res._pairs = res._pairs[mask]
    res._offdiag_mask = res._offdiag_mask[mask]
    return res
1261469
void removeReferences( Vertex remove , EdgeType type ) {
		EdgeSet removeSet = remove.getEdgeSet(type);
		for (int i = removeSet.size()-1; i >= 0; i--) {
			Vertex v = removeSet.get(i).dst;
			EdgeSet setV = v.getEdgeSet(type);
			// remove the connection from v to 'remove'. Be careful since the connection isn't always mutual
			// at this point
			int ridx = setV.find(remove);
			if( ridx != -1 )
				setV.edges.remove(ridx);
		}
		removeSet.reset();
	}
723411
def remove(self, predicate=None, obj=None):
        
        self.graph.remove((self.asNode(), predicate, obj))
943592
def clear_graph(identifier=None):
    
    graph = get_graph()
    if identifier:
        graph.destroy(identifier)
    try:
        graph.close()
    except:
        warn("Unable to close the Graph")
813453
def remove(self, *args):
        '''
        
        '''
        return Plan(reduce(lambda m,k: m.remove(k), args, self.nodes))
564268
def del_node(self, n):
        '''
        
        '''
        parent = self.get_node_attr(n, 'parent')
        if self.get_node_attr(n, 'direction') == 'R':
            self.set_node_attr(parent, 'Rchild', None)
        else:
            self.set_node_attr(parent, 'Lchild', None)
        Graph.del_node(self, n)
953426
def remove_unreferenced_vertices(self):
        

        unique = self.referenced_vertices

        mask = np.ones(len(self.vertices), dtype=np.int64) * -1
        mask[unique] = np.arange(len(unique), dtype=np.int64)

        self.replace_vertex_references(mask=mask)
        self.vertices = self.vertices[unique]
78402
def clear(self, context=None):
        
        context = URIRef(context).n3() if context is not None else '?g'
        query = """
            DELETE { GRAPH %s { ?s ?p ?o } } WHERE { GRAPH %s { ?s ?p ?o } }
        """ % (context, context)
        self.parent.graph.update(query)
390812
public void delete(Vertex vtx1, Vertex vtx2) {
        if (vtx1.prev == null) {
            head = vtx2.next;
        } else {
            vtx1.prev.next = vtx2.next;
        }
        if (vtx2.next == null) {
            tail = vtx1.prev;
        } else {
            vtx2.next.prev = vtx1.prev;
        }
    }
655469
private boolean removeUnnecesaryEdgesIfAny(final DirectedGraph<Object, JobGraphLink> graph,
            final SourceColumnFinder sourceColumnFinder) {
        final Collection<JobGraphLink> allLinks = graph.getEdges();
        final List<JobGraphLink> linksToRemove = new ArrayList<>();
        for (final JobGraphLink link : allLinks) {
            boolean removeable = true;

            if (link.getRequirement() != null) {
                // only links without requirements are candidates for removal
                removeable = false;
            }

            if (removeable) {
                final Object toVertex = link.getTo();
                final Collection<JobGraphLink> edgesGoingIn = graph.getInEdges(toVertex);
                if (edgesGoingIn.size() <= 1) {
                    // if this is the only edge going in, there is no
                    // special interest
                    removeable = false;
                }

                if (removeable) {
                    // check if these links represents a "shortcut" path that
                    // can be left out
                    for (final JobGraphLink edgeGoingIn : edgesGoingIn) {
                        if (edgeGoingIn != link) {
                            if (!isEdgeShortcutFor(graph, link, edgeGoingIn)) {
                                removeable = false;
                                break;
                            }
                        }
                    }

                    if (removeable) {
                        logger.debug("Removing unnecesary JobGraphLink: {}", link);
                        linksToRemove.add(link);
                    }
                }
            }
        }

        for (final JobGraphLink link : linksToRemove) {
            graph.removeEdge(link);
        }

        return !linksToRemove.isEmpty();
    }
1339219
def reduce_vertex(self, name1, *names):
        
        v = self.vertices[name1]
        for n in names:
            w = self.vertices[n]
            v.alias.update(w.alias)
            # replace mapping from n w by to v
            self.vertices[n] = v
199125
def remove_edge(self, u, v, key=None):
        
        try:
            d = self.adj[u][v]
        except KeyError:
            raise NetworkXError(
                "The edge {}-{} is not in the graph.".format(u, v)
            )
        if key is None:
            d.popitem()
        else:
            try:
                del d[key]
            except KeyError:
                raise NetworkXError(
                    "The edge {}-{} with key {} is not in the graph.".format
                    (u, v, key)
                )
        if len(d) == 0:
            del self.succ[u][v]