Topologically ordered nodes or layers of a topological order of a graph or of an isolated graph component.
Topologically ordered nodes or layers of a topological order of a graph or of an isolated graph component.
one of NodeT
, N
one of A
or (Int, Iterable[A])
LazyPath
where edges are selected by taking the first one fitting.
LazyPath
where edges are selected by taking the first one fitting.
Represents a component of this
graph.
Represents a component of this
graph.
Edges and bridges are computed lazily.
Components will be instantiated by componentTraverser or strongComponentTraverser.
Represents a cycle in this graph listing the nodes and connecting edges on it with the following syntax:
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.
Either a Right
containing a valid topological order or a Left
containing a node on a cycle.
Either a Right
containing a valid topological order or a Left
containing a node on a cycle.
Base trait for graph Ordering
s.
Base trait for graph Ordering
s.
Template for extended node visitors.
Template for extended node visitors.
While the default node visitor of the type NodeT => U
passes solely the inner node being visited, extended node visitors
pass the following traversal state information:
Properties and methods for creating modified properties in a fluent-interface manner.
Properties and methods for creating modified properties in a fluent-interface manner.
Represents a topological sort layer.
Represents a topological sort layer.
Layers of a topological order of a graph or of an isolated graph component.
Layers of a topological order of a graph or of an isolated graph component. The layers of a topological sort can roughly be defined as follows:
one of NodeT
, N
The result of a topological sort in the layered view.
The result of a topological sort in the layered view.
Path based on the passed collection of nodes with lazy evaluation of edges.
Path based on the passed collection of nodes with lazy evaluation of edges.
Enables lazy traversing of a Map
with key = source, value = target
.
Enables lazy traversing of a Map
with key = source, value = target
.
LazyPath
with edges selected by minimal weight.
LazyPath
with edges selected by minimal weight.
LazyPath
with edge selection such that there exists no duplicate edge in the path.
LazyPath
with edge selection such that there exists no duplicate edge in the path.
Ordering for the path dependent type NodeT.
Ordering for the path dependent type NodeT.
Represents a path in this graph where
Represents a path in this graph where
path
::= node { edge node }
Nodes and edges on the path are distinct. A walk/path contains at least one node followed by any number of consecutive pairs of an edge and a node. The first element is the start node, the second is an edge with its source being the start node and its target being the third element etc.
Properties controlling traversals.
Properties controlling traversals.
Efficient reverse foreach
overcoming ArrayStack
's deficiency
not to overwrite reverseIterator
.
Efficient reverse foreach
overcoming ArrayStack
's deficiency
not to overwrite reverseIterator
.
LazyPath
with deferred edges selection.
LazyPath
with deferred edges selection.
Properties controlling the scope of traversals.
Properties controlling the scope of traversals.
A traversable topological order of nodes of a graph or of an isolated graph component.
A traversable topological order of nodes of a graph or of an isolated graph component.
one of NodeT
, N
Controls the properties of consecutive graph traversals starting at a root node.
Controls the properties of consecutive graph traversals starting at a root node. Provides methods to refine the properties and to invoke traversals. Instances will be created by innerNodeTraverser etc.
The root
-related methods Traverser will inherit.
The root
-related methods Traverser will inherit.
Represents a walk in this graph where walk
::= node { edge node }
A walk/path contains at least one node followed by any number of
consecutive pairs of an edge and a node.
Represents a walk in this graph where walk
::= node { edge node }
A walk/path contains at least one node followed by any number of
consecutive pairs of an edge and a node.
The first element is the start node, the second is an edge with its source
being the start node and its target being the third element etc.
Stores a value and an edge weight function
for use in weight-based traversals that may be defined by withMaxWeight
.
Stores a value and an edge weight function
for use in weight-based traversals that may be defined by withMaxWeight
.
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.
Whether all edges of this graph are directed.
Whether all edges of this graph are directed.
Whether this graph contains at least one hyperedges.
Whether this graph contains at least one hyperedges.
Whether this graph contains at least one multi-edge.
Whether this graph contains at least one multi-edge. We defnie multi-edges by
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.
Ordering for the path dependent type EdgeT.
The empty ElemOrdering.
The empty ElemOrdering.
Default edge filter letting path all edges (non-filter).
Default edge filter letting path all edges (non-filter).
An arbitrary edge between from
and to
that is available most efficiently.
An arbitrary edge between from
and to
that is available most efficiently.
Default node filter letting traverse all nodes (non-filter).
Default node filter letting traverse all nodes (non-filter).
Creates a ComponentTraverser responsible for invoking graph traversal methods in all (weekly) connected components of this possibly disconnected graph.
Creates a ComponentTraverser responsible for invoking graph traversal methods in all (weekly) connected 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 visited during the traversal according to this ordering.
An optional maximum weight that limits the scope of the traversal or search. If defined and the sum of edge weights between the root of the traversal and a node exceeds the given maximum, that node will no more be visited.
Returns a copy of the current dirty
-flags for dump purposes.
Returns a copy of the current dirty
-flags for dump purposes.
Returns a copy of the current inUse
-flags for dump purposes.
Returns a copy of the current inUse
-flags for dump purposes.
Finds a cycle in this
graph in any of its components
and calls visitor
for each inner element visited during the search.
Finds a cycle in this
graph in any of its components
and calls visitor
for each inner element visited during the search.
See componentTraverser
for more control by means of FluentProperties
.
Calculates in-degrees of nodes spanned by traversable
.
Calculates in-degrees of nodes spanned by traversable
.
supplies the nodes for which the degree is to be calculated
to be used to mark visited nodes
include this node in the resulting list of nodes without predecessors irrespective of its in degree
optionally filters predecessor nodes when calculation the in degree
triple of
traverser
traversable
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.
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 visited during the traversal according to this ordering.
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 visited during the traversal according to this ordering.
An optional maximum weight that limits the scope of the traversal or search. If defined and the sum of edge weights between the root of the traversal and a node exceeds the given maximum, that node will no more be visited.
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 visited during the traversal according to this ordering.
An optional maximum weight that limits the scope of the traversal or search. If defined and the sum of edge weights between the root of the traversal and a node exceeds the given maximum, that node will no more be visited.
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 visited during the traversal according to this ordering.
An optional maximum weight that limits the scope of the traversal or search. If defined and the sum of edge weights between the root of the traversal and a node exceeds the given maximum, that node will no more be visited.
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.
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 f
is not equivalent to anyNode
.
true
if f
is not equivalent to anyNode
.
Whether this
graph has at least one cycle in any of its components.
Whether this
graph has at least one cycle in any of its components.
true
if this graph has at most 1 node.
true
if this graph has at most 1 node.
Instantiates a PathBuilder for this graph.
Instantiates a PathBuilder for this graph.
The node this path starts at.
Expected maximum number of nodes on this path.
Determines the edge to be selected between neighbor nodes if an edge is not supplied explicitly. This is only relevant in case of multigraphs.
Instantiates a WalkBuilder for this graph.
Instantiates a WalkBuilder for this graph.
The node this walk starts at.
Expected maximum number of nodes on this walk.
Determines the edge to be selected between neighbor nodes if an edge is not supplied explicitly. This is only relevant in case of multigraphs.
Avoid calling this directly, prefer withHandle
instead.
Avoid calling this directly, prefer withHandle
instead.
Node predicate always returning false
.
Node predicate always returning false
.
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.
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 visited during the traversal according to this ordering.
An optional maximum weight that limits the scope of the traversal or search. If defined and the sum of edge weights between the root of the traversal and a node exceeds the given maximum, that node will no more be visited.
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 visited during the traversal according to this ordering.
An optional maximum weight that limits the scope of the traversal or search. If defined and the sum of edge weights between the root of the traversal and a node exceeds the given maximum, that node will no more be visited.
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 visited during the traversal according to this ordering.
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 visited during the traversal according to this ordering.
An optional maximum weight that limits the scope of the traversal or search. If defined and the sum of edge weights between the root of the traversal and a node exceeds the given maximum, that node will no more be visited.
Avoid calling this directly, prefer withHandle
instead.
Avoid calling this directly, prefer withHandle
instead.
Creates a StrongComponentTraverser.
Creates a StrongComponentTraverser.
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 visited during the traversal according to this ordering.
An optional maximum weight that limits the scope of the traversal or search. If defined and the sum of edge weights between the root of the traversal and a node exceeds the given maximum, that node will no more be visited.
Sorts this graph topologically.
Sorts this graph topologically.
called for each inner node or inner edge visited during the sort.
See componentTraverser
for more control by means of FluentProperties
.
Sorts every isolated component of this graph topologically.
Sorts every isolated component of this graph topologically.
called for each inner node or inner edge visited during the sort.
See componentTraverser
for more control by means of FluentProperties
.
Executes a code block in the context of a new or reused state handler.
Executes a code block in the context of a new or reused state handler.
The result of the code block executed.
Executes a code block in the context nr
new state handlers
or alternatively in the context of the state handlers reuse
.
Executes a code block in the context nr
new state handlers
or alternatively in the context of the state handlers reuse
.
The result of the code block executed.
(graphTraversalImpl: OuterNode[GraphTraversalImpl[N, E]]).toString()
Default implementation of the functionality defined by GraphTraversal except for algorithms that are placed in TraverserImpl.