ConstReturns the in-nodes of all nodes, node after node.
A position in this array is the edge index of the edge in the transposed graph, not in
graph.
Time: O(1).
the graph
the graph's own array, of length edgeCount; not to be modified
Returns where the in-nodes of each node start in Csr.inAdjacency, followed by
edgeCount.
Time: O(1).
the graph
the graph's own array, of length nodeCount + 1; not to be modified
Returns the out-nodes of all nodes, node after node, at the positions of their edge indices.
Time: O(1).
the graph
the graph's own array, of length edgeCount; not to be modified
Returns where the out-nodes of each node start in Csr.outAdjacency, followed by
edgeCount.
Time: O(1).
the graph
the graph's own array, of length nodeCount + 1; not to be modified
Access to the arrays in which a graph keeps its edges, for algorithm code that loops over all edges. These arrays are called the CSR (compressed sparse row) layout of the graph.
Each method returns the graph's own array, not a copy. The out-nodes of node
vareoutAdjacency[outAdjacencyStart[v]..outAdjacencyStart[v + 1] - 1], in ascending order, and the position of an out-node inoutAdjacencyis the edge index of its edge.outAdjacencyStarthasnodeCount + 1values, from0toedgeCount. A loop loads the two arrays into local variables once and reads them without a method call or an argument check per edge. Here,callsholds the calls between the methods of a program, and the loop counts the callers of each method:A BiAdjacentGraph also holds the in-nodes of every node, called its in-adjacency. The in-adjacency has the same layout, in Csr.inAdjacencyStart and Csr.inAdjacency. A position in
inAdjacencyis not an edge index of the graph, though, but of its transposed graph; Graphs.transposedEdgeMapping translates all of them in one pass.The arrays must not be modified. Nothing prevents a write, but it changes the graph for everyone who holds it and breaks what every algorithm relies on: that the graph is immutable, and that the out-nodes of each node are sorted. The algorithms of this library read the arrays the same way. Code that reads the out-nodes of a few nodes is better served by Graph.outNodes and the edge index methods of Graph, which check their arguments.