Add a new edge into the graph.
@param e the edge that will be added into the graph.
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++;
	}
746665
public void addException(Exception e) {
        if (exceptions == null) {
            exceptions = new ArrayList<>();
        }
        exceptions.add(e);
        log.error(e.getMessage(), e);
    }
76000
public Graph<K, VV, EV> removeEdge(Edge<K, EV> edge) {
		DataSet<Edge<K, EV>> newEdges = getEdges().filter(new EdgeRemovalEdgeFilter<>(edge)).name("Remove edge");
		return new Graph<>(this.vertices, newEdges, this.context);
	}
11675
public void add (E e) {
		// is size greater than capacity increase capacity
		if (size == data.length) {
			grow();
		}

		data[size++] = e;
	}
1053316
public Graph<K, VV, EV> addVertex(final Vertex<K, VV> vertex) {
		List<Vertex<K, VV>> newVertex = new ArrayList<>();
		newVertex.add(vertex);

		return addVertices(newVertex);
	}
254530
@Override
	public boolean add(E e) {
		if (capacity <= linkedBlockingDeque.size())
			linkedBlockingDeque.removeFirst();
		return linkedBlockingDeque.add(e);
	}
1225901
void insertForwardEdge(final ManagementGroupEdge edge, final int index) {

		while (index >= this.forwardEdges.size()) {
			this.forwardEdges.add(null);
		}

		this.forwardEdges.set(index, edge);
	}
13236
public void addEdge(DiEdge e, double w) {
        if (!getEdges().contains(e)) { 
            super.addEdge(e);
            weights.put(e, w);
        }
    }
631290
public void setEdges(java.util.Collection<Edge> edges) {
        if (edges == null) {
            this.edges = null;
            return;
        }

        this.edges = new java.util.ArrayList<Edge>(edges);
    }
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)
271068
private void addInitial(G g) {
        Set<T> typeCounts = g.edgeTypes();
        LinkedList<Map.Entry<G,Integer>> graphs = typesToGraphs.get(typeCounts);
        if (graphs == null) {
            graphs = new LinkedList<Map.Entry<G,Integer>>();
            typesToGraphs.put(new HashSet<T>(typeCounts), graphs);
        }

        graphs.add(new SimpleEntry<G,Integer>(g, 0));
    }
1283835
final void add(final Cycle cycle) {
        basis.add(cycle);
        edgesOfBasis.or(cycle.edgeVector());
    }
994155
function addGraph (g1, g2) {
  eachEdge(g2, function (from, to, data) {
    addEdge(g1, from, to, data)
  })
  return g1
}
539909
def add_edge(self, edge):
        
        u, v = edge

        both_exist = u in self.vertices and v in self.vertices
        # Using `is` because if they belong to the same component, they MUST
        # share the same set object!
        if both_exist and self.components[u] is self.components[v]:
            # Both vertices are part of the same connected component.
            raise InvariantError('Adding %r would form a cycle' % (edge,))
        if u == v:
            raise InvariantError('Cannot add loop: %r' % (edge,))

        # Ensure the vertices exist in the graph.
        self.add_vertex(u)
        self.add_vertex(v)

        # Add the edges to each other.
        self._vertices[u].add(v)
        self._vertices[v].add(u)

        # Add all of the smaller components to the bigger one.
        smaller_component, bigger_component = self.sort_components(u, v)
        for vertex in smaller_component:
            bigger_component.add(vertex)
            # And with this assignment, say bye-bye to the smaller component.
            self.components[vertex] = bigger_component
193183
def addEdge(self, outVertex, inVertex, label):
        """"""
        n1 = outVertex.neoelement
        n2 = inVertex.neoelement
        edge = n1.relationships.create(label, n2)
        return Edge(edge)
1372649
int newEdge_(int origin_vertex) {
		int edge = m_edges.newElement();
		int edgeVertices = m_edge_vertices.createList();
		setEdgeOriginVertices_(edge, edgeVertices);
		if (origin_vertex != -1)
			m_edge_vertices.addElement(edgeVertices, origin_vertex);

		return edge;
	}
838560
@Override
    public boolean add(E e) {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            Object[] elements = getArray();
            int len = elements.length;
            Object[] newElements = Arrays.copyOf(elements, len + 1);
            newElements[len] = e;
            setArray(newElements);
            return true;
        } finally {
            lock.unlock();
        }
    }