GraphDFS
The GraphDFS
performs Depth First Search (DFS) or Breadth First Search (BFS) on a Directed Graph. The class currently supports three predicates: (1) to find a matching label, and (2) to see if a destination vertex is reachable.
Value parameters
- bfs
-
switch from DFS to BFS, if bfs flag is true (defaults to false)
- g
-
the directed graph to search
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Find the label lab in this graph, returning the first vertex id with a matching label, or -1 if vertex is not found.
Find the label lab in this graph, returning the first vertex id with a matching label, or -1 if vertex is not found.
Value parameters
- _lab
-
the label to search for
Attributes
Determine whether vertex _dest is reachable from src, i.e., there is a directed path from vertex src to _dest.
Determine whether vertex _dest is reachable from src, i.e., there is a directed path from vertex src to _dest.
Value parameters
- _dest
-
the destination/ending vertex
- src
-
the source/starting vertex
Attributes
Count the number of strongly connected components in the graph. In a strongly connected component, reach (u, v) is always true.
Count the number of strongly connected components in the graph. In a strongly connected component, reach (u, v) is always true.
Attributes
Visit vertices in DFS/BFS order, returning the id of the first vertex satisfying the predicate pred, or -1 if vertex is not found.
Visit vertices in DFS/BFS order, returning the id of the first vertex satisfying the predicate pred, or -1 if vertex is not found.
Value parameters
- pred
-
the predicate to satisfy
Attributes
Visit vertices in DFS/BFS order accessing children and parents (as if it is an undirected graph).
Visit vertices in DFS/BFS order accessing children and parents (as if it is an undirected graph).
Value parameters
- pred
-
the predicate to satisfy
Attributes
Count the number of weakly connected components in the graph. In a weakly connected component, the vertices in the underlying undirected graph are connected.
Count the number of weakly connected components in the graph. In a weakly connected component, the vertices in the underlying undirected graph are connected.