IndexedEdgeList

Graph data type based on igraph's igraph_t. The basic data structure is a pair of arrays whose entries consist of respectively the source (tail) and destination (head) vertices of the edges in the graph. These are extended by sorted indices and cumulative sums that enable fast calculation of graph properties from the stored data.

Members

Aliases

directed
alias directed = dir

Static boolean value indicating whether or not the graph is directed. This is available for compile-time as well as runtime checks.

Functions

addEdge
void addEdge(size_t tail, size_t head)
void addEdge(T[] edgeList)

Add new edges to the graph. These may be provided either singly, by passing an individual (tail, head) pair, or en masse by passing an array whose entries are [tail1, head1, tail2, head2, ...]. Duplicate edges are permitted.

degree
size_t degree(in size_t v)

Provides the degree of a vertex v in an undirected graph.

degreeIn
size_t degreeIn(in size_t v)
degreeOut
size_t degreeOut(in size_t v)

Provide respectively the in- and out-degrees of a vertex v, i.e. the number of vertices to which v is connected by respectively incoming or outgoing links. If the graph is undirected, these values are identical and the general degree method is also defined.

edge
auto edge()

Returns a list of all edges in the graph in the form of a list of (tail, head) vertex pairs.

edgeCount
size_t edgeCount()

Total number of edges in the graph.

edgeID
size_t edgeID(size_t tail, size_t head)

Returns the edge index for a given (tail, head) vertex pair. If (tail, head) is not an edge, will throw an exception.

incidentEdges
auto incidentEdges(in size_t v)

Returns the IDs of edges respectively incoming to or outgoing from the specified vertex v. If the graph is undirected the two will be identical and the general method incidentEdges is also defined.

incidentEdgesIn
auto incidentEdgesIn(in size_t v)
incidentEdgesOut
auto incidentEdgesOut(in size_t v)

Returns the IDs of edges respectively incoming to or outgoing from the specified vertex v. If the graph is undirected the two will be identical and the general method incidentEdges is also defined.

isEdge
bool isEdge(size_t tail, size_t head)

Checks if a given (tail, head) vertex pair forms an edge in the graph.

neighbours
auto neighbours(in size_t v)

Returns the IDs of vertices connected to v via incoming or outgoing links. If the graph is undirected the two will be identical and the general neighbours method is also defined.

neighboursIn
auto neighboursIn(in size_t v)
neighboursOut
auto neighboursOut(in size_t v)

Returns the IDs of vertices connected to v via incoming or outgoing links. If the graph is undirected the two will be identical and the general neighbours method is also defined.

vertexCount
size_t vertexCount()
size_t vertexCount(in size_t n)

Get or set the total number of vertices in the graph. Will throw an exception if resetting the number of vertices would delete edges.

Meta