Adds the edge to the Vertex object's `edges` dictionary
776954
def _add_edge_to_vertex(self, vertex_id, edge):
        
        connected_to = edge.connected_to(vertex_id)
        if vertex_id not in self.vertices:
            vertex_obj = Vertex(vertex_id)
            self.vertices[vertex_id] = vertex_obj
        self.vertices[vertex_id].edges[connected_to] = edge.weight
1065909
def add_self_edges(self, weight=None, copy=False):
    ''''''
    ii = np.arange(self.num_vertices())
    return self.add_edges(ii, ii, weight=weight, symmetric=False, copy=copy)
628091
def edges(self):
        # TODO: check docstring
        
        for i in sorted(self._matrix.keys(), key=lambda x:x.name()):
            for j in sorted(self._matrix[i].keys(), key=lambda x:x.name()):
                if i != j:
                    yield (i, j)
541102
def edges
	    points = self.vertices
	    points.each_cons(2).map {|p1,p2| Edge.new(p1,p2) } + [Edge.new(points.last, points.first)]
	end
506877
def node_to_edge(edges, directed=True):
    
    outgoing = defaultdict(set)
    incoming = defaultdict(set) if directed else outgoing
    nodes = set()
    for i, edge in enumerate(edges):
        a, b, = edge[:2]
        outgoing[a].add(i)
        incoming[b].add(i)
        nodes.add(a)
        nodes.add(b)
    nodes = sorted(nodes)
    if directed:
        return outgoing, incoming, nodes
    return outgoing, nodes
288114
def add_bond(self, key1, key2, bond):
        """"""
        self.graph.add_edge(key1, key2, bond=bond)
899867
def add_edge(edges, edge_points, coords, i, j):
    
    if (i, j) in edges or (j, i) in edges:
        # already added
        return( edges.add((i, j)), edge_points.append(coords[[i, j]]))
146385
def edges(self):
        
        canonical_edges = set()
        for v1, neighbours in self._vertices.items():
            for v2 in neighbours:
                edge = self.canonical_order((v1, v2))
                canonical_edges.add(edge)
        return canonical_edges
1199943
def add_edge(u, v, flags = EDGE_NORMAL)
      u.join(v)
      u.set_flag(v, flags)
    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)
1267664
function addConnectedEdges(node) {
    var edges = node._private.edges;

    for (var i = 0; i < edges.length; i++) {
      add(edges[i]);
    }
  }
362157
def add_vertex(self, vertex, **attr):
        
        self.vertices[vertex] = []
        if attr:
            self.nodes[vertex] = attr
961450
def remove_edge(edge)
      delete_edge(edge)
      edge.each_vertex { |vertex| callback(vertex, :edge_removed, edge) }
    end
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
1140332
def add_neighbor(self, edge: "Edge") -> None:
        
        if edge is None or (edge.source != self and edge.target != self):
            return

        if edge.source == self:
            other: Node = edge.target
        elif edge.target == self:
            other: Node = edge.source
        else:
            raise ValueError("Tried to add a neighbor with an invalid edge.")

        edge_key: Tuple(int, int) = edge.key

        # The graph is considered undirected, check neighbor existence accordingly.
        if self._neighbors.get(edge_key) or self._neighbors.get((edge_key[1], edge_key[0])):
            return  # The neighbor is already added.

        self._neighbors[edge_key] = edge
        self.dispatch_event(NeighborAddedEvent(other))
1065740
def _edges_to_adjacency_list(edges):
    """"""
    adj = {}
    for i, j in edges:
        if i in adj:  # pragma: no cover
            ni = adj[i]
        else:
            ni = adj[i] = set()
        if j in adj:
            nj = adj[j]
        else:
            nj = adj[j] = set()
        ni.add(j)
        nj.add(i)
    return adj
270628
function addEdge(u, v, weight){
    addNode(u);
    addNode(v);
    adjacent(u).push(v);

    if (weight !== undefined) {
      setEdgeWeight(u, v, weight);
    }

    return graph;
  }