Add an outward edge to a vertex

        :param fr: The source vertex.
        :param to: The name of the outward edge.
775648
def add_edge(self, fr, to):
        
        if fr not in set(self.graph.vs):  # ToDo: find out why item can be in set but not dict
            raise ValueError('can not connect unknown vertices in n-partite graphs, {!r} missing'.format(fr))
        elif to not in set(self.graph.vs):
            raise ValueError('can not connect unknown vertices in n-partite graphs, {!r} missing'.format(to))
        self.graph.add_edge(fr, to)
362157
def add_vertex(self, vertex, **attr):
        
        self.vertices[vertex] = []
        if attr:
            self.nodes[vertex] = attr
1292330
def add_edge(self, graph_edge):
        

        if not isinstance(graph_edge, Edge):
            raise TypeError('add_edge() received a non edge class object: ' + str(graph_edge))

        edge_points = ( graph_edge.get_source(), graph_edge.get_destination() )

        if self.obj_dict['edges'].has_key(edge_points):

            edge_list = self.obj_dict['edges'][edge_points]
            edge_list.append(graph_edge.obj_dict)

        else:

            self.obj_dict['edges'][edge_points] = [ graph_edge.obj_dict ]


        graph_edge.set_sequence( self.get_next_sequence_number() )

        graph_edge.set_parent_graph( self.get_parent_graph() )
415606
def add(self, aList):
        '''
        
        '''
        self.add_node(aList[0])
        for i in range(1, len(aList)):
            self.add_edge(aList[i], aList[0])
        self.sizes[aList[0]] = len(aList)
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
761259
public Model addEdge(Edge edge) {
    edges.add(edge);
    if (isNotNull(edge.getSourceVertex()) && !vertices.contains(edge.getSourceVertex())) {
      vertices.add(edge.getSourceVertex());
    }
    if (isNotNull(edge.getTargetVertex()) && !vertices.contains(edge.getTargetVertex())) {
      vertices.add(edge.getTargetVertex());
    }
    return this;
  }
1175274
def edge_style(self, head, tail, **kwargs):
        '''
        
        '''
        if tail not in self.nodes:
            raise GraphError("invalid node %s" % (tail,))

        try:
            if tail not in self.edges[head]:
                self.edges[head][tail]= {}
            self.edges[head][tail] = kwargs
        except KeyError:
            raise GraphError("invalid edge  %s -> %s " % (head, tail) )
991931
def _add_edge(self, layer, input_id, output_id):
        """"""

        if layer in self.layer_to_id:
            layer_id = self.layer_to_id[layer]
            if input_id not in self.layer_id_to_input_node_ids[layer_id]:
                self.layer_id_to_input_node_ids[layer_id].append(input_id)
            if output_id not in self.layer_id_to_output_node_ids[layer_id]:
                self.layer_id_to_output_node_ids[layer_id].append(output_id)
        else:
            layer_id = len(self.layer_list)
            self.layer_list.append(layer)
            self.layer_to_id[layer] = layer_id
            self.layer_id_to_input_node_ids[layer_id] = [input_id]
            self.layer_id_to_output_node_ids[layer_id] = [output_id]

        self.adj_list[input_id].append((output_id, layer_id))
        self.reverse_adj_list[output_id].append((input_id, layer_id))
668954
def move_edge_target(self, edge_id, node_a):
        """"""
        # Grab the edge
        edge = self.get_edge(edge_id)

        # Alter the vertices
        edge['vertices'] = (edge['vertices'][0], node_a)
1270384
def add_vertex(self, vertex, **attr):
        
        self.vertices[vertex] = []
        if attr:
            self.nodes[vertex] = attr
        self.pred[vertex] = []
        self.succ[vertex] = []
1264983
private void addObjectReferenceEdges(Vertex vertex, ObjectReferenceDescriptor rds)
    {
        Object refObject = rds.getPersistentField().get(vertex.getEnvelope().getRealObject());
        Class refClass = rds.getItemClass();
        for (int i = 0; i < vertices.length; i++)
        {
            Edge edge = null;
            // ObjectEnvelope envelope = vertex.getEnvelope();
            Vertex refVertex = vertices[i];
            ObjectEnvelope refEnvelope = refVertex.getEnvelope();
            if (refObject == refEnvelope.getRealObject())
            {
                edge = buildConcrete11Edge(vertex, refVertex, rds.hasConstraint());
            }
            else if (refClass.isInstance(refVertex.getEnvelope().getRealObject()))
            {
                edge = buildPotential11Edge(vertex, refVertex, rds.hasConstraint());
            }
            if (edge != null)
            {
                if (!edgeList.contains(edge))
                {
                    edgeList.add(edge);
                }
                else
                {
                    edge.increaseWeightTo(edge.getWeight());
                }
            }
        }
    }
1194728
def _edge_in_front(self, edge):
        
        e = (list(edge), list(edge)[::-1])
        for i in range(len(self._front)-1):
            if self._front[i:i+2] in e:
                return i
        return -1
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]]))
426608
public void addEdge(VertexT from, VertexT to) {
    Preconditions.checkArgument(vertices.containsKey(from) && vertices.containsKey(to));
    adjacencyList.put(from, to);
    vertices.put(to, vertices.get(to) + 1);
  }
666613
def add_node(self, c):
        
        idx = len(self.nodes)
        self.edges[idx] = set()
        self.nodes.append(c)
        return idx
301532
def add(self, key):
        
        if key in self._vertices:
            raise ValueError('vertex exists')
        self._vertices.add(key)
        self._forwards[key] = set()
        self._backwards[key] = set()
110811
public void addEdge(V from, V to) {
        addVertex(from);
        addVertex(to);
        neighbors.get(from).add(to);
    }