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])
Represents a component of this
graph with an underlying lazy implementation.
Represents a component of this
graph with an underlying lazy implementation.
Instances will be created by traversals based on componentTraverser.
Controls the properties of graph traversals with no specific root.
Controls the properties of graph traversals with no specific root. Provides methods to refine the properties and to invoke multiple traversals to span all graph components.
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.
Type alias for entries in degree maps returned by degreeSeqMap
.
Type alias for entries in degree maps returned by degreeSeqMap
.
Decreasing ordering of nodes with respect to their degree.
Decreasing ordering of nodes with respect to their degree.
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.
Controls the properties of inner-edge graph traversals.
Controls the properties of inner-edge graph traversals. To start a traversal call one of the graph traversal methods or any appropriate method inherited from scala.collection.Traversable on this instance.
Controls the properties of inner-element graph traversals.
Controls the properties of inner-element graph traversals. To start a traversal call one of the graph traversal methods or any appropriate method inherited from scala.collection.Traversable on this instance.
Controls the properties of inner-node down-up graph traversals.
Controls the properties of inner-node down-up graph traversals. To start a traversal call one of the graph traversal methods or any appropriate method inherited from scala.collection.Traversable on this instance.
Controls the properties of inner-node graph traversals.
Controls the properties of inner-node graph traversals. To start a traversal call one of the graph traversal methods or any appropriate method inherited from scala.collection.Traversable on this instance.
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.
Ordering for the path dependent type NodeT.
Ordering for the path dependent type NodeT.
Controls the properties of outer-edge graph traversals.
Controls the properties of outer-edge graph traversals. To start a traversal call one of the graph traversal methods or any appropriate method inherited from scala.collection.Traversable on this instance.
Controls the properties of outer-element graph traversals.
Controls the properties of outer-element graph traversals. To start a traversal call one of the graph traversal methods or any appropriate method inherited from scala.collection.Traversable on this instance.
Controls the properties of outer-node down-up graph traversals.
Controls the properties of outer-node down-up graph traversals. To start a traversal call one of the graph traversal methods or any appropriate method inherited from scala.collection.Traversable on this instance.
Controls the properties of outer-node graph traversals.
Controls the properties of outer-node graph traversals. To start a traversal call one of the graph traversal methods or any appropriate method inherited from scala.collection.Traversable on this instance.
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.
A Builder
for valid paths in this graph.
A Builder
for valid paths in this graph.
Nodes and edges may be added either alternating or node by node respectively edge by edge. Either way, the builder ensures that the added elements build a valid path.
A node addition fails if either the node to be added is already contained or the node is not a direct successor of the previously added node or of the target node of the previously added edge. An edge addition fails if either the edge to be added is is already contained or the edge is not an outgoing edge from the previously added node or of the target node of the previously added edge.
It is recommended using add
instead of +=
to track failed
additions.
Properties controlling traversals.
Properties controlling traversals.
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.
A Builder
for valid walks in this graph.
A Builder
for valid walks in this graph.
Nodes and edges may be added either alternating or node by node respectively edge by edge. Either way, the builder ensures that the added elements build a valid walk.
A node addition fails if the node to be added is not a direct successor of the previously added node or of the target node of the previously added edge. An edge addition fails if the edge to be added is not an outgoing edge from the previously added node or of the target node of the previously added edge.
It is recommended using add
instead of +=
to track failed
additions.
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
.
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 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.
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 companion object of This
.
The companion object of This
.
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.
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.
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 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.
Shrinks this graph to its intersection with coll
.
Shrinks this graph to its intersection with coll
.
Collection of nodes and/or edges to intersect with;
this graph shrinked by the nodes and edges not contained in coll
.
Creates a new supergraph with an additional node, unless the node passed is already present.
Creates a new supergraph with an additional node or edge, unless the node or edge passed is already present.
Creates a new supergraph with an additional node or edge, unless the node or edge passed is already present.
This method purely wraps +(node: N)
respectively +(edge: E[N])
granting the same behavior.
the wrapped node or edge to be added; ; if elem
is of type N,
the wrapped object is added to the node set otherwise to the edge set.
a new supergraph containing all nodes and edges of this graph
plus elem
.
Creates a new supergraph with an additional edge, unless the edge passed is already present.
Same as addWLEdge(node_1, node_2, nodes)(weight, label)
except for the returned result.
Same as addWLEdge(node_1, node_2, nodes)(weight, label)
except for the returned result.
This mutable graph containing the hyperedge that has been created or found.
to be created equals
to an already existing hyperedge.
Same as addWLEdge(node_1, node_2)(weight, label)
except for the returned result.
Same as addWLEdge(node_1, node_2)(weight, label)
except for the returned result.
This mutable graph containing the edge that has been created or found.
Same as addWEdge(node_1, node_2, nodes)(weight)
except for the returned result.
Same as addWEdge(node_1, node_2, nodes)(weight)
except for the returned result.
This mutable graph containing the hyperedge that has been created or found.
to be created equals
to an already existing hyperedge.
Same as addWEdge(node_1, node_2)(weight)
except for the returned result.
Same as addWEdge(node_1, node_2)(weight)
except for the returned result.
This mutable graph containing the edge that has been created or found.
Same as addLEdge(node_1, node_2, nodes)(label)
except for the returned result.
Same as addLEdge(node_1, node_2, nodes)(label)
except for the returned result.
This mutable graph containing the hyperedge that has been created or found.
to be created equals
to an already existing hyperedge.
Same as addLEdge(node_1, node_2)(label)
except for the returned result.
Same as addLEdge(node_1, node_2)(label)
except for the returned result.
This mutable graph containing the edge that has been created or found.
Same as addEdge(node_1, node_2, nodes)
except for the returned result.
Same as addEdge(node_1, node_2, nodes)
except for the returned result.
This mutable graph containing the hyperedge that has been created or found.
to be created equals
to an already existing hyperedge.
Same as addEdge(node_1, node_2)
except for the returned result.
Same as addEdge(node_1, node_2)
except for the returned result.
This mutable graph containing the edge that has been created or found.
Creates a new subgraph consisting of all nodes and edges of this graph except node
and those edges which node
is incident with.
Creates a new subgraph consisting of all nodes and edges of this graph except elem
.
Creates a new subgraph consisting of all nodes and edges of this graph except elem
.
If elem
is of type N, this method maps to -(node: N)
. Otherwise the edge is deleted
leaving the node set unchanged.
node or edge to be removed.
the new subgraph of this graph after the "ripple" deletion of the passed node or the simple deletion of the passed edge.
Creates a new subgraph consisting of all nodes and edges of this graph except elem
.
Creates a new subgraph consisting of all nodes and edges of this graph except elem
.
If elem
is of type N, this method maps to -(node: N)
. Otherwise the edge is deleted
along with those incident nodes which would become edge-less after deletion.
node or edge to be removed.
a new subgraph of this graph after the "ripple" deletion of the passed node or edge.
Creates a new subgraph consisting of all nodes and edges of this graph except edge
and those nodes which are incident with edge
and would become edge-less after deletion.
Creates a new subgraph consisting of all nodes and edges of this graph except edge
and those nodes which are incident with edge
and would become edge-less after deletion.
the edge to be removed.
a new subgraph of this graph after the "ripple" deletion of edge
from
this graph.
Creates a new subgraph consisting of all nodes and edges of this graph but edge
.
Creates a new subgraph consisting of all nodes and edges of this graph but edge
.
The node set remains unchanged.
the edge to be removed.
a new subgraph of this graph that contains all nodes and edges of this graph
except of edge
.
Creates a new subgraph consisting of all nodes and edges of this graph but the elements
of coll
which will be unconditionally removed.
Creates a new subgraph consisting of all nodes and edges of this graph but the elements
of coll
which will be unconditionally removed. This operation differs from --
in that edges are deleted along with those incident nodes which would become isolated
after deletion.
the new subgraph containing all nodes and edges of this graph
after the "ripple" deletion of nodes and the simple deletion of edges in coll
.
Removes all elements of coll
from this graph.
Removes all elements of coll
from this graph. Edges will be ripple removed.
Collection of nodes and/or edges to be removed; if the element type is N, it is removed from the node set otherwise from the edge set.
this graph shrinked by the nodes and edges contained in coll
.
Creates a new subgraph consisting of all nodes and edges of this graph but node
which is conditionally removed from this graph.
Creates a new subgraph consisting of all nodes and edges of this graph but node
which is conditionally removed from this graph. The removal only succeeds if the node
is not incident with any edges or it is only incident with hooks.
the node to be gently removed.
the new subgraph of this graph after the "gentle" deletion of node
.
If node
could not be deleted, the new graph is a copy of this graph.
Ordering for the path dependent type EdgeT.
Ordering for the path dependent type EdgeT.
Decreasing ordering of integers.
Decreasing ordering of integers.
The empty ElemOrdering.
The empty ElemOrdering.
Adds a node to this graph.
Adds a node to this graph.
true
if the node was not yet present in the graph, false
otherwise.
Adds the given edge if not yet present and returns it as an inner edge.
Adds the given edge if not yet present and returns it as an inner edge.
the edge to add.
the inner edge containing the added edge.
Adds the given node if not yet present and returns it as an inner node.
Adds the given node if not yet present and returns it as an inner node.
the node to add.
inner node containing the added node.
Same as addEdge(node_1, node_2, nodes)
except for the returned result.
Same as addEdge(node_1, node_2, nodes)
except for the returned result.
The new hyperedge or the corresponding contained hyperedge if the hyperedge
to be created equals
to an already existing hyperedge.
Same as addEdge(node_1, node_2)
except for the returned result.
Same as addEdge(node_1, node_2)
except for the returned result.
The new edge or the corresponding contained edge if the edge
to be created equals
to an already existing edge.
Same as addLEdge(node_1, node_2, nodes)(label)
except for the returned result.
Same as addLEdge(node_1, node_2, nodes)(label)
except for the returned result.
The new hyperedge or the corresponding contained hyperedge if the hyperedge
to be created equals
to an already existing hyperedge.
Same as addLEdge(node_1, node_2)(label)
except for the returned result.
Same as addLEdge(node_1, node_2)(label)
except for the returned result.
The new edge or the corresponding contained edge if the edge
to be created equals
to an already existing edge.
Same as addWEdge(node_1, node_2, nodes)(weight)
except for the returned result.
Same as addWEdge(node_1, node_2, nodes)(weight)
except for the returned result.
The new hyperedge or the corresponding contained hyperedge if the hyperedge
to be created equals
to an already existing hyperedge.
Same as addWEdge(node_1, node_2)(weight)
except for the returned result.
Same as addWEdge(node_1, node_2)(weight)
except for the returned result.
The new edge or the corresponding contained edge if the edge
to be created equals
to an already existing edge.
Same as addWLEdge(node_1, node_2, nodes)(weight, label)
except for the returned result.
Same as addWLEdge(node_1, node_2, nodes)(weight, label)
except for the returned result.
The new hyperedge or the corresponding contained hyperedge if the hyperedge
to be created equals
to an already existing hyperedge.
Same as addWLEdge(node_1, node_2)(weight, label)
except for the returned result.
Same as addWLEdge(node_1, node_2)(weight, label)
except for the returned result.
The new edge or the corresponding contained edge if the edge
to be created equals
to an already existing edge.
Creates a new inner hyperedge between node_1
, node_2
and nodes
using edgeFactory
and adds it to the edge set of this graph.
Creates a new inner hyperedge between node_1
, node_2
and nodes
using edgeFactory
and adds it to the edge set of this graph.
Node arguments not yet contained in this graph will be added to the node set.
The first outer node to be incident with the edge to be created. In case of a directed edge, this becomes the source.
The second outer node to be incident with the edge to be created. In case of a directed edge, this becomes the target.
The third and possibly more inner or outer nodes to be incident with the hyperedge to be created. In case of a directed edge, these become targets.
An edge companion who's from
is to serve as the edge factory.
true
if a new hyperedge has been created. false
if no new hyperedge could be
created because there exists a corresponding equaling hyperedge.
Creates a new inner edge between node_1
and node_2
using edgeFactory
and adds it to the edge set of this graph.
Creates a new inner edge between node_1
and node_2
using edgeFactory
and adds it to the edge set of this graph.
Node arguments not yet contained in this graph will be added to the node set.
The first outer node to be incident with the edge to be created. In case of a directed edge, this becomes the source.
The second outer node to be incident with the edge to be created. In case of a directed edge, this becomes the target.
An edge companion who's from
is to serve as the edge factory.
true
if a new edge has been created. false
if no new edge could be
created because there exists a corresponding equaling edge.
Creates a new weighted and labeled inner hyperedge between node_1
, node_2
and nodes
using edgeFactory
and adds it to the edge set of this graph.
Creates a new weighted and labeled inner hyperedge between node_1
, node_2
and nodes
using edgeFactory
and adds it to the edge set of this graph.
Node arguments not yet contained in this graph will be added to the node set.
The first outer node to be incident with the edge to be created. In case of a directed edge, this becomes the source.
The second outer node to be incident with the edge to be created. In case of a directed edge, this becomes the target.
The third and possibly more inner or outer nodes to be incident with the hyperedge to be created. In case of a directed edge, these become targets.
The value the labeled edge to be created should have as its label.
An edge companion who's from
is to serve as the edge factory.
true
if a new hyperedge has been created. false
if no new hyperedge could be
created because there exists a corresponding equaling hyperedge.
Creates a new labeled inner edge between node_1
and node_2
using edgeFactory
and adds it to the edge set of this graph.
Creates a new labeled inner edge between node_1
and node_2
using edgeFactory
and adds it to the edge set of this graph.
Node arguments not yet contained in this graph will be added to the node set.
The first outer node to be incident with the edge to be created. In case of a directed edge, this becomes the source.
The second outer node to be incident with the edge to be created. In case of a directed edge, this becomes the target.
The value the labeled edge to be created should have as its label.
An edge companion who's from
is to serve as the edge factory.
true
if a new edge has been created. false
if no new edge could be
created because there exists a corresponding equaling edge.
Creates a new weighted inner hyperedge between node_1
, node_2
and nodes
using edgeFactory
and adds it to the edge set of this graph.
Creates a new weighted inner hyperedge between node_1
, node_2
and nodes
using edgeFactory
and adds it to the edge set of this graph.
Node arguments not yet contained in this graph will be added to the node set.
The first outer node to be incident with the edge to be created. In case of a directed edge, this becomes the source.
The second outer node to be incident with the edge to be created. In case of a directed edge, this becomes the target.
The third and possibly more inner or outer nodes to be incident with the hyperedge to be created. In case of a directed edge, these become targets.
The number the weighted edge to be created should have as its weight.
An edge companion who's from
is to serve as the edge factory.
true
if a new hyperedge has been created. false
if no new hyperedge could be
created because there exists a corresponding equaling hyperedge.
Creates a new weighted inner edge between node_1
and node_2
using edgeFactory
and adds it to the edge set of this graph.
Creates a new weighted inner edge between node_1
and node_2
using edgeFactory
and adds it to the edge set of this graph.
Node arguments not yet contained in this graph will be added to the node set.
The first outer node to be incident with the edge to be created. In case of a directed edge, this becomes the source.
The second outer node to be incident with the edge to be created. In case of a directed edge, this becomes the target.
The number the weighted edge to be created should have as its weight.
An edge companion who's from
is to serve as the edge factory.
true
if a new edge has been created. false
if no new edge could be
created because there exists a corresponding equaling edge.
Creates a new weighted and labeled inner hyperedge between node_1
, node_2
and nodes
using edgeFactory
and adds it to the edge set of this graph.
Creates a new weighted and labeled inner hyperedge between node_1
, node_2
and nodes
using edgeFactory
and adds it to the edge set of this graph.
Node arguments not yet contained in this graph will be added to the node set.
The first outer node to be incident with the edge to be created. In case of a directed edge, this becomes the source.
The second outer node to be incident with the edge to be created. In case of a directed edge, this becomes the target.
The third and possibly more inner or outer nodes to be incident with the hyperedge to be created. In case of a directed edge, these become targets.
The number the weighted edge to be created should have as its weight.
The value the labeled edge to be created should have as its label.
An edge companion who's from
is to serve as the edge factory.
true
if a new hyperedge has been created. false
if no new hyperedge could be
created because there exists a corresponding equaling hyperedge.
Creates a new weighted and labeled inner edge between node_1
and node_2
using edgeFactory
and adds it to the edge set of this graph.
Creates a new weighted and labeled inner edge between node_1
and node_2
using edgeFactory
and adds it to the edge set of this graph.
Node arguments not yet contained in this graph will be added to the node set.
The first outer node to be incident with the edge to be created. In case of a directed edge, this becomes the source.
The second outer node to be incident with the edge to be created. In case of a directed edge, this becomes the target.
The number the weighted edge to be created should have as its weight.
The value the labeled edge to be created should have as its label.
An edge companion who's from
is to serve as the edge factory.
true
if a new edge has been created. false
if no new edge could be
created because there exists a corresponding equaling edge.
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).
Sorts all nodes of this graph by ordNode
followed by all edges sorted by ordEdge
and concatinates their string representation nodeSeparator
and edgeSeparator
respectively.
Sorts all nodes of this graph by ordNode
followed by all edges sorted by ordEdge
and concatinates their string representation nodeSeparator
and edgeSeparator
respectively.
to separate nodes by.
to separate edges by.
to separate nodes from edges by.
whether the node and edge set should be prefixed.
the node ordering defaulting to defaultNodeOrdering
.
the edge ordering defaulting to defaultEdgeOrdering
.
Prepares and calls plusPlus
or minusMinus
.
Prepares and calls plusPlus
or minusMinus
.
Checks whether a given node or edge is contained in this graph.
Checks whether a given node or edge is contained in this graph.
the node or edge the existence of which is to be checked
true if elem
is contained in this graph
The degree set of this graph projected onto a map.
The degree set of this graph projected onto a map. The keys of the map are the degrees in decreasing order while the values are the number of inner nodes having the degree of the corresponding key.
The degree sequence of this graph projected onto a sequence of tuples.
The degree sequence of this graph projected onto a sequence of tuples. The first elements of the tuples are the degrees in non-increasing order while the second elements are the corresponding inner nodes.
The degree set of this graph projected onto a map.
The degree set of this graph projected onto a map. The keys of the map are the degrees in decreasing order while the values are sets of the corresponding inner nodes.
The degree sequence of this graph, that is the non-increasing sequence of degrees over all nodes.
The degree sequence of this graph, that is the non-increasing sequence of degrees over all nodes.
The degree set of this graph, that is the decreasing set of unique degrees over all nodes.
The degree set of this graph, that is the decreasing set of unique degrees over all nodes. Same as degreeSeq without duplicates.
Graph
instances are equal if their nodes and edges turned
to outer nodes and outer edges are equal.
Graph
instances are equal if their nodes and edges turned
to outer nodes and outer edges are equal. Any TraversableOnce
instance may also be equal to this graph if its set representation
contains equalling outer nodes and outer edges. Thus the following
expressions hold:
Graph(1~2, 3) == List(1~2, 3) Graph(1~2, 3) == List(1, 2, 2, 3, 2~1)
The first test is false
because of the failing nodes 1
and 2
.
The second is true because of duplicate elimination and undirected edge equivalence.
Searches for an edge node equaling to outerEdge
in this graph.
Searches for an edge node equaling to outerEdge
in this graph.
the outer edge to search for in this graph.
Some
of the inner edge found or None
.
Searches for an inner node equaling to outerNode
in this graph.
Searches for an inner node equaling to outerNode
in this graph.
Some
of the inner node found or None
.
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
.
Searches for an inner edge equaling to outerEdge
in this graph
which must exist in this graph.
Searches for an inner edge equaling to outerEdge
in this graph
which must exist in this graph.
the outer edge to search for in this graph.
the inner edge if found. Otherwise NoSuchElementException is thrown.
Searches for an inner node equaling to outerNode
in this graph
which must exist in this graph.
Searches for an inner node equaling to outerNode
in this graph
which must exist in this graph.
the outer node to search for in this graph.
the inner node if found. Otherwise NoSuchElementException is thrown.
Searches for an inner edge equaling to outerEdge
in this graph.
Searches for an inner edge equaling to outerEdge
in this graph.
the outer edge to search for in this graph.
the inner edge to return if outerEdge
cannot be found.
the inner edge looked up or default
if no inner edge
equaling to edge
could be found.
Searches for an inner node equaling to outerNode
in this graph.
Searches for an inner node equaling to outerNode
in this graph.
the outer node to search for in this graph.
the inner node to return if outerNode
is not contained.
The inner node looked up or default
if no inner node
equaling to outerNode
could be found.
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.
Provides a shortcut for predicates involving any graph element.
Provides a shortcut for predicates involving any graph element.
In order to compute a subgraph of this graph, the result of this method
may be passed to any graph-level method requiring a predicate such as
count
, exists
, filter
, filterNot
, forall
etc. For instance
val g = Graph(2~>3, 3~>1, 5) g filter g.having(nodes = _ >= 2) // yields Graph(2, 3, 5, 2~>3)
The predicate that must hold for the nodes.
The predicate that must hold for the edges. If omitted, all edges
between nodes to be included by nodes
will also be included.
A partial function combining the passed predicates.
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.
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.
Whether all edges of this graph are directed.
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
true
if this graph has at most 1 node.
true
if this graph has at most 1 node.
Iterates over all nodes and all edges.
Iterates over all nodes and all edges.
iterator containing all nodes and all edges
(Changed in version 2.8.0) Set.map now returns a Set, so it will discard duplicate values.
The degree of the node having the highest degree or 0
if
this graph is empty.
The degree of the node having the highest degree or 0
if
this graph is empty.
The degree of the node having the least degree or 0
if
this graph is empty.
The degree of the node having the least degree or 0
if
this graph is empty.
Implements the heart of --
calling the from
factory method of the companion object.
Implements the heart of --
calling the from
factory method of the companion object.
Note that this method must be reimplemented in each module
having its own factory methods such as constrained
does.
Calculates the nodes
and edges
arguments to be passed to a factory method
when delNodes and delEdges are to be deleted by --
.
Calculates the nodes
and edges
arguments to be passed to a factory method
when delNodes and delEdges are to be deleted by --
.
Node predicate always returning false
.
Node predicate always returning false
.
Creates a new custom inner hyperedge without modifying the node or edge set .
Creates a new custom inner hyperedge without modifying the node or edge set .
Creates a new custom inner edge without modifying the node or edge set .
Creates a new custom inner edge without modifying the node or edge set .
Creates a new simple inner edge without modifying the node or edge set .
Creates a new simple inner edge without modifying the node or edge set .
Creates a new simple inner hyperedge without modifying the node or edge set .
Creates a new simple inner hyperedge without modifying the node or edge set .
Creates a new labeled inner edge without modifying the node or edge set .
Creates a new labeled inner edge without modifying the node or edge set .
Creates a new labeled inner hyperedge without modifying the node or edge set .
Creates a new labeled inner hyperedge without modifying the node or edge set .
Creates a new weighted inner edge without modifying the node or edge set .
Creates a new weighted inner edge without modifying the node or edge set .
Creates a new weighted inner hyperedge without modifying the node or edge set .
Creates a new weighted inner hyperedge without modifying the node or edge set .
Creates a new weighted and labeled inner edge without modifying the node or edge set .
Creates a new weighted and labeled inner edge without modifying the node or edge set .
Creates a new weighted and labeled inner hyperedge without modifying the node or edge set .
Creates a new weighted and labeled inner hyperedge without modifying the node or edge set .
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.
Implements the heart of ++
calling the from
factory method of the companion object.
Implements the heart of ++
calling the from
factory method of the companion object.
Note that this method must be reimplemented in each module
having its own factory methods such as constrained
does.
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
Same as asSortedString
but additionally prefixed and parenthesized by stringPrefix
.
Same as asSortedString
but additionally prefixed and parenthesized by stringPrefix
.
Ensures sorted nodes/edges unless this Graph
has more than 100 elements.
Ensures sorted nodes/edges unless this Graph
has more than 100 elements.
See also asSortedString
and toSortedString
.
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
.
The total degree of this graph equaling to the sum
of the degrees over all nodes or 0
if this graph is empty.
The total degree of this graph equaling to the sum
of the degrees over all nodes or 0
if this graph is empty.
the degree function to apply
to the nodes defaulting to Degree
. Non-default predefined
degree functions are InDegree
and OutDegree
.
selects nodes to be included by their degree.
If an inner edge equaling to edge
is present in this graph, it is replaced
by edge
, otherwise edge
will be inserted.
If an inner edge equaling to edge
is present in this graph, it is replaced
by edge
, otherwise edge
will be inserted. Such an update may be useful
whenever non-key parts of an immutable edge are to be modified.
The edge to add to this graph.
true
if edge
has been inserted.
(adjacencyListGraph: any2stringadd[AdjacencyListGraph[N, E, This]]).+(other)
(adjacencyListGraph: (Param[Param[N, E], EI]) ⇒ Boolean).andThen(g)
(adjacencyListGraph: (Param[Param[N, E], EI]) ⇒ Boolean).apply(v1)
(adjacencyListGraph: (Param[Param[N, E], EI]) ⇒ Boolean).compose(g)
(adjacencyListGraph: MonadOps[Param[N, E]]).filter(p)
(adjacencyListGraph: MonadOps[Param[N, E]]).flatMap(f)
(adjacencyListGraph: MonadOps[Param[N, E]]).map(f)
(adjacencyListGraph: OuterNode[AdjacencyListGraph[N, E, This]]).stringPrefix
(adjacencyListGraph: OuterNode[AdjacencyListGraph[N, E, This]]).toString()
(adjacencyListGraph: (Param[Param[N, E], EI]) ⇒ Boolean).toString()
(adjacencyListGraph: MonadOps[Param[N, E]]).withFilter(p)
Implements an incident list based mutable graph representation.