Represents a cycle in this graph listing the nodes and connecting edges on it with the following syntax:
Base trait for graph Ordering
s.
The empty ElemOrdering.
Ordering for the path dependent type NodeT.
Represents a path in this graph listing the nodes and connecting edges on it with the following syntax:
Serves as a buffer to be populated by graph algorithms yielding a Path
.
Boolean state information stored by Graph
elements (nodes).
Boolean state information stored by Graph
elements (nodes). State flags are
represented by the bits of an Int
. These flags are mainly used to store
whether an element counts as visited with respect to a given traversal.
Abstract class for functional traversals.
The edge set of this Graph
commonly referred to as E(G).
The edge set of this Graph
commonly referred to as E(G).
Set of all contained edges.
The node (vertex) set of this Graph
commonly referred to as V(G).
The node (vertex) set of this Graph
commonly referred to as V(G).
Set of all contained nodes.
Ordering for the path dependent type EdgeT.
Decoupled implementation of state for Graph
elements.
Default edge filter letting path all edges (non-filter).
Default edge filter letting path all edges (non-filter).
Default node filter letting path all nodes (non-filter).
Default node filter letting path all nodes (non-filter).
Finds a cycle in this
graph taking optional filters and visitors into account.
Finds a cycle in this
graph taking optional filters and visitors into account., if any.
Predicate to filter the nodes to be visited during traversal.
The default value is anyNode
, that is no filtering.
A return of true
signals that the traversal is to be canceled.
Predicate to filter the edges to be visited during traversal.
The default value is anyEdge
meaning that no filtering takes place.
A positive value limits the number of layers for BFS respectively
the number of consecutive child visits before siblings are visited for DFS.
0
- the default - indicates that the traversal should have
an unlimited depth meaning that it will be continued either until
it's canceled by nodeVisitor
or until all nodes have been visited.
Function to be called on visiting a node for the first time
during a traversal. It can mutate the node or carry out any other side effect.
The default value is the empty function noNodeAction
.
Function to be called on visiting an edge.
It can mutate the node or carry out any other side effect.
The default value is the empty function noEdgeAction
.
If a NodeOrdering
or EdgeOrdering
different from noOrdering
is supplied
neighbor nodes will be sorted during the traversal. Thus it is guaranteed that
the smaller an element's ranking the sooner it will be processed. In case of
EdgeOrdering
it is guaranteed that the smaller an edge's ranking the sooner
its relevant end(s) will be processed.
A cycle or None if either
a) there exists no cycle in this
graph or
b) there exists a cycle in this
graph but due to the given
filtering conditions or a Cancel
return by a visitor this cycle
had to be disregarded.
Same as findCycle(...)
with default arguments.
Same as findCycle(...)
with default arguments.
The size - commonly referred to as ||G|| - of this graph equaling to the number of edges.
The size - commonly referred to as ||G|| - of this graph equaling to the number of edges.
Method size
is reserved for the number of nodes and edges
because Graph
is also SetLike
with set elements being nodes or edges.
Populates this graph with nodes
and edges
.
Populates this graph with nodes
and edges
.
The implementing class will typically have a constructor with the same parameters
which is invoked by from
of the companion object.
The isolated (and optionally any other) outer nodes that the node set of this graph is to be populated with.
The outer edges that the edge set of this graph is to be populated with. Nodes being the end of any of these edges will be added to the node set.
Whether this
graph has no cycle.
Whether this
graph has no cycle.
Whether this
graph is connected if it is undirected or
weakly connected if it is directed.
Whether this
graph is connected if it is undirected or
weakly connected if it is directed.
true
if filter
is not equivalent to anyEdge
.
true
if filter
is not equivalent to anyEdge
.
true
if visitor
is not equivalent to noEdgeAction
.
true
if visitor
is not equivalent to noEdgeAction
.
true
if filter
is not equivalent to anyNode
.
true
if filter
is not equivalent to anyNode
.
true
if visitor
is not equivalent to noNodeUpAction
.
true
if visitor
is not equivalent to noNodeUpAction
.
true
if visitor
is not equivalent to noNodeAction
.
true
if visitor
is not equivalent to noNodeAction
.
Whether this
graph has at least one cycle.
Whether this
graph has at least one cycle.
true
if this graph has at most 1 node.
true
if this graph has at most 1 node.
Creates a Traversal
instance allowing subsequent traversals with
constant filters and visitors.
Creates a Traversal
instance allowing subsequent traversals with
constant filters and visitors.
Determines which connected nodes the traversal has to follow.
The default value is Successors
.
Predicate to filter the nodes to be visited during traversal.
The default value is anyNode
, that is no filtering.
A return of true
signals that the traversal is to be canceled.
Predicate to filter the edges to be visited during traversal.
The default value is anyEdge
meaning that no filtering takes place.
Function to be called on visiting a node for the first time
during a traversal. It can mutate the node or carry out any other side effect.
The default value is the empty function noNodeAction
.
Function to be called on visiting an edge.
It can mutate the node or carry out any other side effect.
The default value is the empty function noEdgeAction
.
If a NodeOrdering
or EdgeOrdering
different from noOrdering
is supplied
neighbor nodes will be sorted during the traversal. Thus it is guaranteed that
the smaller an element's ranking the sooner it will be processed. In case of
EdgeOrdering
it is guaranteed that the smaller an edge's ranking the sooner
its relevant end(s) will be processed.
Default edge visitor doing nothing (non-visitor).
Default edge visitor doing nothing (non-visitor).
Node predicate always returning false
.
Node predicate always returning false
.
Default node visitor doing nothing (non-visitor).
Default node visitor doing nothing (non-visitor).
Default node-up visitor doing nothing (non-visitor).
Default node-up visitor doing nothing (non-visitor).
true
if this graph has at least 2 nodes.
true
if this graph has at least 2 nodes.
The order - commonly referred to as |G| - of this graph equaling to the number of nodes.
The order - commonly referred to as |G| - of this graph equaling to the number of nodes.