Prepend an {Edge} and its vertices
 @param edge [Edge]	the {Edge} to unshift
971681
def unshift_edge(edge)
	    @vertices.unshift(edge.last) unless edge.last == @edges.first.first
	    @vertices.unshift(edge.first) # unless edge.first == @edges.last.last
	    @vertices.pop if @vertices.last == @vertices.first
	    @edges.unshift(edge)
	end
1142680
def add_edge(self, u_vertex, v_vertex):
        
        self._vertices.add(u_vertex)
        self._vertices.add(v_vertex)
        if not self.is_edge(u_vertex, v_vertex):
            self.indegrees[v_vertex] += 1
            self.adj_dict[u_vertex].append(v_vertex)
            return True

        return False
45578
def remove_vertex(self, vertex):
        
        try:
            self.vertices.pop(vertex)
        except KeyError:
            raise GraphInsertError("Vertex %s doesn't exist." % (vertex,))
        if vertex in self.nodes:
            self.nodes.pop(vertex)
        for element in self.vertices:
            if vertex in self.vertices[element]:
                self.vertices[element].remove(vertex)
        edges = []  # List for edges that include vertex
        for element in self.edges:
            if vertex in element:
                edges.append(element)
        for element in edges:
            del self.edges[element]
1069202
function Edge(u, v) {

			this.u = u;
			this.v = v;
			this.iterator = null;
			this.uiterator = null;
			this.viterator = null;
		}
695404
def add_edges(self, edges, *args, **kwargs):
        
        for edge in edges:
            self.add_edge(edge, *args, **kwargs)
488645
def prepend_child(node)
      raise "argument to << must be a String or Ox::Node." unless node.is_a?(String) or node.is_a?(Node)
      @nodes = [] if !instance_variable_defined?(:@nodes) or @nodes.nil?
      @nodes.unshift(node)
      self
    end
1021285
def close!
	    unless @edges.empty?
		# NOTE: parallel? is use here instead of collinear? because the
		#	edges are connected, and will therefore be collinear if
		#	they're parallel

		if closed?
		    if @edges.first.parallel?(@edges.last)
			unshift_edge Edge.new(@edges.last.first, shift_edge.last)
		    end
		elsif
		    closing_edge = Edge.new(@edges.last.last, @edges.first.first)

		    # If the closing edge is collinear with the last edge, then
		    #  simply extened the last edge to fill the gap
		    if @edges.last.parallel?(closing_edge)
			closing_edge = Edge.new(pop_edge.first, @edges.first.first)
		    end

		    # Check that the new closing_edge isn't zero-length
		    if closing_edge.first != closing_edge.last
			# If the closing edge is collinear with the first edge, then
			#  extend the first edge "backwards" to fill the gap
			if @edges.first.parallel?(closing_edge)
			    unshift_edge Edge.new(closing_edge.first, shift_edge.last)
			else
			    push_edge closing_edge
			end
		    end
		end
	    end
	    self
	end
1270384
def add_vertex(self, vertex, **attr):
        
        self.vertices[vertex] = []
        if attr:
            self.nodes[vertex] = attr
        self.pred[vertex] = []
        self.succ[vertex] = []
218698
def add_edge(self, u, v):
        
        # ubin = self.find_root(u)
        ru = self.find_root(u)
        rv = self.find_root(v)
        ru = self.reroot(ru, u)
        rv = self.reroot(rv, v)

        ubin.set_child(vbin)

        pass
1175177
def move_edge_source(self, edge_id, node_a, node_b):
        """"""
        # Grab the edge
        edge = self.get_edge(edge_id)

        # Alter the vertices
        edge['vertices'] = (node_b, edge['vertices'][1])

        # Remove the edge from node_a
        node = self.get_node(node_a)
        node['edges'].remove(edge_id)

        # Add the edge to node_b
        node = self.get_node(node_b)
        node['edges'].append(edge_id)
483584
function removeEdge(vertex, edge) {
  var adj = vertex.adjacent
  var idx = elist.index(adj, edge)
  adj.splice(idx, 1)
  //Check if flag needs to be updated
  if(!((idx < adj.length && adj[idx].level === edge.level) ||
       (idx > 0 && adj[idx-1].level === edge.level))) {
    vertex.euler[edge.level].setFlag(false)
  }
}
1338934
def del_edge(self, u_vertex, v_vertex):
        
        if self.is_edge(u_vertex, v_vertex):
            self.indegrees[v_vertex] -= 1
            self.adj_dict[u_vertex].remove(v_vertex)
            return True

        return False
1160026
def add_edge_attribute(self, edge, attr):
        
        self.edge_attr[edge] = self.edge_attributes(edge) + [attr]
        
        if (not self.DIRECTED and edge[0] != edge[1]):
            self.edge_attr[(edge[1],edge[0])] = self.edge_attributes((edge[1], edge[0])) + [attr]
1221222
def add_edge(*vertices, **kvargs)
      edge = new_edge(*vertices, mixins: @mixins, **kvargs)
      insert_edge(edge)
      vertices.each { |vertex| callback(vertex, :edge_added, edge) }
      edge
    end
259799
def move_edge_target(self, edge_id, node_a):
        """"""
        # Grab the edge
        edge = self.get_edge(edge_id)

        # Remove the edge from the original "target node"
        original_target_node_id = edge['vertices'][1]
        original_target_node = self.get_node(original_target_node_id)
        original_target_node['edges'].remove(edge_id)

        # Add the edge to the new target node
        new_target_node_id = node_a
        new_target_node = self.get_node(new_target_node_id)
        new_target_node['edges'].append(edge_id)

        # Alter the vertices on the edge
        edge['vertices'] = (edge['vertices'][0], node_a)
381122
def add_undirected_edge(vertex_a, vertex_b, weight)
      add_edge(vertex_a, vertex_b, weight)
      add_edge(vertex_b, vertex_a, weight)
    end
417289
def add_edge(self, u, v, **attr):
        
        if u not in self.vertices:
            self.vertices[u] = []
            self.pred[u] = []
            self.succ[u] = []
        if v not in self.vertices:
            self.vertices[v] = []
            self.pred[v] = []
            self.succ[v] = []
        vertex = (u, v)
        self.edges[vertex] = {}
        self.edges[vertex].update(attr)
        self.vertices[u].append(v)
        self.pred[v].append(u)
        self.succ[u].append(v)