Adds the edge with the given weight
13236
public void addEdge(DiEdge e, double w) {
        if (!getEdges().contains(e)) { 
            super.addEdge(e);
            weights.put(e, w);
        }
    }
1085714
function add(product, left, right) {
  for (var i = 0; i < left.weights.length; i++) {
    product.weights[i] = left.weights[i] + right.weights[i];
    product.deltas[i] = 0;
  }
}
676671
def add_node(self, node, weight=1):
        """"""
        self._nodes.add(node)
        self._weights[node] = weight
        self._rebuild_circle()
1294421
public boolean add(WeightedDirectedTypedEdge<T> e) {
        if (e.from() == rootVertex) {
            Set<WeightedDirectedTypedEdge<T>> edges = outEdges.get(e.to());
            if (edges.contains(e))
                return false;

            // We can't rely on the edge's equality method since that uses the
            // edge weight, so we'll have to iterate over the edges to see if we
            // have one that matches the type, and if so replace it with the
            // different weight
            if (!edges.isEmpty()) {
                Iterator<WeightedDirectedTypedEdge<T>> iter = edges.iterator();
                WeightedDirectedTypedEdge<T> existing = null;
                while (iter.hasNext()) {
                    WeightedDirectedTypedEdge<T> n = iter.next();
                    if (n.to() == e.to() 
                            && n.edgeType().equals(e.edgeType())) {
                        existing = n;
                        break;
                    }
                }
                if (existing == null) {
                    outEdges.put(e.to(), e);
                    return true;                    
                }
                // Check if has the same weight;
                else if (e.weight() != existing.weight()) {
                    outEdges.remove(e.to(), existing);
                    outEdges.put(e.to(), e);
                    return true;
                }
                else 
                    return false;
            }
            else 
                return  outEdges.put(e.to(), e);
        }

        else if (e.to() == rootVertex) {
            Set<WeightedDirectedTypedEdge<T>> edges = inEdges.get(e.from());
            if (edges.contains(e))
                return false;

            // We can't rely on the edge's equality method since that uses the
            // edge weight, so we'll have to iterate over the edges to see if we
            // have one that matches the type, and if so replace it with the
            // different weight
            if (!edges.isEmpty()) {
                Iterator<WeightedDirectedTypedEdge<T>> iter = edges.iterator();
                WeightedDirectedTypedEdge<T> existing = null;
                while (iter.hasNext()) {
                    WeightedDirectedTypedEdge<T> n = iter.next();
                    if (n.from() == e.from() 
                            && n.edgeType().equals(e.edgeType())) {
                        existing = n;
                        break;
                    }
                }

                if (existing == null) {
                    inEdges.put(e.from(), e);
                    return true;                    
                }
                // Check if has the same weight;
                else if (e.weight() != existing.weight()) {
                    inEdges.remove(e.from(), existing);
                    inEdges.put(e.from(), e);
                    return true;
                }
                return false;
            }
            else 
                return inEdges.put(e.from(), e);
        }
        return false;
    }
270710
function link(edge) {
  var es = edge.s.euler
  var et = edge.t.euler
  var euler = new Array(edge.level+1)
  for(var i=0; i<euler.length; ++i) {
    if(es.length <= i) {
      es.push(createEulerVertex(edge.s))
    }
    if(et.length <= i) {
      et.push(createEulerVertex(edge.t))
    }
    euler[i] = es[i].link(et[i], edge)
  }
  edge.euler = euler
}
92612
private EdgeSet<T> addIfAbsent(int v) {
        S edges = getEdgeSet(v);
        if (edges == null) {
            edges = createEdgeSet(v);
            vertexToEdges.put(v, edges);
        }
        return edges;
    }
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
1069202
function Edge(u, v) {

			this.u = u;
			this.v = v;
			this.iterator = null;
			this.uiterator = null;
			this.viterator = null;
		}
434319
public void addEdge(Edge e) {

		if (!containsNode(e.getFromNodeId())) {
			throw new NodeNotFoundException(e.getFromNodeId());
		}
		
		if (!containsNode(e.getToNodeId())) {
			throw new NodeNotFoundException(e.getToNodeId());
		}

		if (this.containsEdge(e.getId()))
			throw new DuplicatedEdgeException(e.getId());

		int eIndex = nextEdgeId++;

		edgeIdMapping.put(e.getId(), eIndex);

		int aliveIndex = eIndex >> 5;
		int aliveSubIndex = eIndex & 31;

		if (aliveIndex >= aliveEdges.size())
			aliveEdges.add(0);

		aliveEdges.set(aliveIndex, aliveEdges.get(aliveIndex) | (1 << aliveSubIndex));

		updateAdjacency(e, eIndex);
		
		edges.add(e);
		numberOfEdges++;
	}
1045659
@Override
	public void addEdge(Edge e) {
		
		addDirectionalEdge(e);
		
		if (e.isBidirectional())
			addDirectionalEdge(new Edge(e.getToNodeId(), e.getFromNodeId(), e.getWeight()));
	}
423088
def add_edge_attributes(self, edge, attrs):
        
        for attr in attrs:
            self.add_edge_attribute(edge, attr)
988730
def add_node(self, node, weight=1):
        
        self._nodes.add(node)
        self._weights[node] = weight
        self._hashring = dict()
        self._sorted_keys = []

        self._build_circle()
805178
def add_edge(self, p_from, p_to, p_id=None):
        
        if not self.has_edge(p_from, p_to):
            if not self.has_node(p_from):
                self.add_node(p_from)

            if not self.has_node(p_to):
                self.add_node(p_to)

            self._edges[p_from].add(p_to)
            self._edge_numbers[(p_from, p_to)] = p_id
1039874
def connect_from(self, vertex, weight=1):
        
        for edge in self.edges_in:
            if vertex == edge.vertex_out:
                return edge
        return Edge(vertex, self, weight)
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]]))
992390
def add_edge(source, destination, weight)
      if @edges.key?(source)
        @edges[source][destination] = weight
      else
        @edges[source] = { destination => weight }
      end
    end
972748
function (obj, contents, weight, categoryWeights) {
        obj._gloss.parse(contents);
        var current = obj._gloss.root;
        var prev = null;
        do {
            var s = current.toJSON();
            if (!s.children && !s.orig && !s.isFiltered) {
                // increment total and add/incr bidirectional edges for current node
                prev = obj._incrEdges(id, obj._fmtNode(s), prev, weight, categoryWeights);
            } else if (!s.isFiltered) {
                if (s.orig && s.children) {
                    // increment total and add bidirectional edge weight for original node
                    if (!s.orig.isFiltered) {
                        prev = obj._incrEdges(id, obj._fmtNode(s.orig), prev, weight, categoryWeights);
                    }

                    for (var i = 0; i < s.children.length; i++) {
                        // increment total and add/incr bidirectional edges on child
                        if (!s.children[i].isFiltered) {
                            prev = obj._incrEdges(id, obj._fmtNode(s.children[i]), prev, weight, categoryWeights);
                        }
                    }
                }
            }

            current = current.next;
        } while (current);
    }