Finds cycles with a node/edge set different from this
cycle's node/edge set but
sharing at least one common node with this
cycle's node set.
Finds cycles with a node/edge set different from this
cycle's node/edge set but
sharing at least one common node with this
cycle's node set.
Currently it is not guaranteed that all such cycles will be found
as it could considerably blow up the number of cycles to be returned.
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
. Alternatively, an instance of ExtendedNodeVisitor
may be passed to obtain additional state information such as the current
depth. The concrete type of the last argument, the informer
depends on the underlying implementation so you need to match against it. Concerning this method please match against
scalax.collection.GraphTraversalImpl.WgbInformer.
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
.
List of dependent cycles.
Returns whether the contents of this path are valid with respect to path semantics.
Returns whether the contents of this path are valid with respect to path semantics. This check is appropriate whenever there may be any doubt about the correctness of the result of an algorithm.
Semantically compares this
cycle with that
cycle.
Semantically compares this
cycle with that
cycle. While ==
returns true
only if the cycles contain the same elements in the same order, this comparison
returns also true
if the elements of that
cycle can be shifted and optionally
reversed such that their elements have the same order.
For instance, given
c1 = Cycle(1-2-3-1)
, c2 = Cycle(2-3-1-2)
and c3 = Cycle(2-1-3-2)
the following expressions hold:
c1 != c2
, c1 != c3
but c1 sameAs c2
and c1 sameAs c3
.
Same as dependentCycles(...)
with default arguments.
Same as dependentCycles(...)
with default arguments.
Iterator over the edges of this path.
Iterator over the edges of this path. The result is chached on the first call, so consecutive calls of this method are cheep.
Iterator over all edges of this path in proper order.
List containing all edges of this path in proper order.
List containing all edges of this path in proper order.
The number of edges on this path.
The number of edges on this path.
Iterator over the nodes of this path.
Iterator over the nodes of this path. The result is chached on the first call, so consecutive calls of this method are cheep.
Iterator over all nodes of this path in proper order.
List containing all nodes of this path in proper order.
List containing all nodes of this path in proper order.
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
The cumulated weight of all edges on this path.
The cumulated weight of all edges on this path.
(Since version 2.10.0) use fold instead
Represents a cycle in this graph listing the nodes and connecting edges on it with the following syntax:
cycle ::= start-end-node { edge node } edge start-end-node
All nodes and edges on the path are distinct except the start and end nodes that are equal. A cycle contains at least a start node followed by any number of consecutive pairs of an edge and a node and the end node equaling to the start node. The first element is the start node, the second is an edge with its tail being the start node and its head being the third element etc.