class DefaultGraphImpl[N, E <: Edge[N]] extends Graph[N, E] with AdjacencyListGraph[N, E, DefaultGraphImpl] with GraphTraversalImpl[N, E]
- Annotations
- @SerialVersionUID()
- Alphabetic
- By Inheritance
- DefaultGraphImpl
- GraphTraversalImpl
- State
- TraverserImpl
- AdjacencyListGraph
- AdjacencyListBase
- Graph
- GraphOps
- AnyGraph
- GraphLike
- ToString
- GraphDegree
- GraphTraversal
- GraphBase
- Serializable
- GraphOps
- OuterElems
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new DefaultGraphImpl(iniNodes: Iterable[N] = Set[N](), iniEdges: Iterable[E] = Set[E]())(implicit config: GraphConfig with AdjacencyListArrayConfig)
Type Members
- trait BaseInnerEdge extends InnerEdgeLike[NodeT] with InnerEdge with Equals
- Definition Classes
- GraphBase
- trait BaseInnerNode extends Node with InnerNode
- Definition Classes
- GraphBase
- abstract class BaseNodeBase extends BaseInnerNode
- Attributes
- protected
- Definition Classes
- GraphBase
- sealed trait EdgeOrdering extends Ordering[EdgeT] with ElemOrdering
Ordering for the path dependent type EdgeT.
Ordering for the path dependent type EdgeT.
- Definition Classes
- GraphBase
- trait EdgeSet extends AnySet[EdgeT] with ExtSetMethods[EdgeT] with Serializable
- Definition Classes
- GraphBase
- sealed trait ElemOrdering extends AnyRef
Base trait for graph
Ordering
s.Base trait for graph
Ordering
s.- Attributes
- protected
- Definition Classes
- GraphBase
- trait Node extends Serializable
- Definition Classes
- GraphBase
- sealed trait NodeOrdering extends Ordering[NodeT] with ElemOrdering
Ordering for the path dependent type NodeT.
Ordering for the path dependent type NodeT.
- Definition Classes
- GraphBase
- trait NodeSet extends AnySet[NodeT] with ExtSetMethods[NodeT]
- Definition Classes
- GraphBase
- trait DegreeFunction extends ((GraphDegree.this)#NodeT) => Int
- Definition Classes
- GraphDegree
- final class DegreeOrdering extends Ordering[(GraphDegree.this)#NodeT]
Decreasing ordering of nodes with respect to their degree.
Decreasing ordering of nodes with respect to their degree.
- Definition Classes
- GraphDegree
- trait Filter[T] extends (T) => Boolean
- Definition Classes
- GraphDegree
- trait GraphEdgeSet extends CC.EdgeSet with CC.EdgeSetToString
- Definition Classes
- GraphLike
- trait GraphInnerEdge extends CC.BaseInnerEdge
- Definition Classes
- GraphLike
- trait GraphInnerNode extends CC.BaseInnerNode with CC.TraverserInnerNode
- Definition Classes
- GraphLike
- trait GraphNodeSet extends CC.NodeSet with CC.NodeSetToString
- Definition Classes
- GraphLike
- class InnerDiEdge extends DiEdge[CC.NodeT] with CC.EdgeT
- Definition Classes
- GraphLike
- Annotations
- @SerialVersionUID()
- class InnerDiHyperEdge extends DiHyperEdge[CC.NodeT] with CC.EdgeT
- Definition Classes
- GraphLike
- Annotations
- @SerialVersionUID()
- class InnerHyperEdge extends HyperEdge[CC.NodeT] with CC.EdgeT
- Definition Classes
- GraphLike
- Annotations
- @SerialVersionUID()
- class InnerOrderedDiHyperEdge extends OrderedDiHyperEdge[CC.NodeT] with CC.EdgeT
- Definition Classes
- GraphLike
- Annotations
- @SerialVersionUID()
- class InnerOrderedHyperEdge extends OrderedHyperEdge[CC.NodeT] with CC.EdgeT
- Definition Classes
- GraphLike
- Annotations
- @SerialVersionUID()
- class InnerUnDiEdge extends UnDiEdge[CC.NodeT] with CC.EdgeT
- Definition Classes
- GraphLike
- Annotations
- @SerialVersionUID()
- trait NodeBase extends CC.BaseNodeBase with CC.GraphInnerNode
- Attributes
- protected
- Definition Classes
- GraphLike
- trait InnerEdge extends InnerElem
- Definition Classes
- GraphOps
- sealed trait InnerElem extends AnyRef
- Definition Classes
- GraphOps
- trait InnerNode extends InnerElem
- Definition Classes
- GraphOps
- sealed abstract class AbstractTopologicalOrder[+A, +T] extends AbstractIterable[T]
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.
- A
one of
NodeT
,N
- T
one of
A
or(Int, Iterable[A])
- Definition Classes
- GraphTraversal
- abstract class Component extends Properties
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.- Definition Classes
- GraphTraversal
- abstract class ComponentTraverser extends FluentProperties[ComponentTraverser] with Properties with Iterable[Component]
Controls the properties of graph traversals with no specific root and allows you to produce the (weakly) connected components by a traversal or call methods like
findCycle
that work component-wise.Controls the properties of graph traversals with no specific root and allows you to produce the (weakly) connected components by a traversal or call methods like
findCycle
that work component-wise.- Definition Classes
- GraphTraversal
- trait Cycle extends Path
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.
- Definition Classes
- GraphTraversal
- trait ExtendedNodeVisitor[U] extends (NodeT) => U
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:- the inner node currently visited as with a standard node visitor
- the number of nodes visited so far and
- the current depth in terms of the underlying algorithm and
- a reference to a specific informer that may be pattern matched to collect even further data specific to the implementation.
- Definition Classes
- GraphTraversal
- abstract class FluentProperties[+C <: FluentProperties[C]] extends AnyRef
Properties and methods for creating modified properties in a fluent-interface manner.
Properties and methods for creating modified properties in a fluent-interface manner.
- Attributes
- protected
- Definition Classes
- GraphTraversal
- abstract class InnerEdgeTraverser extends TraverserMethods[EdgeT, InnerEdgeTraverser] with Traverser[EdgeT, InnerEdgeTraverser]
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.Iterable on this instance.
- Definition Classes
- GraphTraversal
- abstract class InnerElemTraverser extends TraverserMethods[InnerElem, InnerElemTraverser] with Traverser[InnerElem, InnerElemTraverser]
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.Iterable on this instance.
- Attributes
- protected
- Definition Classes
- GraphTraversal
- abstract class InnerNodeDownUpTraverser extends TraverserMethods[(Boolean, NodeT), InnerNodeDownUpTraverser] with Traverser[(Boolean, NodeT), InnerNodeDownUpTraverser]
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.Iterable on this instance.
- Definition Classes
- GraphTraversal
- abstract class InnerNodeTraverser extends TraverserMethods[NodeT, InnerNodeTraverser] with Traverser[NodeT, InnerNodeTraverser]
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.Iterable on this instance.
- Definition Classes
- GraphTraversal
- case class Layer(index: Int, _nodes: IndexedSeq[NodeT]) extends Product with Serializable
Represents a topological sort layer.
Represents a topological sort layer.
- Definition Classes
- GraphTraversal
- final class LayeredTopologicalOrder[+A] extends AbstractTopologicalOrder[A, (Int, Iterable[A])]
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:
- layer 0 contains all nodes having no predecessors,
- layer n contains those nodes that have only predecessors in ancestor layers with at least one of them contained in layer n - 1
- A
one of
NodeT
,N
- Definition Classes
- GraphTraversal
- abstract class OuterEdgeTraverser extends TraverserMethods[E, OuterEdgeTraverser] with Traverser[E, OuterEdgeTraverser]
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.Iterable on this instance.
- Definition Classes
- GraphTraversal
- trait OuterElemTraverser extends TraverserMethods[OuterElem, OuterElemTraverser] with Traverser[OuterElem, OuterElemTraverser]
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.Iterable on this instance.
- Definition Classes
- GraphTraversal
- abstract class OuterNodeDownUpTraverser extends TraverserMethods[(Boolean, N), OuterNodeDownUpTraverser] with Traverser[(Boolean, N), OuterNodeDownUpTraverser]
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.Iterable on this instance.
- Definition Classes
- GraphTraversal
- abstract class OuterNodeTraverser extends TraverserMethods[N, OuterNodeTraverser] with Traverser[N, OuterNodeTraverser]
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.Iterable on this instance.
- Definition Classes
- GraphTraversal
- trait Path extends Walk
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.
- Definition Classes
- GraphTraversal
- trait PathBuilder extends WalkBuilder with Builder[InnerElem, Path]
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.- Definition Classes
- GraphTraversal
- trait Properties extends SubgraphProperties
Properties controlling traversals.
Properties controlling traversals.
- Attributes
- protected
- Definition Classes
- GraphTraversal
- abstract class StrongComponentTraverser extends FluentProperties[StrongComponentTraverser] with Properties with Iterable[Component]
Controls the properties of graph traversals with no specific root and allows you to produce the strongly connected components by a traversal.
Controls the properties of graph traversals with no specific root and allows you to produce the strongly connected components by a traversal.
- Definition Classes
- GraphTraversal
- trait SubgraphProperties extends AnyRef
Properties controlling the scope of traversals.
Properties controlling the scope of traversals.
- Attributes
- protected
- Definition Classes
- GraphTraversal
- final class TopologicalOrder[+A] extends AbstractTopologicalOrder[A, A]
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.
- A
one of
NodeT
,N
- Definition Classes
- GraphTraversal
- case class TopologicalSortFailure extends Product with Serializable
Failure result of a topological sort with a possible hint of candidate cycle nodes.
Failure result of a topological sort with a possible hint of candidate cycle nodes.
- Definition Classes
- GraphTraversal
- trait Traverser[A, +CC <: Traverser[A, CC]] extends TraverserMethods[A, CC] with Properties with ForeachBasedDetachingIterable[A]
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.
- Definition Classes
- GraphTraversal
- trait TraverserInnerNode extends BaseInnerNode
- Definition Classes
- GraphTraversal
- abstract class TraverserMethods[A, +CC <: TraverserMethods[A, CC]] extends FluentProperties[CC]
The
root
-related methods Traverser will inherit.The
root
-related methods Traverser will inherit.- Attributes
- protected
- Definition Classes
- GraphTraversal
- trait Walk extends Iterable[InnerElem]
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.- Definition Classes
- GraphTraversal
- trait WalkBuilder extends Builder[InnerElem, Walk]
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.- Definition Classes
- GraphTraversal
- class Weight extends AnyRef
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
.- Definition Classes
- GraphTraversal
- class AnyEdgeLazyCycle extends (GraphTraversalImpl.this)#AnyEdgeLazyPath with (GraphTraversalImpl.this)#Cycle
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- class AnyEdgeLazyPath extends (GraphTraversalImpl.this)#SimpleLazyPath
LazyPath
where edges are selected by taking the first one fitting.LazyPath
where edges are selected by taking the first one fitting.- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- case class ComponentTraverserImpl(root: (GraphTraversalImpl.this)#NodeT, parameters: Parameters, subgraphNodes: (GraphTraversalImpl.this)#NodePredicate, subgraphEdges: (GraphTraversalImpl.this)#EdgePredicate, ordering: (GraphTraversalImpl.this)#ElemOrdering, maxWeight: Option[(GraphTraversalImpl.this)#Weight]) extends (GraphTraversalImpl.this)#ComponentTraverser with Product with Serializable
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- trait DownUpTraverser[A, +CC <: (GraphTraversalImpl.this)#DownUpTraverser[A, CC]] extends (GraphTraversalImpl.this)#TraverserMethods[A, CC] with (GraphTraversalImpl.this)#Impl[A, CC]
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- case class InnerEdgeTraverserImpl(root: (GraphTraversalImpl.this)#NodeT, parameters: Parameters = Parameters(), subgraphNodes: (GraphTraversalImpl.this)#NodePredicate = anyNode, subgraphEdges: (GraphTraversalImpl.this)#EdgePredicate = anyEdge, ordering: (GraphTraversalImpl.this)#ElemOrdering = NoOrdering, maxWeight: Option[(GraphTraversalImpl.this)#Weight] = None) extends (GraphTraversalImpl.this)#InnerEdgeTraverser with (GraphTraversalImpl.this)#Impl[(GraphTraversalImpl.this)#EdgeT, (GraphTraversalImpl.this)#InnerEdgeTraverserImpl] with Product with Serializable
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- case class InnerElemTraverserImpl(root: (GraphTraversalImpl.this)#NodeT, parameters: Parameters = Parameters(), subgraphNodes: (GraphTraversalImpl.this)#NodePredicate = anyNode, subgraphEdges: (GraphTraversalImpl.this)#EdgePredicate = anyEdge, ordering: (GraphTraversalImpl.this)#ElemOrdering = NoOrdering, maxWeight: Option[(GraphTraversalImpl.this)#Weight] = None) extends (GraphTraversalImpl.this)#InnerElemTraverser with (GraphTraversalImpl.this)#Impl[(GraphTraversalImpl.this)#InnerElem, (GraphTraversalImpl.this)#InnerElemTraverserImpl] with Product with Serializable
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- case class InnerNodeDownUpTraverserImpl(root: (GraphTraversalImpl.this)#NodeT, parameters: Parameters = Parameters(), subgraphNodes: (GraphTraversalImpl.this)#NodePredicate = anyNode, subgraphEdges: (GraphTraversalImpl.this)#EdgePredicate = anyEdge, ordering: (GraphTraversalImpl.this)#ElemOrdering = NoOrdering, maxWeight: Option[(GraphTraversalImpl.this)#Weight] = None) extends (GraphTraversalImpl.this)#InnerNodeDownUpTraverser with (GraphTraversalImpl.this)#DownUpTraverser[(Boolean, (GraphTraversalImpl.this)#NodeT), (GraphTraversalImpl.this)#InnerNodeDownUpTraverserImpl] with Product with Serializable
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- trait InnerNodeTraversalImpl extends (GraphTraversalImpl.this)#TraverserInnerNode with (GraphTraversalImpl.this)#InnerNodeState
- Definition Classes
- GraphTraversalImpl
- case class InnerNodeTraverserImpl(root: (GraphTraversalImpl.this)#NodeT, parameters: Parameters = Parameters(), subgraphNodes: (GraphTraversalImpl.this)#NodePredicate = anyNode, subgraphEdges: (GraphTraversalImpl.this)#EdgePredicate = anyEdge, ordering: (GraphTraversalImpl.this)#ElemOrdering = NoOrdering, maxWeight: Option[(GraphTraversalImpl.this)#Weight] = None) extends (GraphTraversalImpl.this)#InnerNodeTraverser with (GraphTraversalImpl.this)#Impl[(GraphTraversalImpl.this)#NodeT, (GraphTraversalImpl.this)#InnerNodeTraverserImpl] with Product with Serializable
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- abstract class LazyPath extends (GraphTraversalImpl.this)#Path
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.
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- final class MapPathTraversable[T] extends Iterable[T]
Enables lazy traversing of a
Map
withkey = source, value = target
.Enables lazy traversing of a
Map
withkey = source, value = target
.- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- class MinWeightEdgeLazyPath extends (GraphTraversalImpl.this)#SimpleLazyPath
LazyPath
with edges selected by minimal weight.LazyPath
with edges selected by minimal weight.- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- class MultiEdgeLazyCycle extends (GraphTraversalImpl.this)#MultiEdgeLazyPath with (GraphTraversalImpl.this)#Cycle
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- class MultiEdgeLazyPath extends (GraphTraversalImpl.this)#LazyPath
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.- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- case class OuterEdgeTraverserImpl(root: (GraphTraversalImpl.this)#NodeT, parameters: Parameters = Parameters(), subgraphNodes: (GraphTraversalImpl.this)#NodePredicate = anyNode, subgraphEdges: (GraphTraversalImpl.this)#EdgePredicate = anyEdge, ordering: (GraphTraversalImpl.this)#ElemOrdering = NoOrdering, maxWeight: Option[(GraphTraversalImpl.this)#Weight] = None) extends (GraphTraversalImpl.this)#OuterEdgeTraverser with (GraphTraversalImpl.this)#Impl[E, (GraphTraversalImpl.this)#OuterEdgeTraverserImpl] with Product with Serializable
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- case class OuterElemTraverserImpl(root: (GraphTraversalImpl.this)#NodeT, parameters: Parameters = Parameters(), subgraphNodes: (GraphTraversalImpl.this)#NodePredicate = anyNode, subgraphEdges: (GraphTraversalImpl.this)#EdgePredicate = anyEdge, ordering: (GraphTraversalImpl.this)#ElemOrdering = NoOrdering, maxWeight: Option[(GraphTraversalImpl.this)#Weight] = None) extends (GraphTraversalImpl.this)#TraverserMethods[(GraphTraversalImpl.this)#OuterElem, (GraphTraversalImpl.this)#OuterElemTraverser] with (GraphTraversalImpl.this)#OuterElemTraverser with (GraphTraversalImpl.this)#Impl[(GraphTraversalImpl.this)#OuterElem, (GraphTraversalImpl.this)#OuterElemTraverserImpl] with Product with Serializable
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- case class OuterNodeDownUpTraverserImpl(root: (GraphTraversalImpl.this)#NodeT, parameters: Parameters = Parameters(), subgraphNodes: (GraphTraversalImpl.this)#NodePredicate = anyNode, subgraphEdges: (GraphTraversalImpl.this)#EdgePredicate = anyEdge, ordering: (GraphTraversalImpl.this)#ElemOrdering = NoOrdering, maxWeight: Option[(GraphTraversalImpl.this)#Weight] = None) extends (GraphTraversalImpl.this)#OuterNodeDownUpTraverser with (GraphTraversalImpl.this)#DownUpTraverser[(Boolean, N), (GraphTraversalImpl.this)#OuterNodeDownUpTraverserImpl] with Product with Serializable
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- case class OuterNodeTraverserImpl(root: (GraphTraversalImpl.this)#NodeT, parameters: Parameters = Parameters(), subgraphNodes: (GraphTraversalImpl.this)#NodePredicate = anyNode, subgraphEdges: (GraphTraversalImpl.this)#EdgePredicate = anyEdge, ordering: (GraphTraversalImpl.this)#ElemOrdering = NoOrdering, maxWeight: Option[(GraphTraversalImpl.this)#Weight] = None) extends (GraphTraversalImpl.this)#OuterNodeTraverser with (GraphTraversalImpl.this)#Impl[N, (GraphTraversalImpl.this)#OuterNodeTraverserImpl] with Product with Serializable
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- class PathBuilderImpl extends (GraphTraversalImpl.this)#WalkBuilderImpl with (GraphTraversalImpl.this)#PathBuilder
- Definition Classes
- GraphTraversalImpl
- final class ReverseStackTraversable[S <: NodeElement] extends Iterable[(GraphTraversalImpl.this)#NodeT]
Efficient reverse
foreach
overcomingStack
's deficiency not to overwritereverseIterator
.Efficient reverse
foreach
overcomingStack
's deficiency not to overwritereverseIterator
.- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- abstract class SimpleLazyPath extends (GraphTraversalImpl.this)#LazyPath
LazyPath
with deferred edges selection.LazyPath
with deferred edges selection.- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- class StrongComponentImpl extends (GraphTraversalImpl.this)#Component
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- case class StrongComponentTraverserImpl(root: (GraphTraversalImpl.this)#NodeT, parameters: Parameters, subgraphNodes: (GraphTraversalImpl.this)#NodePredicate, subgraphEdges: (GraphTraversalImpl.this)#EdgePredicate, ordering: (GraphTraversalImpl.this)#ElemOrdering, maxWeight: Option[(GraphTraversalImpl.this)#Weight]) extends (GraphTraversalImpl.this)#StrongComponentTraverser with Product with Serializable
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- class WalkBuilderImpl extends (GraphTraversalImpl.this)#WalkBuilder
- Definition Classes
- GraphTraversalImpl
- class WeakComponentImpl extends (GraphTraversalImpl.this)#Component
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- sealed case class OuterEdge(edge: E) extends OuterElem with Product with Serializable
To be mixed in by edge classes to allow passing them to
Graph(...)
.To be mixed in by edge classes to allow passing them to
Graph(...)
.- Definition Classes
- OuterElems
- trait OuterElem extends AnyRef
- Definition Classes
- OuterElems
- sealed case class OuterNode(node: N) extends OuterElem with Product with Serializable
Wraps any type to be accepted when calling
Graph(...)
.Wraps any type to be accepted when calling
Graph(...)
.- Definition Classes
- OuterElems
- trait InnerNodeState extends AnyRef
- Definition Classes
- State
- trait EdgeSetToString extends GraphLike.SetToString[EdgeT]
- Attributes
- protected
- Definition Classes
- ToString
- trait NodeSetToString extends GraphLike.SetToString[NodeT]
- Attributes
- protected
- Definition Classes
- ToString
- trait SetToString[A] extends AnySet[A]
- Attributes
- protected
- Definition Classes
- ToString
- trait Impl[A, +CC <: GraphTraversalImpl.Traverser[A, CC] with GraphTraversalImpl.Impl[A, CC]] extends GraphTraversalImpl.TraverserMethods[A, CC] with GraphTraversalImpl.Traverser[A, CC]
- Attributes
- protected[collection]
- Definition Classes
- TraverserImpl
- trait AdjacencyListBaseEdgeSet extends (AdjacencyListBase.this)#GraphEdgeSet
- Definition Classes
- AdjacencyListBase
- trait AdjacencyListBaseNodeSet extends (AdjacencyListBase.this)#GraphNodeSet
- Definition Classes
- AdjacencyListBase
- trait AdjacendyListBaseInnerNode extends (AdjacencyListBase.this)#GraphInnerNode
- Definition Classes
- AdjacencyListBase
- class AdjacencyListEdgeSet extends CC.AdjacencyListBaseEdgeSet
- Definition Classes
- AdjacencyListGraph
- class AdjacencyListNodeSet extends CC.AdjacencyListBaseNodeSet
- Definition Classes
- AdjacencyListGraph
- abstract class InnerNodeImpl extends CC.BaseNodeBase with CC.NodeBase with CC.AdjacendyListBaseInnerNode
- Definition Classes
- AdjacencyListGraph
- type DegreeNodeSeqEntry = (Int, NodeT)
Type alias for entries in degree maps returned by
degreeSeqMap
.Type alias for entries in degree maps returned by
degreeSeqMap
.- Definition Classes
- GraphDegree
- type EdgePredicate = (EdgeT) => Boolean
- Definition Classes
- GraphOps
- type EdgeSetT = AdjacencyListEdgeSet
- Definition Classes
- AdjacencyListGraph → AdjacencyListBase → GraphLike → GraphBase
- type EdgeT = GraphInnerEdge
- type Layers = Iterable[Layer]
The result of a topological sort in the layered view.
The result of a topological sort in the layered view.
- Definition Classes
- GraphTraversal
- final class NodeBase_ extends InnerNodeImpl with InnerNodeTraversalImpl
- Attributes
- protected
- Annotations
- @SerialVersionUID()
- type NodePredicate = (NodeT) => Boolean
- Definition Classes
- GraphOps
- type NodeSetT = AdjacencyListNodeSet
- Definition Classes
- AdjacencyListGraph → AdjacencyListBase → GraphLike → GraphBase
- type NodeT = NodeBase_
- Definition Classes
- DefaultGraphImpl → GraphTraversalImpl → AdjacencyListGraph → AdjacencyListBase → GraphLike → GraphTraversal → GraphBase → GraphOps
- type ThisGraph = DefaultGraphImpl.this.type
- Attributes
- protected
- Definition Classes
- GraphLike
- type TopoSortSetup = (Buffer[NodeT], Map[NodeT, Int])
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- type TopologicalSort = Either[TopologicalSortFailure, TopologicalOrder[NodeT]]
- Definition Classes
- GraphTraversal
Value Members
- object BaseInnerEdge
- Definition Classes
- GraphBase
- Annotations
- @transient()
- object EdgeOrdering extends Serializable
Ordering for the path dependent type EdgeT.
Ordering for the path dependent type EdgeT.
- Definition Classes
- GraphBase
- object NoOrdering extends ElemOrdering with Serializable
The empty ElemOrdering.
The empty ElemOrdering.
- Definition Classes
- GraphBase
- object Node extends Serializable
- Definition Classes
- GraphBase
- Annotations
- @transient()
- object NodeOrdering extends Serializable
- Definition Classes
- GraphBase
- object Degree extends (GraphDegree.this)#DegreeFunction
- Definition Classes
- GraphDegree
- object DegreeOrdering extends Serializable
- Definition Classes
- GraphDegree
- object InDegree extends (GraphDegree.this)#DegreeFunction
- Definition Classes
- GraphDegree
- object IntReverseOrdering extends Ordering[Int]
Decreasing ordering of integers.
Decreasing ordering of integers.
- Definition Classes
- GraphDegree
- object OutDegree extends (GraphDegree.this)#DegreeFunction
- Definition Classes
- GraphDegree
- object InnerDiEdge
- Definition Classes
- GraphLike
- Annotations
- @transient()
- object InnerDiHyperEdge
- Definition Classes
- GraphLike
- Annotations
- @transient()
- object InnerHyperEdge
- Definition Classes
- GraphLike
- Annotations
- @transient()
- object InnerOrderedDiHyperEdge
- Definition Classes
- GraphLike
- Annotations
- @transient()
- object InnerOrderedHyperEdge
- Definition Classes
- GraphLike
- Annotations
- @transient()
- object InnerUnDiEdge
- Definition Classes
- GraphLike
- Annotations
- @transient()
- object InnerEdge
- Definition Classes
- GraphOps
- object InnerNode
- Definition Classes
- GraphOps
- object Cycle
- Definition Classes
- GraphTraversal
- object ExtendedNodeVisitor
- Definition Classes
- GraphTraversal
- object Informer
- Definition Classes
- GraphTraversal
- object Path extends Serializable
- Definition Classes
- GraphTraversal
- object SubgraphProperties
- Attributes
- protected
- Definition Classes
- GraphTraversal
- object TraverserInnerNode extends Serializable
- Definition Classes
- GraphTraversal
- Annotations
- @transient()
- object Walk
- Definition Classes
- GraphTraversal
- object Weight
- Definition Classes
- GraphTraversal
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def &(that: AnyGraph[N, E]): DefaultGraphImpl[N, E]
Alias for
intersect
.Alias for
intersect
.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def &~(that: AnyGraph[N, E]): DefaultGraphImpl[N, E]
Alias for
diff
.Alias for
diff
.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def +(edge: E): DefaultGraphImpl[N, E]
Alias for
incl(edge)
.Alias for
incl(edge)
.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def +(node: N): DefaultGraphImpl[N, E]
Alias for
incl(node)
.Alias for
incl(node)
.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def ++[N2 >: N, E2 >: E <: Edge[N2]](edges: IterableOnce[E2])(implicit e: <:<[E2, Edge[N2]]): DefaultGraphImpl[N2, E2]
Alias for
concat(edges)
.Alias for
concat(edges)
.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def ++[N2 >: N, E2 >: E <: Edge[N2]](isolatedNodes: IterableOnce[N2], edges: IterableOnce[E2])(implicit e: <:<[E2, Edge[N2]]): DefaultGraphImpl[N2, E2]
Alias for
concat(isolatedNodes, edges)
.Alias for
concat(isolatedNodes, edges)
.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def -(edge: E): DefaultGraphImpl[N, E]
Alias for
incl(edge)
.Alias for
incl(edge)
.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def -(node: N): DefaultGraphImpl[N, E]
Alias for
excl(node)
.Alias for
excl(node)
.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def --(that: AnyGraph[N, E]): DefaultGraphImpl[N, E]
Creates a new graph with the elements of this graph minus the elements of
that
and edges that are incident with any node inthat
.Creates a new graph with the elements of this graph minus the elements of
that
and edges that are incident with any node inthat
.- Definition Classes
- AdjacencyListGraph → GraphOps
- Annotations
- @inline()
- final def --(nodes: Iterable[N], edges: Iterable[E]): DefaultGraphImpl[N, E]
- Definition Classes
- AdjacencyListGraph
- final def --(edges: IterableOnce[E]): DefaultGraphImpl[N, E]
Alias for
removedAll(edges)
.Alias for
removedAll(edges)
.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def --(isolatedNodes: IterableOnce[N], edges: IterableOnce[E]): DefaultGraphImpl[N, E]
Alias for
removedAll(isolatedNodes, edges)
.Alias for
removedAll(isolatedNodes, edges)
.- Definition Classes
- GraphOps
- Annotations
- @inline()
- def ->[B](y: B): (DefaultGraphImpl[N, E], B)
- Implicit
- This member is added by an implicit conversion from DefaultGraphImpl[N, E] toArrowAssoc[DefaultGraphImpl[N, E]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final val anyEdge: EdgePredicate
Default edge filter letting path all edges (non-filter).
- final def anyEdgeSelector(from: NodeT, to: NodeT): Option[EdgeT]
An arbitrary edge between
from
andto
that is available most efficiently.An arbitrary edge between
from
andto
that is available most efficiently.- Definition Classes
- GraphTraversal
- Annotations
- @inline()
- final val anyNode: NodePredicate
Default node filter letting traverse all nodes (non-filter).
- final lazy val anyOrdering: AnyOrdering[N]
- Attributes
- protected
- Definition Classes
- GraphBase
- final def apply(edge: E): Boolean
Whether the given edge is contained in this graph.
Whether the given edge is contained in this graph.
- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def apply(node: N): Boolean
Whether the given node is contained in this graph.
Whether the given node is contained in this graph.
- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def bulkOp[N2 >: N, E2 >: E <: Edge[N2]](nodes: IterableOnce[N2], edges: IterableOnce[E2], op: (IterableOnce[N2], IterableOnce[E2]) => DefaultGraphImpl[N2, E2]): DefaultGraphImpl[N2, E2]
- Attributes
- protected
- Definition Classes
- AdjacencyListBase
- def className: String
- Attributes
- protected
- Definition Classes
- ToString
- def clearNodeStates(flags: FlagWord, flagsExt: ExtBitSet): Unit
- Attributes
- protected
- Definition Classes
- State
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final val companion: DefaultGraphImpl.type
The companion object of
CC
.The companion object of
CC
.- Definition Classes
- DefaultGraphImpl → GraphLike
- def componentTraverser(parameters: Parameters = Parameters(), subgraphNodes: NodePredicate = anyNode, subgraphEdges: EdgePredicate = anyEdge, ordering: ElemOrdering = NoOrdering, maxWeight: Option[Weight] = None): ComponentTraverserImpl
Creates a ComponentTraverser responsible for invoking graph traversal methods in all (weakly) connected components of this possibly disconnected graph.
Creates a ComponentTraverser responsible for invoking graph traversal methods in all (weakly) connected components of this possibly disconnected graph.
- parameters
The properties controlling subsequent traversals.
- subgraphNodes
Restricts subsequent graph traversals to visit only nodes holding this predicate.
- subgraphEdges
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
- ordering
If a
NodeOrdering
orEdgeOrdering
different fromNoOrdering
is supplied neighbor nodes will visited during the traversal according to this ordering.- maxWeight
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.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- final def concat[N2 >: N, E2 >: E <: Edge[N2]](isolatedNodes: IterableOnce[N2], edges: IterableOnce[E2])(implicit e: <:<[E2, Edge[N2]]): DefaultGraphImpl[N2, E2]
Creates a new graph by adding all
edges
andisolatedNodes
omitting duplicates.Creates a new graph by adding all
edges
andisolatedNodes
omitting duplicates. The new graph is upcasted if any of the arguments is an upcast ofN
respectivelyE
. Useunion
to concatenate all nodes and edges of another graph.- isolatedNodes
to be concatenated. Nodes that are implicitly defined by any edge in
edges
will be ignored.- edges
to be concatenated.
- Definition Classes
- AdjacencyListBase → GraphOps
- def concat[N2 >: N, E2 >: E <: Edge[N2]](edges: IterableOnce[E2])(implicit e: <:<[E2, Edge[N2]]): DefaultGraphImpl[N2, E2]
Same as
concat(isolatedNodes, edges)
but with emptyisolatedNodes
.Same as
concat(isolatedNodes, edges)
but with emptyisolatedNodes
. This method is useful if you don't need to pass any isolated node.- Definition Classes
- GraphOps
- implicit val config: GraphConfig with AdjacencyListArrayConfig
- Definition Classes
- DefaultGraphImpl → AdjacencyListBase → GraphLike
- final def contains(edge: E): Boolean
Whether the given outer edge is contained in this graph.
- final def contains(node: N): Boolean
Whether the given outer node is contained in this graph.
- final def copy(nodes: Iterable[N], edges: Iterable[E]): DefaultGraphImpl[N, E]
- Definition Classes
- DefaultGraphImpl → AdjacencyListGraph
- final def cycle(results: Option[(NodeT, Stack[CycleStackElem])], edgeFilter: EdgePredicate): Option[Cycle]
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- final def cycle(maybeStart: Option[NodeT], stack: Stack[Element], edgeFilter: EdgePredicate): Option[Cycle]
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- final lazy val defaultEdgeOrdering: EdgeOrdering
- Definition Classes
- GraphBase
- final lazy val defaultNodeOrdering: NodeOrdering
- Definition Classes
- GraphBase
- final def defaultPathSize: Int
- Attributes
- protected
- Definition Classes
- GraphTraversal
- Annotations
- @inline()
- def degreeCount(implicit nodeDegree: DegreeFunction = Degree, degreeFilter: (Int) => Boolean = AnyDegree): SortedMap[Int, Int]
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.
- Definition Classes
- GraphDegree
- def degreeNodeSeq(implicit nodeDegree: DegreeFunction = Degree, degreeFilter: (Int) => Boolean = AnyDegree): Seq[DegreeNodeSeqEntry]
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.
- Definition Classes
- GraphDegree
- def degreeNodesMap(implicit nodeDegree: DegreeFunction = Degree, degreeFilter: (Int) => Boolean = AnyDegree): SortedMap[Int, AnySet[NodeT]]
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.
- Definition Classes
- GraphDegree
- def degreeSeq(implicit nodeDegree: DegreeFunction = Degree, degreeFilter: (Int) => Boolean = AnyDegree): Seq[Int]
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.
- Definition Classes
- GraphDegree
- def degreeSet(implicit nodeDegree: DegreeFunction = Degree, degreeFilter: (Int) => Boolean = AnyDegree): SortedSet[Int]
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.
- Definition Classes
- GraphDegree
- final def diff(that: AnyGraph[N, E]): DefaultGraphImpl[N, E]
Computes a new graph that is the difference of this graph and
that
graph.Computes a new graph that is the difference of this graph and
that
graph.- Definition Classes
- GraphOps
- def dump(store: FlagStore): ExtBitSet
- Attributes
- protected
- Definition Classes
- State
- def dumpDirty: ExtBitSet
Returns a copy of the current
dirty
-flags for dump purposes.Returns a copy of the current
dirty
-flags for dump purposes.- Definition Classes
- State
- def dumpInUse: ExtBitSet
Returns a copy of the current
inUse
-flags for dump purposes.Returns a copy of the current
inUse
-flags for dump purposes.- Definition Classes
- State
- def edgeIterator: Iterator[EdgeT]
- Definition Classes
- AdjacencyListBase
- final def edges: AdjacencyListEdgeSet
The edge set of this
Graph
commonly referred to as E(G).The edge set of this
Graph
commonly referred to as E(G).- returns
Set of all contained edges.
- Definition Classes
- DefaultGraphImpl → AdjacencyListGraph → GraphBase
- Annotations
- @inline()
- final def elementCount: Int
The number of nodes and edges.
The number of nodes and edges.
- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def empty: DefaultGraphImpl[N, E]
- Definition Classes
- DefaultGraphImpl → Graph → GraphLike
- def ensuring(cond: (DefaultGraphImpl[N, E]) => Boolean, msg: => Any): DefaultGraphImpl[N, E]
- Implicit
- This member is added by an implicit conversion from DefaultGraphImpl[N, E] toEnsuring[DefaultGraphImpl[N, E]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (DefaultGraphImpl[N, E]) => Boolean): DefaultGraphImpl[N, E]
- Implicit
- This member is added by an implicit conversion from DefaultGraphImpl[N, E] toEnsuring[DefaultGraphImpl[N, E]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): DefaultGraphImpl[N, E]
- Implicit
- This member is added by an implicit conversion from DefaultGraphImpl[N, E] toEnsuring[DefaultGraphImpl[N, E]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): DefaultGraphImpl[N, E]
- Implicit
- This member is added by an implicit conversion from DefaultGraphImpl[N, E] toEnsuring[DefaultGraphImpl[N, E]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(that: Any): Boolean
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. AnyTraversableOnce
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 nodes1
and2
. The second is true because of duplicate elimination and undirected edge equivalence.- Definition Classes
- GraphLike → AnyRef → Any
- def excl(edge: E): DefaultGraphImpl[N, E]
Creates a new graph with the elements of this graph minus
edge
.Creates a new graph with the elements of this graph minus
edge
.- Definition Classes
- AdjacencyListGraph → GraphOps
- def excl(node: N): DefaultGraphImpl[N, E]
Creates a new graph with the elements of this graph minus
node
and its incident edges.Creates a new graph with the elements of this graph minus
node
and its incident edges.- Definition Classes
- AdjacencyListGraph → GraphOps
- final def expectedMaxNodes(divisor: Int, min: Int = 128): Int
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- final def filter(nodeP: NodePredicate = anyNode, edgeP: EdgePredicate = anyEdge): DefaultGraphImpl[N, E]
Computes a new graph with nodes satisfying
nodeP
and edges satisfyingedgeP
. - def filterNot(nodeP: NodePredicate = noNode, edgeP: EdgePredicate = noEdge): DefaultGraphImpl[N, E]
Computes a new graph without nodes satisfying
nodeP
and without edges satisfyingePred
.Computes a new graph without nodes satisfying
nodeP
and without edges satisfyingePred
. If bothnodeP
andePred
have default values the original graph is retained.- Definition Classes
- GraphOps
- final def find(edge: E): Option[EdgeT]
Searches this graph for an inner edge that wraps an outer edge equalling to the given outer edge.
- final def find(node: N): Option[NodeT]
Searches this graph for an inner node that wraps an outer node equalling to the given outer node.
- final def findCycle[U](implicit visitor: (InnerElem) => U = empty): Option[Cycle]
Finds a cycle in
this
graph in any of its components and callsvisitor
for each inner element visited during the search.Finds a cycle in
this
graph in any of its components and callsvisitor
for each inner element visited during the search. SeecomponentTraverser
for more control by means ofFluentProperties
.- Definition Classes
- GraphTraversal
- final def findCycleContaining[U](node: NodeT)(implicit visitor: (InnerElem) => U = empty): Option[Cycle]
Finds a cycle that contains
node
and callsvisitor
for each inner element visited during the search.Finds a cycle that contains
node
and callsvisitor
for each inner element visited during the search.- Definition Classes
- GraphTraversal
- final def flatMap[NN, EC[X] <: Edge[X]](fNode: (NodeT) => Seq[NN], fEdge: (EdgeT, Seq[NN], Seq[NN]) => Seq[EC[NN]])(implicit w: <:<[E, AnyEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is generic. Otherwise see
flatMapBound
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The higher kind of the generic edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fEdge
To apply to all edges of this graph. This function is passed the current inner edge and its ends after being mapped by
fNode
. Since the inner edge is passed you can also examine its context. Callouter
to get the outer edge of type E.- returns
A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).
- final def flatMap[NN, EC[X] <: Edge[X]](fNode: (NodeT) => Seq[NN])(implicit w1: <:<[E, GenericMapper], w2: =:=[EC[N], E], t: ClassTag[EC[NN]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes returned by
fNode
and an edge structure that remains intact where possible.Creates a new graph with nodes returned by
fNode
and an edge structure that remains intact where possible.You can call this flavor only if this graph's edge type is generic. Otherwise see
flatMapBound
.If this graph also contains typed edges, the typed edge's partial
map
function will be called to replace the ends. If the partial function is not defined, there will be an attempt to fall back to a generic edge. If that attempt also fails the edge will be dropped. So, if you have a mixed graph with generic and typed edges, prefer mapping edges directly to avoid leaving edges out.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The higher kind of the generic edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node. IffNode
returns several new nodes with none equaling to the original node, the first new node is accepted to be the result of the node transformation. For more flexibility pass your own edge mapper to the overload.- returns
A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).
- final def flatMap[NN, EC[X] <: Edge[X]](fNode: (NodeT) => Seq[NN], fEdge: (Seq[NN], Seq[NN]) => Seq[EC[NN]])(implicit w: <:<[E, AnyEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.See overload except the parameter
- fEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- final def flatMapBound[NN, EC <: Edge[NN]](fNode: (NodeT) => Seq[NN], fEdge: (EdgeT, Seq[NN], Seq[NN]) => Seq[EC])(implicit w: <:<[E, AnyEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is typed. Otherwise see
flatMap
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fEdge
To apply to all edges of this graph. This function is passed the current inner edge and its ends after being mapped by
fNode
. Since the inner edge is passed you can also examine its context. Callouter
to get the outer edge of type E.- returns
A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).
- final def flatMapBound(fNode: (NodeT) => Seq[N])(implicit w1: <:<[E, PartialMapper]): DefaultGraphImpl[N, E]
Creates a new graph with nodes returned by
fNode
and an edge structure that remains intact where possible.Creates a new graph with nodes returned by
fNode
and an edge structure that remains intact where possible.You can call this flavor only if this graph's edge type is typed. Otherwise see
flatMap
.- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node. IffNode
returns several new nodes with none equaling to the original node, the first new node is accepted to be the result of the node transformation. For more flexibility pass your own edge mapper to the overload.
- final def flatMapBound[NN, EC <: Edge[NN]](fNode: (NodeT) => Seq[NN], fEdge: (Seq[NN], Seq[NN]) => Seq[EC])(implicit w: <:<[E, AnyEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is typed. Otherwise see
flatMap
.See overload except the parameter
- fEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- final def flatMapDiHyper[NN, EC[X] <: Edge[X]](fNode: (NodeT) => Seq[NN], fDiHyperEdge: (EdgeT, Seq[NN], Seq[NN]) => Seq[EC[NN]], fEdge: Option[(EdgeT, Seq[NN], Seq[NN]) => Seq[EC[NN]]])(implicit w: <:<[E, AnyDiHyperEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is generic. Otherwise see
flatMapDiHyperBound
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The higher kind of the generic edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fDiHyperEdge
To apply to all directed hyperedges in this graph. This function is passed the existing inner directed hyperedge and its sources and targets after being mapped by
fNode
. Since the inner directed hyperedge is passed you can also examine the edge context. Callouter
to get the outer directed hyperedge of type E.- fEdge
To apply to any directed or undirected edge in this possibly mixed graph. If not present simple edges will be mapped by the mandatory edge mapper you supply. You are recommended supplying
Some
unless you know that the graph does not contain any simple edge.- returns
A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).
- final def flatMapDiHyper[NN, EC[X] <: Edge[X]](fNode: (NodeT) => Seq[NN], fDiHyperEdge: (Seq[NN], Seq[NN]) => Seq[EC[NN]], fEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC[NN]]] = None)(implicit w: <:<[E, AnyDiHyperEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is generic. Otherwise see
flatMapDiHyperBound
.See overload except the parameter
- fDiHyperEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- final def flatMapDiHyperBound[NN, EC <: Edge[NN]](fNode: (NodeT) => Seq[NN], fDiHyperEdge: (EdgeT, Seq[NN], Seq[NN]) => Seq[EC], fEdge: Option[(EdgeT, Seq[NN], Seq[NN]) => Seq[EC]])(implicit w: <:<[E, AnyDiHyperEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is typed. Otherwise see
flatMapDiHyper
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fDiHyperEdge
To apply to all directed hyperedges in this graph. This function is passed the existing inner directed hyperedge and its sources and targets after being mapped by
fNode
. Since the inner directed hyperedge is passed you can also examine the edge context. Callouter
to get the outer directed hyperedge of type E.- fEdge
To apply to any directed or undirected edge in this possibly mixed graph. If not present simple edges will be mapped by the mandatory edge mapper you supply. You are recommended supplying
Some
unless you know that the graph does not contain any simple edge.- returns
A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).
- final def flatMapDiHyperBound[NN, EC <: Edge[NN]](fNode: (NodeT) => Seq[NN], fDiHyperEdge: (Seq[NN], Seq[NN]) => Seq[EC], fEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC]] = None)(implicit w: <:<[E, AnyDiHyperEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is typed. Otherwise see
flatMapDiHyper
.See overload except the parameter
- fDiHyperEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- final def flatMapHyper[NN, EC[X] <: Edge[X]](fNode: (NodeT) => Seq[NN], fHyperEdge: (EdgeT, Seq[NN]) => Seq[EC[NN]], fDiHyperEdge: Option[(EdgeT, Seq[NN], Seq[NN]) => Seq[EC[NN]]], fEdge: Option[(EdgeT, Seq[NN], Seq[NN]) => Seq[EC[NN]]])(implicit w: <:<[E, AnyHyperEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is generic. Otherwise see
flatMapHyperBound
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The higher kind of the generic edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fHyperEdge
To apply to all hyperedges in this graph. This function is passed the current inner hyperedge and its ends after being mapped by
fNode
. Since the inner hyperedge is passed you can also examine its context. Callouter
to get the outer hyperedge of type E.- fDiHyperEdge
To apply to any directed hyperedge in this possibly mixed graph. If not present directed hyperedges will be mapped by the mandatory
fDiHyperEdge
. You are recommended supplyingSome
unless you know that the graph does not contain any directed hyperedge.- fEdge
To apply to any directed or undirected edge in this possibly mixed graph. If not present simple edges will be mapped by the mandatory edge mapper you supply. You are recommended supplying
Some
unless you know that the graph does not contain any simple edge.- returns
A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).
- final def flatMapHyper[NN, EC[X] <: Edge[X]](fNode: (NodeT) => Seq[NN], fHyperEdge: (Seq[NN]) => Seq[EC[NN]], fDiHyperEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC[NN]]] = None, fEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC[NN]]] = None)(implicit w: <:<[E, AnyHyperEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is generic. Otherwise see
flatMapHyperBound
.See overload except the parameter
- fHyperEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- final def flatMapHyperBound[NN, EC <: Edge[NN]](fNode: (NodeT) => Seq[NN], fHyperEdge: (EdgeT, Seq[NN]) => Seq[EC], fDiHyperEdge: Option[(EdgeT, Seq[NN], Seq[NN]) => Seq[EC]], fEdge: Option[(EdgeT, Seq[NN], Seq[NN]) => Seq[EC]])(implicit w: <:<[E, AnyHyperEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is typed. Otherwise see
flatMapHyper
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fHyperEdge
To apply to all hyperedges in this graph. This function is passed the current inner hyperedge and its ends after being mapped by
fNode
. Since the inner hyperedge is passed you can also examine its context. Callouter
to get the outer hyperedge of type E.- fDiHyperEdge
To apply to any directed hyperedge in this possibly mixed graph. If not present directed hyperedges will be mapped by the mandatory
fDiHyperEdge
. You are recommended supplyingSome
unless you know that the graph does not contain any directed hyperedge.- fEdge
To apply to any directed or undirected edge in this possibly mixed graph. If not present simple edges will be mapped by the mandatory edge mapper you supply. You are recommended supplying
Some
unless you know that the graph does not contain any simple edge.- returns
A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).
- final def flatMapHyperBound[NN, EC <: Edge[NN]](fNode: (NodeT) => Seq[NN], fHyperEdge: (Seq[NN]) => Seq[EC], fDiHyperEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC]] = None, fEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC]] = None)(implicit w: <:<[E, AnyHyperEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.Creates a new graph with nodes and edges returned by
fNode
respectivelyfEdge
.You can call this flavor only if this graph's edge type is typed. Otherwise see
flatMapHyper
.See overload except the parameter
- fHyperEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- def foldLeft[B](z: B)(opNode: (B, NodeT) => B, opEdge: (B, EdgeT) => B): B
Applies a node-specific and an edge-specific binary operator to a cumulated value.
Applies a node-specific and an edge-specific binary operator to a cumulated value. First
opNode
is called for all nodes thanopEdge
for all edges.- B
the result type of the binary operator.
- z
the start value that is passed to
opNode
the first time.- opNode
the binary operator that is passed the cumulated value and an inner node.
- opEdge
the binary operator that is passed the cumulated value and an inner edge.
- returns
the cumulated value.
- final def foldLeftOuter[B](z: B)(opNode: (B, N) => B, opEdge: (B, E) => B): B
Same as
foldLeft
except the second parameter of the binary operators.Same as
foldLeft
except the second parameter of the binary operators.- opNode
the binary operator that is passed the cumulated value and an outer node.
- opEdge
the binary operator that is passed the cumulated value and an outer edge.
- Definition Classes
- GraphOps
- final def forInDegrees(nodes: Iterable[NodeT] with SubgraphProperties, maybeHandle: Option[Handle] = None, includeAnyway: Option[NodeT] = None, includeInDegree: NodePredicate = anyNode): TopoSortSetup
Calculates in-degrees of nodes spanned by
nodes
.Calculates in-degrees of nodes spanned by
nodes
.- nodes
supplies the nodes for which the degree is to be calculated
- maybeHandle
to be used to mark visited nodes
- includeAnyway
include this node in the resulting list of nodes without predecessors irrespective of its in degree
- includeInDegree
optionally filters predecessor nodes when calculating the in degree
- returns
tuple of
- nodes without predecessors in the component spanned by
nodes
- map of visited nodes to their in degrees
- nodes without predecessors in the component spanned by
- Attributes
- protected
- Definition Classes
- GraphTraversalImpl
- final def get(edge: E): EdgeT
Short for
find(edge).get
. - final def get(node: N): NodeT
Short for
find(node).get
. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def incl(edge: E): DefaultGraphImpl[N, E]
Creates a new supergraph with an additional edge unless this graph already contains
edge
.Creates a new supergraph with an additional edge unless this graph already contains
edge
.- Definition Classes
- AdjacencyListGraph → GraphOps
- def incl(node: N): DefaultGraphImpl[N, E]
Creates a new supergraph with an additional node unless this graph already contains
node
.Creates a new supergraph with an additional node unless this graph already contains
node
.- Definition Classes
- AdjacencyListGraph → GraphOps
- def initialize(nodes: Iterable[N], edges: Iterable[E]): Unit
Populates this graph with
nodes
andedges
.Populates this graph with
nodes
andedges
. The implementing class will typically have a constructor with the same parameters which is invoked byfrom
of the companion object.- nodes
The isolated (and optionally any other) outer nodes that the node set of this graph is to be populated with.
- edges
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.
- Attributes
- protected
- Definition Classes
- GraphBase
- def initializeFrom(in: ObjectInputStream, nodes: NodeSetT, edges: EdgeSetT): Unit
- Attributes
- protected
- Definition Classes
- AdjacencyListBase
- def innerEdgeTraverser(root: NodeT, parameters: Parameters = Parameters(), subgraphNodes: NodePredicate = anyNode, subgraphEdges: EdgePredicate = anyEdge, ordering: ElemOrdering = NoOrdering, maxWeight: Option[Weight] = None): InnerEdgeTraverserImpl
Creates a InnerEdgeTraverser based on
scala.collection.Iterable[EdgeT]
.Creates a InnerEdgeTraverser based on
scala.collection.Iterable[EdgeT]
.- root
The node where subsequent graph traversals start.
- parameters
The properties controlling subsequent traversals.
- subgraphNodes
Restricts subsequent graph traversals to visit only nodes holding this predicate.
- subgraphEdges
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
- ordering
If a
NodeOrdering
orEdgeOrdering
different fromNoOrdering
is supplied neighbor nodes will visited during the traversal according to this ordering.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- def innerElemTraverser(root: NodeT, parameters: Parameters = Parameters(), subgraphNodes: NodePredicate = anyNode, subgraphEdges: EdgePredicate = anyEdge, ordering: ElemOrdering = NoOrdering, maxWeight: Option[Weight] = None): InnerElemTraverserImpl
Creates a InnerElemTraverser based on
scala.collection.Iterable[InnerElem]
.Creates a InnerElemTraverser based on
scala.collection.Iterable[InnerElem]
.- root
The node where subsequent graph traversals start.
- parameters
The properties controlling subsequent traversals.
- subgraphNodes
Restricts subsequent graph traversals to visit only nodes holding this predicate.
- subgraphEdges
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
- ordering
If a
NodeOrdering
orEdgeOrdering
different fromNoOrdering
is supplied neighbor nodes will visited during the traversal according to this ordering.- maxWeight
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.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- def innerNodeDownUpTraverser(root: NodeT, parameters: Parameters = Parameters(), subgraphNodes: NodePredicate = anyNode, subgraphEdges: EdgePredicate = anyEdge, ordering: ElemOrdering = NoOrdering, maxWeight: Option[Weight] = None): InnerNodeDownUpTraverserImpl
Creates a InnerNodeDownUpTraverser based on
scala.collection.Iterable[(Boolean, NodeT)]
where theBoolean
parameter istrue
if the traversal takes place in downward andfalse
if it takes place in upward direction.Creates a InnerNodeDownUpTraverser based on
scala.collection.Iterable[(Boolean, NodeT)]
where theBoolean
parameter istrue
if the traversal takes place in downward andfalse
if it takes place in upward direction.- root
The node where subsequent graph traversals start.
- parameters
The properties controlling subsequent traversals. A
kind
different fromDepthFirst
will be ignored.- subgraphNodes
Restricts subsequent graph traversals to visit only nodes holding this predicate.
- subgraphEdges
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
- ordering
If a
NodeOrdering
orEdgeOrdering
different fromNoOrdering
is supplied neighbor nodes will visited during the traversal according to this ordering.- maxWeight
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.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- def innerNodeTraverser(root: NodeT, parameters: Parameters = Parameters(), subgraphNodes: NodePredicate = anyNode, subgraphEdges: EdgePredicate = anyEdge, ordering: ElemOrdering = NoOrdering, maxWeight: Option[Weight] = None): InnerNodeTraverserImpl
Creates a InnerNodeTraverser based on
scala.collection.Iterable[NodeT]
.Creates a InnerNodeTraverser based on
scala.collection.Iterable[NodeT]
.- root
The node where subsequent graph traversals start.
- parameters
The properties controlling subsequent traversals.
- subgraphNodes
Restricts subsequent graph traversals to visit only nodes holding this predicate.
- subgraphEdges
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
- ordering
If a
NodeOrdering
orEdgeOrdering
different fromNoOrdering
is supplied neighbor nodes will visited during the traversal according to this ordering.- maxWeight
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.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- final def intersect(that: AnyGraph[N, E]): DefaultGraphImpl[N, E]
Computes the intersection between this graph and
that
graph.Computes the intersection between this graph and
that
graph.- Definition Classes
- GraphOps
- final def isAcyclic: Boolean
Whether
this
graph has no cycle.Whether
this
graph has no cycle.- Definition Classes
- GraphTraversal
- Annotations
- @inline()
- def isComplete: Boolean
Whether all nodes are pairwise adjacent.
Whether all nodes are pairwise adjacent.
- returns
true
if this graph is complete,false
if this graph contains any independent nodes.
- Definition Classes
- GraphTraversal
- def isConnected: Boolean
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.- Definition Classes
- GraphTraversal
- final def isCustomEdgeFilter(f: EdgePredicate): Boolean
true
iff
is not equivalent toanyEdge
.true
iff
is not equivalent toanyEdge
.- Definition Classes
- GraphBase
- Annotations
- @inline()
- final def isCustomNodeFilter(f: NodePredicate): Boolean
true
iff
is not equivalent toanyNode
.true
iff
is not equivalent toanyNode
.- Definition Classes
- GraphBase
- Annotations
- @inline()
- final def isCyclic: Boolean
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.- Definition Classes
- GraphTraversal
- Annotations
- @inline()
- def isDirected: Boolean
Whether all edges of this graph are directed.
- final def isEmpty: Boolean
Whether this graph contains any node or any edge.
Whether this graph contains any node or any edge.
- Definition Classes
- GraphOps
- Annotations
- @inline()
- def isHyper: Boolean
Whether this graph contains at least one hyperedge.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isMixed: Boolean
Whether this graph contains at least one directed and one undirected edge.
- def isMulti: Boolean
Whether this graph contains at least one multi-edge.
Whether this graph contains at least one multi-edge. We defnie multi-edges by
- two or more directed edges having the same source and target
- two or more undirected edges connecting the same nodes
- two or more (directed) hyperedges that, after being decomposed into (directed) edges, yield any multy-edge as stipulated above.
- final def isTrivial: Boolean
true
if this graph has at most 1 node.true
if this graph has at most 1 node.- Definition Classes
- GraphOps
- Annotations
- @inline()
- def iterator: Iterator[InnerElem]
Iterator over all inner nodes and edges.
- final def map[NN, EC[X] <: Edge[X]](fNode: (NodeT) => NN, fEdge: (EdgeT, NN, NN) => EC[NN])(implicit w: <:<[E, AnyEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
You can call this flavor only if this graph's edge type is generic. Otherwise see
mapBound
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The higher kind of the generic edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fEdge
To apply to all edges of this graph. This function is passed the current inner edge and its ends after being mapped by
fNode
. Since the inner edge is passed you can also examine its context. Callouter
to get the outer edge of type E.- returns
The mapped graph with possibly changed node and edge type parameters.
- final def map[NN, EC[X] <: Edge[X]](fNode: (NodeT) => NN)(implicit w1: <:<[E, GenericMapper], w2: =:=[EC[N], E], t: ClassTag[EC[NN]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes mapped by
fNode
and with an untouched edge structure otherwise.Creates a new graph with nodes mapped by
fNode
and with an untouched edge structure otherwise.You can call this flavor only if this graph's edge type is generic. Otherwise see
mapBound
.If this graph also contains typed edges, the typed edge's partial
map
function will be called to replace the ends. If the partial function is not defined, there will be an attempt to fall back to a generic edge. If that attempt also fails the edge will be dropped. So, if you have a mixed graph with generic and typed edges, prefer mapping edges directly to avoid leaving edges out.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The higher kind of the generic edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- returns
The mapped graph with possibly changed node and edge type parameters.
- final def map[NN, EC[X] <: Edge[X]](fNode: (NodeT) => NN, fEdge: (NN, NN) => EC[NN])(implicit w: <:<[E, AnyEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
See overload except the parameter
- fEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- final def mapBound[NN, EC <: Edge[NN]](fNode: (NodeT) => NN, fEdge: (EdgeT, NN, NN) => EC)(implicit w: <:<[E, AnyEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
You can call this flavor only if this graph's edge type is typed. Otherwise see
map
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fEdge
To apply to all edges of this graph. This function is passed the current inner edge and its ends after being mapped by
fNode
. Since the inner edge is passed you can also examine its context. Callouter
to get the outer edge of type E.- returns
The mapped graph with possibly changed node and edge type parameters.
- final def mapBound(fNode: (NodeT) => N)(implicit w1: <:<[E, PartialMapper]): DefaultGraphImpl[N, E]
Creates a new graph with nodes mapped by
fNode
and with an untouched edge structure otherwise.Creates a new graph with nodes mapped by
fNode
and with an untouched edge structure otherwise.You can call this flavor only if this graph's edge type is typed. Otherwise see
map
.- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- returns
The mapped graph with possibly changed node and edge type parameters.
- final def mapBound[NN, EC <: Edge[NN]](fNode: (NodeT) => NN, fEdge: (NN, NN) => EC)(implicit w: <:<[E, AnyEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
See overload except the parameter
- fEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- def mapDiHyper[NN, EC[X] <: Edge[X]](fNode: (NodeT) => NN, fDiHyperEdge: (EdgeT, OneOrMore[NN], OneOrMore[NN]) => EC[NN], fEdge: Option[(EdgeT, NN, NN) => EC[NN]])(implicit w: <:<[E, AnyDiHyperEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
You can call this flavor only if this graph's edge type is generic. Otherwise see
mapDiHyperBound
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The higher kind of the generic edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fDiHyperEdge
To apply to all directed hyperedges in this graph. This function is passed the existing inner directed hyperedge and its sources and targets after being mapped by
fNode
. Since the inner directed hyperedge is passed you can also examine the edge context. Callouter
to get the outer directed hyperedge of type E.- fEdge
To apply to any directed or undirected edge in this possibly mixed graph. If not present simple edges will be mapped by the mandatory edge mapper you supply. You are recommended supplying
Some
unless you know that the graph does not contain any simple edge.- returns
The mapped graph with possibly changed node and edge type parameters.
- final def mapDiHyper[NN, EC[X] <: Edge[X]](fNode: (NodeT) => NN, fDiHyperEdge: (OneOrMore[NN], OneOrMore[NN]) => EC[NN], fEdge: Option[(NN, NN) => EC[NN]] = None)(implicit w: <:<[E, AnyDiHyperEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
You can call this flavor only if this graph's edge type is generic. Otherwise see
mapDiHyperBound
.See overload except the parameter
- fDiHyperEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- def mapDiHyperBound[NN, EC <: Edge[NN]](fNode: (NodeT) => NN, fDiHyperEdge: (EdgeT, OneOrMore[NN], OneOrMore[NN]) => EC, fEdge: Option[(EdgeT, NN, NN) => EC])(implicit w: <:<[E, AnyDiHyperEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
You can call this flavor only if this graph's edge type is typed. Otherwise see
mapDiHyper
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fDiHyperEdge
To apply to all directed hyperedges in this graph. This function is passed the existing inner directed hyperedge and its sources and targets after being mapped by
fNode
. Since the inner directed hyperedge is passed you can also examine the edge context. Callouter
to get the outer directed hyperedge of type E.- fEdge
To apply to any directed or undirected edge in this possibly mixed graph. If not present simple edges will be mapped by the mandatory edge mapper you supply. You are recommended supplying
Some
unless you know that the graph does not contain any simple edge.- returns
The mapped graph with possibly changed node and edge type parameters.
- final def mapDiHyperBound[NN, EC <: Edge[NN]](fNode: (NodeT) => NN, fDiHyperEdge: (OneOrMore[NN], OneOrMore[NN]) => EC, fEdge: Option[(NN, NN) => EC] = None)(implicit w: <:<[E, AnyDiHyperEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
You can call this flavor only if this graph's edge type is typed. Otherwise see
mapDiHyper
.See overload except the parameter
- fDiHyperEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- final def mapHyper[NN, EC[X] <: Edge[X]](fNode: (NodeT) => NN, fHyperEdge: (EdgeT, Several[NN]) => EC[NN], fDiHyperEdge: Option[(EdgeT, OneOrMore[NN], OneOrMore[NN]) => EC[NN]], fEdge: Option[(EdgeT, NN, NN) => EC[NN]])(implicit w: <:<[E, AnyHyperEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
You can call this flavor only if this graph's edge type is generic. Otherwise see
mapHyperBound
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The higher kind of the generic edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fHyperEdge
To apply to all hyperedges in this graph. This function is passed the current inner hyperedge and its ends after being mapped by
fNode
. Since the inner hyperedge is passed you can also examine its context. Callouter
to get the outer hyperedge of type E.- fDiHyperEdge
To apply to any directed hyperedge in this possibly mixed graph. If not present directed hyperedges will be mapped by the mandatory
fDiHyperEdge
. You are recommended supplyingSome
unless you know that the graph does not contain any directed hyperedge.- fEdge
To apply to any directed or undirected edge in this possibly mixed graph. If not present simple edges will be mapped by the mandatory edge mapper you supply. You are recommended supplying
Some
unless you know that the graph does not contain any simple edge.- returns
The mapped graph with possibly changed node and edge type parameters.
- final def mapHyper[NN, EC[X] <: Edge[X]](fNode: (NodeT) => NN, fHyperEdge: (Several[NN]) => EC[NN], fDiHyperEdge: Option[(OneOrMore[NN], OneOrMore[NN]) => EC[NN]] = None, fEdge: Option[(NN, NN) => EC[NN]] = None)(implicit w: <:<[E, AnyHyperEdge[N]]): DefaultGraphImpl[NN, EC[NN]]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
You can call this flavor only if this graph's edge type is generic. Otherwise see
mapHyperBound
.See overload except the parameter
- fHyperEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- final def mapHyperBound[NN, EC <: Edge[NN]](fNode: (NodeT) => NN, fHyperEdge: (EdgeT, Several[NN]) => EC, fDiHyperEdge: Option[(EdgeT, OneOrMore[NN], OneOrMore[NN]) => EC], fEdge: Option[(EdgeT, NN, NN) => EC])(implicit w: <:<[E, AnyHyperEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
You can call this flavor only if this graph's edge type is typed. Otherwise see
mapHyper
.- NN
The node type of the resulting graph which may be unchanged or different from this graph's node type.
- EC
The edge type parameter of this graph.
- fNode
To apply to all nodes of this graph. Since the inner node is passed you can also examine the node context. Call
outer
to get the value of typeN
of the node.- fHyperEdge
To apply to all hyperedges in this graph. This function is passed the current inner hyperedge and its ends after being mapped by
fNode
. Since the inner hyperedge is passed you can also examine its context. Callouter
to get the outer hyperedge of type E.- fDiHyperEdge
To apply to any directed hyperedge in this possibly mixed graph. If not present directed hyperedges will be mapped by the mandatory
fDiHyperEdge
. You are recommended supplyingSome
unless you know that the graph does not contain any directed hyperedge.- fEdge
To apply to any directed or undirected edge in this possibly mixed graph. If not present simple edges will be mapped by the mandatory edge mapper you supply. You are recommended supplying
Some
unless you know that the graph does not contain any simple edge.- returns
The mapped graph with possibly changed node and edge type parameters.
- final def mapHyperBound[NN, EC <: Edge[NN]](fNode: (NodeT) => NN, fHyperEdge: (Several[NN]) => EC, fDiHyperEdge: Option[(OneOrMore[NN], OneOrMore[NN]) => EC] = None, fEdge: Option[(NN, NN) => EC] = None)(implicit w: <:<[E, AnyHyperEdge[N]]): DefaultGraphImpl[NN, EC]
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
Creates a new graph with nodes and edges that are computed by the supplied mapping functions.
You can call this flavor only if this graph's edge type is typed. Otherwise see
mapHyper
.See overload except the parameter
- fHyperEdge
has a simplified signature in this overload leaving out the inner edge. This comes in handy whenever you don't need to inspect inner edges.
- Definition Classes
- GraphOps
- def maxDegree(implicit nodeDegree: DegreeFunction = Degree, degreeFilter: (Int) => Boolean = AnyDegree): Int
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.- Definition Classes
- GraphDegree
- def minDegree(implicit nodeDegree: DegreeFunction = Degree, degreeFilter: (Int) => Boolean = AnyDegree): Int
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.- Definition Classes
- GraphDegree
- final def minusMinus(delNodes: IterableOnce[N], delEdges: IterableOnce[E]): DefaultGraphImpl[N, E]
Implements the heart of
--
calling thefrom
factory method of the companion object.Implements the heart of
--
calling thefrom
factory method of the companion object. Note that this method must be reimplemented in each module having its own factory methods such asconstrained
does.- Attributes
- protected
- Definition Classes
- AdjacencyListBase
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newBuilder: Builder[N, E, DefaultGraphImpl]
- Attributes
- protected[this]
- Definition Classes
- DefaultGraphImpl → GraphLike
- def newDiHyperEdge(outer: E, sources: OneOrMore[NodeT], targets: OneOrMore[NodeT]): EdgeT
- def newEdge(outer: E, node_1: NodeT, node_2: NodeT): EdgeT
- final def newEdgeTArray(size: Int): Array[EdgeT]
- Attributes
- protected
- Definition Classes
- AdjacencyListGraph → AdjacencyListBase
- Annotations
- @inline()
- final def newHyperEdge(outer: E, nodes: Several[NodeT]): EdgeT
- final def newNode(n: N): NodeT
- Attributes
- protected
- Definition Classes
- AdjacencyListBase → GraphBase
- Annotations
- @inline()
- final def newNodeSet: NodeSetT
- Attributes
- protected
- Definition Classes
- DefaultGraphImpl → AdjacencyListBase
- Annotations
- @inline()
- final def newNodeWithHints(n: N, h: Hints): NodeBase_
- Attributes
- protected
- Definition Classes
- DefaultGraphImpl → AdjacencyListBase
- Annotations
- @inline()
- def newPathBuilder(start: NodeT)(implicit sizeHint: Int = defaultPathSize, edgeSelector: (NodeT, NodeT) => Option[EdgeT]): PathBuilderImpl
Instantiates a PathBuilder for this graph.
Instantiates a PathBuilder for this graph.
- start
The node this path starts at.
- sizeHint
Expected maximum number of nodes on this path.
- edgeSelector
Determines the edge to be selected between neighbor nodes if an edge is not supplied explicitly. This is only relevant in case of multigraphs.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- def newWalkBuilder(start: NodeT)(implicit sizeHint: Int = defaultPathSize, edgeSelector: (NodeT, NodeT) => Option[EdgeT]): WalkBuilderImpl
Instantiates a WalkBuilder for this graph.
Instantiates a WalkBuilder for this graph.
- start
The node this walk starts at.
- sizeHint
Expected maximum number of nodes on this walk.
- edgeSelector
Determines the edge to be selected between neighbor nodes if an edge is not supplied explicitly. This is only relevant in case of multigraphs.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- def nextHandle: Handle
Avoid calling this directly, prefer
withHandle
instead.Avoid calling this directly, prefer
withHandle
instead.- Attributes
- protected
- Definition Classes
- State
- final val noEdge: EdgePredicate
Edge predicate always returning
false
. - final val noNode: NodePredicate
Node predicate always returning
false
. - final def nodes: AdjacencyListNodeSet
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).- returns
Set of all contained nodes.
- Definition Classes
- DefaultGraphImpl → AdjacencyListGraph → GraphBase
- Annotations
- @inline()
- final def nonTrivial: Boolean
true
if this graph has at least 2 nodes.true
if this graph has at least 2 nodes.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def order: Int
The order - commonly referred to as |G| - of this graph equaling to the number of nodes.
- def outerEdgeTraverser(root: NodeT, parameters: Parameters = Parameters(), subgraphNodes: NodePredicate = anyNode, subgraphEdges: EdgePredicate = anyEdge, ordering: ElemOrdering = NoOrdering, maxWeight: Option[Weight] = None): OuterEdgeTraverserImpl
Creates a OuterEdgeTraverser based on
scala.collection.Iterable[E[N]]
.Creates a OuterEdgeTraverser based on
scala.collection.Iterable[E[N]]
.- root
The node where subsequent graph traversals start.
- parameters
The properties controlling subsequent traversals.
- subgraphNodes
Restricts subsequent graph traversals to visit only nodes holding this predicate.
- subgraphEdges
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
- ordering
If a
NodeOrdering
orEdgeOrdering
different fromNoOrdering
is supplied neighbor nodes will visited during the traversal according to this ordering.- maxWeight
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.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- def outerElemTraverser(root: NodeT, parameters: Parameters = Parameters(), subgraphNodes: NodePredicate = anyNode, subgraphEdges: EdgePredicate = anyEdge, ordering: ElemOrdering = NoOrdering, maxWeight: Option[Weight] = None): OuterElemTraverserImpl
Creates a OuterElemTraverser based on
scala.collection.Iterable[OuterElem]
.Creates a OuterElemTraverser based on
scala.collection.Iterable[OuterElem]
.- root
The node where subsequent graph traversals start.
- parameters
The properties controlling subsequent traversals.
- subgraphNodes
Restricts subsequent graph traversals to visit only nodes holding this predicate.
- subgraphEdges
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
- ordering
If a
NodeOrdering
orEdgeOrdering
different fromNoOrdering
is supplied neighbor nodes will visited during the traversal according to this ordering.- maxWeight
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.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- def outerIterator: Iterator[OuterElem]
Iterator over all inner nodes and edges.
- def outerNodeDownUpTraverser(root: NodeT, parameters: Parameters = Parameters(), subgraphNodes: NodePredicate = anyNode, subgraphEdges: EdgePredicate = anyEdge, ordering: ElemOrdering = NoOrdering, maxWeight: Option[Weight] = None): OuterNodeDownUpTraverserImpl
Creates a OuterNodeDownUpTraverser based on
scala.collection.Iterable[(Boolean, N)]
where theBoolean
parameter istrue
if the traversal takes place in downward andfalse
if it takes place in upward direction.Creates a OuterNodeDownUpTraverser based on
scala.collection.Iterable[(Boolean, N)]
where theBoolean
parameter istrue
if the traversal takes place in downward andfalse
if it takes place in upward direction.- root
The node where subsequent graph traversals start.
- parameters
The properties controlling subsequent traversals. A
kind
different fromDepthFirst
will be ignored.- subgraphNodes
Restricts subsequent graph traversals to visit only nodes holding this predicate.
- subgraphEdges
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
- ordering
If a
NodeOrdering
orEdgeOrdering
different fromNoOrdering
is supplied neighbor nodes will visited during the traversal according to this ordering.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- def outerNodeTraverser(root: NodeT, parameters: Parameters = Parameters(), subgraphNodes: NodePredicate = anyNode, subgraphEdges: EdgePredicate = anyEdge, ordering: ElemOrdering = NoOrdering, maxWeight: Option[Weight] = None): OuterNodeTraverserImpl
Creates a OuterNodeTraverser based on
scala.collection.Iterable[N]
.Creates a OuterNodeTraverser based on
scala.collection.Iterable[N]
.- root
The node where subsequent graph traversals start.
- parameters
The properties controlling subsequent traversals.
- subgraphNodes
Restricts subsequent graph traversals to visit only nodes holding this predicate.
- subgraphEdges
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
- ordering
If a
NodeOrdering
orEdgeOrdering
different fromNoOrdering
is supplied neighbor nodes will visited during the traversal according to this ordering.- maxWeight
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.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- final def plusPlus[N2 >: N, E2 >: E <: Edge[N2]](newNodes: IterableOnce[N2], newEdges: IterableOnce[E2]): DefaultGraphImpl[N2, E2]
Implements the heart of
++
calling thefrom
factory method of the companion object.Implements the heart of
++
calling thefrom
factory method of the companion object. Note that this method must be reimplemented in each module having its own factory methods such asconstrained
does.- Attributes
- protected
- Definition Classes
- AdjacencyListBase
- def releaseHandle(handle: Handle): Unit
Avoid calling this directly, prefer
withHandle
instead.Avoid calling this directly, prefer
withHandle
instead.- Attributes
- protected
- Definition Classes
- State
- final def remaining(nodesToDelete: Set[N], edgesToDelete: IterableOnce[E]): (Set[N], Set[E])
Calculates the remaining nodes and edges of this graph after subtracting the passed elements.
Calculates the remaining nodes and edges of this graph after subtracting the passed elements.
- Attributes
- protected
- Definition Classes
- AdjacencyListBase
- def removedAll(isolatedNodes: IterableOnce[N], edges: IterableOnce[E]): DefaultGraphImpl[N, E]
- Definition Classes
- AdjacencyListBase → GraphOps
- final def removedAll(edges: IterableOnce[E]): DefaultGraphImpl[N, E]
Same as
removedAll(isolatedNodes, edges)
but with emptyisolatedNodes
.Same as
removedAll(isolatedNodes, edges)
but with emptyisolatedNodes
. $edgesOnlyUseCase- Definition Classes
- GraphOps
- Annotations
- @inline()
- def render(style: Style, nodeSeparator: String = GraphBase.defaultSeparator, edgeSeparator: String = GraphBase.defaultSeparator, nodeEdgeSetSeparator: String = GraphBase.defaultSeparator, withInnerPrefix: Boolean = true)(implicit ordNode: NodeOrdering = defaultNodeOrdering, ordEdge: EdgeOrdering = defaultEdgeOrdering): String
Sorts all nodes of this graph by
ordNode
followed by all edges sorted byordEdge
and concatenates their string representationnodeSeparator
andedgeSeparator
respectively.Sorts all nodes of this graph by
ordNode
followed by all edges sorted byordEdge
and concatenates their string representationnodeSeparator
andedgeSeparator
respectively.- nodeEdgeSetSeparator
to separate the node set from the edge set.
- withInnerPrefix
whether the node set and edge set should be prefixed.
- ordNode
the node ordering defaulting to
defaultNodeOrdering
.- ordEdge
the edge ordering defaulting to
defaultEdgeOrdering
.
- Definition Classes
- ToString
- final def serializeTo(out: ObjectOutputStream): Unit
- Attributes
- protected
- Definition Classes
- AdjacencyListBase
- final def size: Int
The size - commonly referred to as |E| - of this graph equaling to the number of edges.
- def strongComponentTraverser(parameters: Parameters = Parameters(), subgraphNodes: NodePredicate = anyNode, subgraphEdges: EdgePredicate = anyEdge, ordering: ElemOrdering = NoOrdering, maxWeight: Option[Weight] = None): StrongComponentTraverserImpl
Creates a StrongComponentTraverser.
Creates a StrongComponentTraverser.
- parameters
The properties controlling subsequent traversals.
- subgraphNodes
Restricts subsequent graph traversals to visit only nodes holding this predicate.
- subgraphEdges
Restricts subsequent graph traversals to walk only along edges that hold this predicate.
- ordering
If a
NodeOrdering
orEdgeOrdering
different fromNoOrdering
is supplied neighbor nodes will visited during the traversal according to this ordering.- maxWeight
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.
- Definition Classes
- GraphTraversalImpl → GraphTraversal
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toIterable: Iterable[InnerElem]
Iterable over all nodes and edges.
- def toOuterIterable: Iterable[OuterElem]
Iterable over all nodes and edges.
- def toString(): String
Sorts nodes and edges as long as this
Graph
has at most 100 elements.Sorts nodes and edges as long as this
Graph
has at most 100 elements. See alsodef render
.- Definition Classes
- ToString → AnyRef → Any
- final def topologicalSort[U](implicit visitor: (InnerElem) => U = empty): TopologicalSort
Sorts this graph topologically.
Sorts this graph topologically. Hooks are ignored.
- visitor
called for each inner node or inner edge visited during the sort. See
componentTraverser
for more control by means ofFluentProperties
.
- Definition Classes
- GraphTraversal
- final def topologicalSortByComponent[U](implicit visitor: (InnerElem) => U = empty): Iterable[TopologicalSort]
Sorts every isolated component of this graph topologically.
Sorts every isolated component of this graph topologically. Hooks are ignored.
- visitor
called for each inner node or inner edge visited during the sort. See
componentTraverser
for more control by means ofFluentProperties
.
- Definition Classes
- GraphTraversal
- def totalDegree(implicit nodeDegree: DegreeFunction = Degree, degreeFilter: (Int) => Boolean = AnyDegree): Int
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.- nodeDegree
the degree function to apply to the nodes defaulting to
Degree
. Non-default predefined degree functions areInDegree
andOutDegree
.- degreeFilter
selects nodes to be included by their degree.
- Definition Classes
- GraphDegree
- def totalWeight: Double
The Sum of the weight of all edges.
- final def union[N2 >: N, E2 >: E <: Edge[N2]](that: AnyGraph[N2, E2]): DefaultGraphImpl[N2, E2]
Computes the union between this graph and
that
graph.Computes the union between this graph and
that
graph.- Definition Classes
- GraphOps
- Annotations
- @inline()
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withHandle[T](reuse: Option[Handle] = None)(block: (Handle) => T): T
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.
- returns
The result of the code block executed.
- Attributes
- protected
- Definition Classes
- State
- def withHandles[T](nr: Int, reuse: Array[Handle] = Array.empty[Handle])(block: (Array[Handle]) => T): T
Executes a code block in the context
nr
new state handlers or alternatively in the context of the state handlersreuse
.Executes a code block in the context
nr
new state handlers or alternatively in the context of the state handlersreuse
.- returns
The result of the code block executed.
- Attributes
- protected
- Definition Classes
- State
- final def |(that: AnyGraph[N, E]): DefaultGraphImpl[N, E]
Alias for
union
.Alias for
union
.- Definition Classes
- GraphOps
- Annotations
- @inline()
Shadowed Implicit Value Members
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from DefaultGraphImpl[N, E] toany2stringadd[DefaultGraphImpl[N, E]] performed by method any2stringadd in scala.Predef.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(defaultGraphImpl: any2stringadd[DefaultGraphImpl[N, E]]).+(other)
- Definition Classes
- any2stringadd
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from DefaultGraphImpl[N, E] toStringFormat[DefaultGraphImpl[N, E]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def →[B](y: B): (DefaultGraphImpl[N, E], B)
- Implicit
- This member is added by an implicit conversion from DefaultGraphImpl[N, E] toArrowAssoc[DefaultGraphImpl[N, E]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.
Welcome to the Graph for Scala API reference. Some suggested entry points:
AnyGraph
immutable.Graph
and its inner nodesmutable.Graph
and its inner nodes.edges
package and its subpackageshyperedges
package and its subpackages.labeled edges
packagemultilabeled edges
packagelabeled hyperedges
packagemultilabeled hyperedges
packageordered labeled hyperedges
packageordered multilabeled hyperedges
objectgeneric
package.GraphTraversal
andTraverserInnerNode
.RandomGraph
.GraphGen
.