Add a path-edge to the path-graph. Edges are only added to the vertex of
lowest rank (see. constructor).

@param edge path edge
180078
private void add(final PathEdge edge) {
        int u = edge.either();
        int v = edge.other(u);
        if (rank[u] < rank[v])
            graph[u].add(edge);
        else
            graph[v].add(edge);
    }
631290
public void setEdges(java.util.Collection<Edge> edges) {
        if (edges == null) {
            this.edges = null;
            return;
        }

        this.edges = new java.util.ArrayList<Edge>(edges);
    }
1277208
def add_edge(self, a, b):
        
        neighbors_of_a = self.adjacency_lists.get(a)
        if not neighbors_of_a:
            neighbors_of_a = set()
            self.adjacency_lists[a] = neighbors_of_a

        neighbors_of_a.add(b)

        neighbors_of_b = self.adjacency_lists.get(b)
        if not neighbors_of_b:
            neighbors_of_b = set()
            self.adjacency_lists[b] = neighbors_of_b

        neighbors_of_b.add(a)
961450
def remove_edge(edge)
      delete_edge(edge)
      edge.each_vertex { |vertex| callback(vertex, :edge_removed, edge) }
    end
974087
protected void addToDownstream(BioPAXElement pe, Graph graph)
	{
		AbstractNode node = (AbstractNode) graph.getGraphObject(pe);

		if (node != null)
		{
			EdgeL3 edge = new EdgeL3(this, node, graph);
			edge.setTranscription(true);

			node.getUpstreamNoInit().add(edge);
			this.getDownstreamNoInit().add(edge);
		}
	}
193179
public void addEdge(int from, int to) {
        Set<Integer> outEdges = edges.get(from);
        if (outEdges == null) {
            outEdges = new TreeSet<Integer>();
            edges.put(from, outEdges);
        }
        outEdges.add(to);
    }
78983
public function add(Edge $edge) 
    {
        $dwinding = $edge->y0 < $edge->y1 ? 1 : -1;
        
        $layer = $this->topLayer;
        $previousLayer = null;
        
        while ($layer !== null) {
            if ($layer->polygonId === $edge->polygonId) {
                $layer->winding += $dwinding;

                $inPath = $layer->windingRule == 'evenodd' ? 
                    ($layer->winding % 2 === 1) : ($layer->winding !== 0);

                if (!$inPath) {
                    // Remove layer
                    if ($previousLayer === null) {
                        $this->topLayer = $layer->nextLayer;
                    }
                    else {
                        $previousLayer->nextLayer = $layer->nextLayer;
                    }
                }
                break;
            } elseif ($layer->polygonId < $edge->polygonId) {
                // Insert here
                $newLayer = new Layer(
                    $edge->polygonId,
                    $edge->color,
                    $dwinding,
                    $edge->windingRule
                );
                $newLayer->nextLayer = $layer;
                
                if ($previousLayer === null) {
                    $this->topLayer = $newLayer;
                } else {
                    $previousLayer->nextLayer = $newLayer;
                }
                break;
            }
            
            $previousLayer = $layer;
            $layer = $layer->nextLayer;
        }
        
        if ($layer === null) {
            $newLayer = new Layer(
                $edge->polygonId,
                $edge->color,
                $dwinding,
                $edge->windingRule
            );
            
            if ($previousLayer === null) {
                $this->topLayer = $newLayer;
            } else {
                $previousLayer->nextLayer = $newLayer;
            }
        }

        // Update current color
        $color = ColorUtils::TRANSPARENT;
        $layer = $this->topLayer;
        
        while ($layer !== null && ($color & 0xff) < 255) {
            if ($layer->color === ColorUtils::FORCE_TRANSPARENT) {
                break;
            }
            
            $color = ColorUtils::over($layer->color, $color);
        }
        
        $this->color = $color;
    }
632100
public static <V> void copyGraph(DirectedGraph<V, DefaultEdge> sourceGraph, DirectedGraph<V, DefaultEdge> targetGraph) {
        addAllVertices(targetGraph, sourceGraph.vertexSet());
        for (DefaultEdge edge : sourceGraph.edgeSet()) {
            targetGraph.addEdge(sourceGraph.getEdgeSource(edge), sourceGraph.getEdgeTarget(edge));
        }
    }
1225901
void insertForwardEdge(final ManagementGroupEdge edge, final int index) {

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

		this.forwardEdges.set(index, edge);
	}
48378
def add_edge_set_configuration(self, param_name, edge_to_value):
        
        for edge, val in future.utils.iteritems(edge_to_value):
            self.add_edge_configuration(param_name, edge, val)
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))
92612
private EdgeSet<T> addIfAbsent(int v) {
        S edges = getEdgeSet(v);
        if (edges == null) {
            edges = createEdgeSet(v);
            vertexToEdges.put(v, edges);
        }
        return edges;
    }
1136624
public void addNode(RNode newNode) {
        graph.add(newNode);
        graphBitSet.set(graph.size() - 1);
    }
1163785
def add_edge(self, source, target):
    
    edge = Edge(len(self.edges))
    self.edges.append(edge)
    source.out_edges.append(edge.idx)
    target.in_edges.append(edge.idx)
    edge.source = source.idx
    edge.target = target.idx
    return edge
548378
public function addOutEdge(DocumentGraphEdge $edge): void
    {
        $this->outEdges[$edge->getDestination()->className] = $edge;
    }
1205090
public void addEdges(Collection<EdgeIteratorState> edges) {
        for (EdgeIteratorState edge : edges) {
            visitedEdges.add(edge.getEdge());
        }
    }
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