the array of vertex (child) adjacency list (outgoing edges)
the array of vertex labels
the map of edge labels
whether to store inverse adjacency list (parents)
the array of vertex (child) adjacency list (outgoing edges)
Given an array of labels, returns an index from labels to the lists of vertices containing those labels
Given an array of labels, returns an index from labels to the lists of vertices containing those labels
the array of vertex labels of type TLabel
the map of edge labels
Returns the list of vertices in the graph with label 'l'.
Returns the list of vertices in the graph with label 'l'.
the vertex label
whether to store inverse adjacency list (parents)
Determines whether or not the graph is connected.
the array of vertex labels
the map from label to the list of vertices with the label
Add the inverse adjacency list for rapid accesses to parent vertices.
Returns the number of edges in the graph.
Determines the number of vertices in the graph that have outgoing edges to themselves.
the optional array of vertex inverse (parent) adjacency list (incoming edges)
Prints the adjacency list, labels, and labelMap of the graph.
Returns the number of vertices in the graph.
Indicate basic information about this graph.
Indicate basic information about this graph. Due to its potential size, use print to show graph details.
The
Graph2
class is used for representing "Directed Graphs". It uses an adjacency list 'adj' representation, e.g., adj = { (1, 2), (0), (1) } means that the graph has the following edges { (0, 1), (0, 2), (1, 0), (2, 1) }. Options: (1) the graph may have vertex labels, (2) the graph may have edge labels, and (3) the graph may maintain inverse adjacency via the parent 'par' array can be stored at the cost of nearly doubling the storage requirements.the array of vertex (child) adjacency list (outgoing edges)
the array of vertex labels
the map of edge labels
whether to store inverse adjacency list (parents)