Add a zero length edge with reduced routing options to the graph.
973005
Collection<EdgeIteratorState> addBarrierEdge(long fromId, long toId, IntsRef inEdgeFlags, long nodeFlags, long wayOsmId) {
        IntsRef edgeFlags = IntsRef.deepCopyOf(inEdgeFlags);
        // clear blocked directions from flags
        for (BooleanEncodedValue accessEnc : encodingManager.getAccessEncFromNodeFlags(nodeFlags)) {
            accessEnc.setBool(false, edgeFlags, false);
            accessEnc.setBool(true, edgeFlags, false);
        }
        // add edge
        barrierNodeIds.clear();
        barrierNodeIds.add(fromId);
        barrierNodeIds.add(toId);
        return addOSMWay(barrierNodeIds, edgeFlags, wayOsmId);
    }
1106228
def _data_graph_add_edge(self, src, dst, **edge_labels):
        

        if src in self._data_graph and dst in self._data_graph[src]:
            return

        self._data_graph.add_edge(src, dst, **edge_labels)

        self._simplified_data_graph = None
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)
641771
def _add_two_way_unqualified_edge(self, u: BaseEntity, v: BaseEntity, relation: str) -> str:
        """"""
        self.add_unqualified_edge(v, u, relation)
        return self.add_unqualified_edge(u, v, relation)
807814
private Graph<Module> buildGraph(Map<Module, Set<Module>> edges) {
        Graph.Builder<Module> builder = new Graph.Builder<>();
        Set<Module> visited = new HashSet<>();
        Deque<Module> deque = new LinkedList<>();
        edges.entrySet().stream().forEach(e -> {
            Module m = e.getKey();
            deque.add(m);
            e.getValue().stream().forEach(v -> {
                deque.add(v);
                builder.addEdge(m, v);
            });
        });

        // read requires transitive from ModuleDescriptor
        Module source;
        while ((source = deque.poll()) != null) {
            if (visited.contains(source))
                continue;

            visited.add(source);
            builder.addNode(source);
            Module from = source;
            requiresTransitive(from).forEach(m -> {
                deque.add(m);
                builder.addEdge(from, m);
            });
        }
        return builder.build();
    }
871328
def _add_edge(self, s_a, s_b, **edge_labels):
        
        # Is that edge already in the graph ?
        # If at least one is new, then we are not redoing the same path again
        if (s_a, s_b) not in self.graph.edges():
            self.graph.add_edge(s_a, s_b, **edge_labels)
            self._new = True
            l.info("New edge: %s --> %s", s_a, s_b)
186510
def without_nodes(self, edge: Edge) -> 'BipartiteGraph[TLeft, TRight, TEdgeValue]':
        """"""
        return BipartiteGraph(((n1, n2), v) for (n1, n2), v in self._edges.items() if n1 != edge[0] and n2 != edge[1])
1142680
def add_edge(self, u_vertex, v_vertex):
        
        self._vertices.add(u_vertex)
        self._vertices.add(v_vertex)
        if not self.is_edge(u_vertex, v_vertex):
            self.indegrees[v_vertex] += 1
            self.adj_dict[u_vertex].append(v_vertex)
            return True

        return False
695404
def add_edges(self, edges, *args, **kwargs):
        
        for edge in edges:
            self.add_edge(edge, *args, **kwargs)
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);
    }
800244
def without_edge(self, edge: Edge) -> 'BipartiteGraph[TLeft, TRight, TEdgeValue]':
        """"""
        return BipartiteGraph((e2, v) for e2, v in self._edges.items() if edge != e2)
1320308
def p_edgesigs(self, p):
        ''
        p[0] = p[1] + (p[3],)
        p.set_lineno(0, p.lineno(1))
845880
public Graph<T> reduce() {
        Builder<T> builder = new Builder<>();
        nodes.stream()
                .forEach(u -> {
                    builder.addNode(u);
                    edges.get(u).stream()
                         .filter(v -> !pathExists(u, v, false))
                         .forEach(v -> builder.addEdge(u, v));
                });
        return builder.build();
    }
1365475
def exist_edge(self, graph, orig, dest, idx, branch, turn, tick, extant):
        """"""
        if (branch, turn, tick) in self._btts:
            raise TimeError
        self._btts.add((branch, turn, tick))
        graph, orig, dest = map(self.pack, (graph, orig, dest))
        self._edges2set.append((graph, orig, dest, idx, branch, turn, tick, extant))
1124543
protected void setUpEdges(GrayS32 input , GrayS32 output  ) {
		if( connectRule == ConnectRule.EIGHT ) {
			setUpEdges8(input,edgesIn);
			setUpEdges8(output,edgesOut);

			edges[0].set( 1, 0);
			edges[1].set( 1, 1);
			edges[2].set( 0, 1);
			edges[3].set(-1, 0);
		} else {
			setUpEdges4(input,edgesIn);
			setUpEdges4(output,edgesOut);

			edges[0].set( 1,0);
			edges[1].set( 0, 1);
		}
	}
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
1230161
def shrink_to_node(self, scc):
        """"""
        assert not self.final, 'Trying to mutate a final graph.'
        self.graph.add_node(scc)
        edges = list(self.graph.edges)
        for k, v in edges:
            if k not in scc and v in scc:
                self.graph.remove_edge(k, v)
                self.graph.add_edge(k, scc)
            elif k in scc and v not in scc:
                self.graph.remove_edge(k, v)
                self.graph.add_edge(scc, v)
        for node in scc.nodes:
            self.graph.remove_node(node)