Represents a component of this
graph by a lazy implementation.
Controls the properties of consecutive graph traversals with no specific root.
Represents a cycle in this graph listing the nodes and connecting edges on it with the following syntax:
Base trait for graph Ordering
s.
Template for extended node visitors.
Properties and methods for creating modified properties in a fluent-interface manner.
Controls the properties of inner-edge graph traversals.
Controls the properties of inner-element graph traversals.
Controls the properties of inner-node down-up graph traversals.
Controls the properties of inner-node graph traversals.
The empty ElemOrdering.
Ordering for the path dependent type NodeT.
Controls the properties of outer-edge graph traversals.
Controls the properties of outer-element graph traversals.
Controls the properties of outer-node down-up graph traversals.
Controls the properties of outer-node graph traversals.
Represents a path in this graph where
Properties controlling traversals.
Controls the properties of consecutive graph traversals starting at a root node.
The root
-related methods Traverser will inherit.
Represents a walk in this graph where
Abstract class for functional traversals.
Creates a ComponentTraverser responsible for invoking graph traversal methods that cover all components of this possibly disconnected graph.
Creates a ComponentTraverser responsible for invoking graph traversal methods that cover all components of this possibly disconnected graph.
The properties controlling subsequent traversals.
Restricts subsequent graph traversals to visit only nodes holding this predicate.
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
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.
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.
Creates a InnerEdgeTraverser based on scala.collection.Traversable[EdgeT]
.
Creates a InnerEdgeTraverser based on scala.collection.Traversable[EdgeT]
.
The node where subsequent graph traversals start.
The properties controlling subsequent traversals.
Restricts subsequent graph traversals to visit only nodes holding this predicate.
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
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.
Creates a InnerElemTraverser based on scala.collection.Traversable[InnerElem]
.
Creates a InnerElemTraverser based on scala.collection.Traversable[InnerElem]
.
The node where subsequent graph traversals start.
The properties controlling subsequent traversals.
Restricts subsequent graph traversals to visit only nodes holding this predicate.
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
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.
Creates a InnerNodeDownUpTraverser based on scala.collection.Traversable[(Boolean, NodeT)]
where the Boolean
parameter is true
if the traversal takes place
in downward and false
if it takes place in upward direction.
Creates a InnerNodeDownUpTraverser based on scala.collection.Traversable[(Boolean, NodeT)]
where the Boolean
parameter is true
if the traversal takes place
in downward and false
if it takes place in upward direction.
The node where subsequent graph traversals start.
The properties controlling subsequent traversals. A kind
different from DepthFirst
will be ignored.
Restricts subsequent graph traversals to visit only nodes holding this predicate.
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
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.
Creates a InnerNodeTraverser based on scala.collection.Traversable[NodeT]
.
Creates a InnerNodeTraverser based on scala.collection.Traversable[NodeT]
.
The node where subsequent graph traversals start.
The properties controlling subsequent traversals.
Restricts subsequent graph traversals to visit only nodes holding this predicate.
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
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.
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.
Creates a OuterEdgeTraverser based on scala.collection.Traversable[E[N]]
.
Creates a OuterEdgeTraverser based on scala.collection.Traversable[E[N]]
.
The node where subsequent graph traversals start.
The properties controlling subsequent traversals.
Restricts subsequent graph traversals to visit only nodes holding this predicate.
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
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.
Creates a OuterElemTraverser based on scala.collection.Traversable[OuterElem]
.
Creates a OuterElemTraverser based on scala.collection.Traversable[OuterElem]
.
The node where subsequent graph traversals start.
The properties controlling subsequent traversals.
Restricts subsequent graph traversals to visit only nodes holding this predicate.
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
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.
Creates a OuterNodeDownUpTraverser based on scala.collection.Traversable[(Boolean, N)]
where the Boolean
parameter is true
if the traversal takes place
in downward and false
if it takes place in upward direction.
Creates a OuterNodeDownUpTraverser based on scala.collection.Traversable[(Boolean, N)]
where the Boolean
parameter is true
if the traversal takes place
in downward and false
if it takes place in upward direction.
The node where subsequent graph traversals start.
The properties controlling subsequent traversals. A kind
different from DepthFirst
will be ignored.
Restricts subsequent graph traversals to visit only nodes holding this predicate.
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
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.
Creates a OuterNodeTraverser based on scala.collection.Traversable[N]
.
Creates a OuterNodeTraverser based on scala.collection.Traversable[N]
.
The node where subsequent graph traversals start.
The properties controlling subsequent traversals.
Restricts subsequent graph traversals to visit only nodes holding this predicate.
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
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.
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
. 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.DfsInformer or
scalax.collection.GraphTraversalImpl.BfsInformer depending on the
breadthFirst
argument.
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.
(Since version 1.8.0) use one of Traverser factory methods instead.
Ordering for the path dependent type EdgeT.
Default edge filter letting path all edges (non-filter).
Default node filter letting path all nodes (non-filter).
Finds a cycle in this
graph and calls visitor
for each inner element
visited during the search.
Finds a cycle in this
graph and calls visitor
for each inner element
visited during the search.
Use componentTraverser
to pass non-default arguments.
Finds a cycle in this
graph.
Finds a cycle in this
graph.
Use componentTraverser
to pass non-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 all nodes are pairwise adjacent.
Whether all nodes are pairwise adjacent.
true
if this graph is complete, false
if this graph contains any
independent nodes.
Whether this
graph is connected if it is undirected or
weakly connected if it is directed.
true
if f
is not equivalent to anyEdge
.
true
if f
is not equivalent to anyEdge
.
true
if v
is not equivalent to noEdgeAction
.
true
if v
is not equivalent to noEdgeAction
.
true
if f
is not equivalent to anyNode
.
true
if f
is not equivalent to anyNode
.
true
if v
is not equivalent to noNodeUpAction
.
true
if v
is not equivalent to noNodeUpAction
.
true
if v
is not equivalent to noNodeAction
.
true
if v
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.
Default edge visitor doing nothing (non-visitor).
Node predicate always returning false
.
Default node 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.
(graphTraversal: OuterNode[GraphTraversal[N, E]]).toString()
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 limiting the number of layers for Bfs respectively
the number of consecutive child visits before siblings are visited for Dfs.
0
, the default value, indicates that the traversal should have
an unlimited depth meaning that it will be continued until either
it's canceled or 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
.
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
this
graph orthis
graph but due to the given
filtering conditions or a Cancel
return by a visitor this cycle
had to be disregarded.
(Since version 1.8.0) Use componentTraverser instead.
Graph-related functionality such as traversal, path finding, cycle detection etc. All algorithms including breadth-first, depth-first, white-gray-black search and Dijkstra's algorithm are tail recursive.
Before starting a traversal a
Traverser
such as InnerNodeTraverser is instantiated explicitly or implicitly. It holds settings likemaxDepth
,subgraph
orordering
providing a fine-grained control of the traversal.Traverser
s also extendscala.collection.Traversable
meaning that you can process the visited nodes and edges in a functional way.http://www.scala-graph.org/guides/core-traversing