GraphBase

scalax.collection.GraphBase
See theGraphBase companion object
trait GraphBase[N, E <: Edge[N], +CC <: ([X, Y <: Edge[X]] =>> GraphBase[X, Y, CC])] extends GraphOps[N, E, CC], OuterElems[N, E], Serializable

Base template trait for graphs.

This trait provides the common structure and base operations for immutable graphs independently of their representation. Base operations also cover one-step traversals. For unlimited traversals see trait GraphTraversal.

Users of Graph usually don't interact directly with this trait but with trait Graph instead which inherits the functionality provided by this trait.

If E inherits DirectedEdgeLike the graph is directed, otherwise it is undirected or mixed.

Type parameters

E

the kind of the edges (links) in this graph.

N

the user type of the nodes (vertices) in this graph.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait GraphOps[N, E, CC]
trait OuterElems[N, E]
class Object
trait Matchable
class Any
Show all
Known subtypes
trait GraphLike[N, E, CC]
trait AdjacencyListBase[N, E, CC]
trait AdjacencyListGraph[N, E, CC]
class DefaultGraphImpl[N, E]
trait AdjacencyListGraph[N, E, CC]
class DefaultGraphImpl[N, E]
trait Graph[N, E]
trait GraphLike[N, E, CC]
trait Graph[N, E]
trait AnyGraph[N, E]
trait GraphTraversal[N, E]
trait GraphTraversalImpl[N, E]
Show all
Self type
GraphBase[N, E, CC]

Members list

Type members

Classlikes

object BaseInnerEdge

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait BaseInnerEdge extends InnerEdge, Equals

Attributes

Companion
object
Supertypes
trait InnerEdge
trait InnerElem
trait Edge[NodeT]
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
Self type
trait BaseInnerNode extends Node, InnerNode

Attributes

Supertypes
trait InnerNode
trait InnerElem
trait Node
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
object EdgeOrdering extends Serializable

Ordering for the path dependent type EdgeT.

Ordering for the path dependent type EdgeT.

Attributes

Companion
trait
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Self type
sealed trait EdgeOrdering extends Ordering[EdgeT]

Ordering for the path dependent type EdgeT.

Ordering for the path dependent type EdgeT.

Attributes

Companion
object
Supertypes
trait Ordering[EdgeT]
trait Equiv[EdgeT]
trait Serializable
trait Comparator[EdgeT]
class Object
trait Matchable
class Any
Show all
Known subtypes
object ArityOrdering
object None

Attributes

Supertypes
trait Serializable
trait Set[EdgeT]
trait Equals
trait SetOps[EdgeT, Set, Set[EdgeT]]
trait EdgeT => Boolean
trait Iterable[EdgeT]
class Object
trait Matchable
class Any
Show all
Known subtypes
object NoOrdering extends Serializable

The empty ElemOrdering.

The empty ElemOrdering.

Attributes

Supertypes
trait Serializable
class Object
trait Matchable
class Any
Self type
NoOrdering.type
object Node

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Node.type
trait Node extends Serializable

Attributes

Companion
object
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
object NodeOrdering

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait NodeOrdering extends Ordering[NodeT]

Ordering for the path dependent type NodeT.

Ordering for the path dependent type NodeT.

Attributes

Companion
object
Supertypes
trait Ordering[NodeT]
trait Equiv[NodeT]
trait Serializable
trait Comparator[NodeT]
class Object
trait Matchable
class Any
Show all
Known subtypes
object None
trait NodeSet extends Set[NodeT], ExtSetMethods[NodeT]

Attributes

Supertypes
trait Set[NodeT]
trait Equals
trait SetOps[NodeT, Set, Set[NodeT]]
trait NodeT => Boolean
trait Iterable[NodeT]
class Object
trait Matchable
class Any
Show all
Known subtypes

Inherited classlikes

object InnerEdge

Attributes

Inherited from:
GraphOps
Supertypes
class Object
trait Matchable
class Any
trait InnerEdge extends InnerElem

Attributes

Inherited from:
GraphOps
Supertypes
trait InnerElem
class Object
trait Matchable
class Any
Known subtypes
sealed trait InnerElem

Attributes

Inherited from:
GraphOps
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object InnerNode

Attributes

Inherited from:
GraphOps
Supertypes
class Object
trait Matchable
class Any
trait InnerNode extends InnerElem

Attributes

Inherited from:
GraphOps
Supertypes
trait InnerElem
class Object
trait Matchable
class Any
Known subtypes
sealed case class OuterEdge(edge: E) extends OuterElem

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(...).

Attributes

Inherited from:
OuterElems
Supertypes
trait Serializable
trait Product
trait Equals
trait OuterElem
class Object
trait Matchable
class Any
Show all
trait OuterElem

Attributes

Inherited from:
OuterElems
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class OuterEdge
class OuterNode
sealed case class OuterNode(node: N) extends OuterElem

Wraps any type to be accepted when calling Graph(...).

Wraps any type to be accepted when calling Graph(...).

Attributes

Inherited from:
OuterElems
Supertypes
trait Serializable
trait Product
trait Equals
trait OuterElem
class Object
trait Matchable
class Any
Show all

Types

type EdgeSetT <: EdgeSet
type EdgeT <: InnerEdgeLike[NodeT] & BaseInnerEdge
type NodeSetT <: NodeSet

Inherited types

Attributes

Inherited from:
GraphOps

Attributes

Inherited from:
GraphOps

Value members

Abstract methods

The edge set of this Graph commonly referred to as E(G).

The edge set of this Graph commonly referred to as E(G).

Attributes

Returns

Set of all contained edges.

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).

Attributes

Returns

Set of all contained nodes.

Concrete methods

true if f is not equivalent to anyEdge.

true if f is not equivalent to anyEdge.

Attributes

true if f is not equivalent to anyNode.

true if f is not equivalent to anyNode.

Attributes

final def order: Int

The order - commonly referred to as |G| - of this graph equaling to the number of nodes.

The order - commonly referred to as |G| - of this graph equaling to the number of nodes.

Attributes

final def size: Int

The size - commonly referred to as |E| - of this graph equaling to the number of edges.

The size - commonly referred to as |E| - of this graph equaling to the number of edges.

Attributes

The Sum of the weight of all edges.

The Sum of the weight of all edges.

Attributes

Inherited methods

final def &(that: AnyGraph[N, E]): CC[N, E]

Alias for intersect.

Alias for intersect.

Attributes

Inherited from:
GraphOps
final def &~(that: AnyGraph[N, E]): CC[N, E]

Alias for diff.

Alias for diff.

Attributes

Inherited from:
GraphOps
final def ++[N2 >: N, E2 >: E <: Edge[N2]](edges: IterableOnce[E2])(implicit e: E2 <:< Edge[N2]): CC[N2, E2]

Alias for concat(edges).

Alias for concat(edges).

Attributes

Inherited from:
GraphOps
final def ++[N2 >: N, E2 >: E <: Edge[N2]](isolatedNodes: IterableOnce[N2], edges: IterableOnce[E2])(implicit e: E2 <:< Edge[N2]): CC[N2, E2]

Alias for concat(isolatedNodes, edges).

Alias for concat(isolatedNodes, edges).

Attributes

Inherited from:
GraphOps
final def apply(edge: E): Boolean

Whether the given edge is contained in this graph.

Whether the given edge is contained in this graph.

Attributes

Inherited from:
GraphOps
final def apply(node: N): Boolean

Whether the given node is contained in this graph.

Whether the given node is contained in this graph.

Attributes

Inherited from:
GraphOps
def concat[N2 >: N, E2 >: E <: Edge[N2]](edges: IterableOnce[E2])(implicit e: E2 <:< Edge[N2]): CC[N2, E2]

Same as concat(isolatedNodes, edges) but with empty isolatedNodes. This method is useful if you don't need to pass any isolated node.

Same as concat(isolatedNodes, edges) but with empty isolatedNodes. This method is useful if you don't need to pass any isolated node.

Attributes

Inherited from:
GraphOps
final def diff(that: AnyGraph[N, E]): CC[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.

Attributes

Inherited from:
GraphOps
final def elementCount: Int

The number of nodes and edges.

The number of nodes and edges.

Attributes

Inherited from:
GraphOps
def filterNot(nodeP: NodePredicate, edgeP: EdgePredicate): CC[N, E]

Computes a new graph without nodes satisfying nodeP and without edges satisfying ePred. If both nodeP and ePred have default values the original graph is retained.

Computes a new graph without nodes satisfying nodeP and without edges satisfying ePred. If both nodeP and ePred have default values the original graph is retained.

Attributes

Inherited from:
GraphOps
final def flatMap[NN, EC <: (Edge)](fNode: NodeT => Seq[NN], fEdge: (Seq[NN], Seq[NN]) => Seq[EC[NN]])(implicit w: E <:< AnyEdge[N]): CC[NN, EC[NN]]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

See overload except the parameter

Value parameters

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.

Attributes

Inherited from:
GraphOps
final def flatMapBound[NN, EC <: Edge[NN]](fNode: NodeT => Seq[NN], fEdge: (Seq[NN], Seq[NN]) => Seq[EC])(implicit w: E <:< AnyEdge[N]): CC[NN, EC]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is typed. Otherwise see flatMap.

See overload except the parameter

Value parameters

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.

Attributes

Inherited from:
GraphOps
final def flatMapDiHyper[NN, EC <: (Edge)](fNode: NodeT => Seq[NN], fDiHyperEdge: (Seq[NN], Seq[NN]) => Seq[EC[NN]], fEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC[NN]]])(implicit w: E <:< AnyDiHyperEdge[N]): CC[NN, EC[NN]]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is generic. Otherwise see flatMapDiHyperBound.

See overload except the parameter

Value parameters

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.

Attributes

Inherited from:
GraphOps
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]])(implicit w: E <:< AnyDiHyperEdge[N]): CC[NN, EC]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is typed. Otherwise see flatMapDiHyper.

See overload except the parameter

Value parameters

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.

Attributes

Inherited from:
GraphOps
final def flatMapHyper[NN, EC <: (Edge)](fNode: NodeT => Seq[NN], fHyperEdge: (Seq[NN]) => Seq[EC[NN]], fDiHyperEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC[NN]]], fEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC[NN]]])(implicit w: E <:< AnyHyperEdge[N]): CC[NN, EC[NN]]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is generic. Otherwise see flatMapHyperBound.

See overload except the parameter

Value parameters

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.

Attributes

Inherited from:
GraphOps
final def flatMapHyperBound[NN, EC <: Edge[NN]](fNode: NodeT => Seq[NN], fHyperEdge: (Seq[NN]) => Seq[EC], fDiHyperEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC]], fEdge: Option[(Seq[NN], Seq[NN]) => Seq[EC]])(implicit w: E <:< AnyHyperEdge[N]): CC[NN, EC]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is typed. Otherwise see flatMapHyper.

See overload except the parameter

Value parameters

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.

Attributes

Inherited from:
GraphOps
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.

Value parameters

opEdge

the binary operator that is passed the cumulated value and an outer edge.

opNode

the binary operator that is passed the cumulated value and an outer node.

Attributes

Inherited from:
GraphOps
final def intersect(that: AnyGraph[N, E]): CC[N, E]

Computes the intersection between this graph and that graph.

Computes the intersection between this graph and that graph.

Attributes

Inherited from:
GraphOps
final def isEmpty: Boolean

Whether this graph contains any node or any edge.

Whether this graph contains any node or any edge.

Attributes

Inherited from:
GraphOps
final def isTrivial: Boolean

true if this graph has at most 1 node.

true if this graph has at most 1 node.

Attributes

Inherited from:
GraphOps
final def map[NN, EC <: (Edge)](fNode: NodeT => NN, fEdge: (NN, NN) => EC[NN])(implicit w: E <:< AnyEdge[N]): CC[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

Value parameters

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.

Attributes

Inherited from:
GraphOps
final def mapBound[NN, EC <: Edge[NN]](fNode: NodeT => NN, fEdge: (NN, NN) => EC)(implicit w: E <:< AnyEdge[N]): CC[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

Value parameters

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.

Attributes

Inherited from:
GraphOps
final def mapDiHyper[NN, EC <: (Edge)](fNode: NodeT => NN, fDiHyperEdge: (OneOrMore[NN], OneOrMore[NN]) => EC[NN], fEdge: Option[(NN, NN) => EC[NN]])(implicit w: E <:< AnyDiHyperEdge[N]): CC[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

Value parameters

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.

Attributes

Inherited from:
GraphOps
final def mapDiHyperBound[NN, EC <: Edge[NN]](fNode: NodeT => NN, fDiHyperEdge: (OneOrMore[NN], OneOrMore[NN]) => EC, fEdge: Option[(NN, NN) => EC])(implicit w: E <:< AnyDiHyperEdge[N]): CC[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

Value parameters

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.

Attributes

Inherited from:
GraphOps
final def mapHyper[NN, EC <: (Edge)](fNode: NodeT => NN, fHyperEdge: (Several[NN]) => EC[NN], fDiHyperEdge: Option[(OneOrMore[NN], OneOrMore[NN]) => EC[NN]], fEdge: Option[(NN, NN) => EC[NN]])(implicit w: E <:< AnyHyperEdge[N]): CC[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

Value parameters

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.

Attributes

Inherited from:
GraphOps
final def mapHyperBound[NN, EC <: Edge[NN]](fNode: NodeT => NN, fHyperEdge: (Several[NN]) => EC, fDiHyperEdge: Option[(OneOrMore[NN], OneOrMore[NN]) => EC], fEdge: Option[(NN, NN) => EC])(implicit w: E <:< AnyHyperEdge[N]): CC[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

Value parameters

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.

Attributes

Inherited from:
GraphOps
final def nonTrivial: Boolean

true if this graph has at least 2 nodes.

true if this graph has at least 2 nodes.

Attributes

Inherited from:
GraphOps
final def union[N2 >: N, E2 >: E <: Edge[N2]](that: AnyGraph[N2, E2]): CC[N2, E2]

Computes the union between this graph and that graph.

Computes the union between this graph and that graph.

Attributes

Inherited from:
GraphOps
final def |(that: AnyGraph[N, E]): CC[N, E]

Alias for union.

Alias for union.

Attributes

Inherited from:
GraphOps

Inherited and Abstract methods

def concat[N2 >: N, E2 >: E <: Edge[N2]](isolatedNodes: IterableOnce[N2], edges: IterableOnce[E2])(implicit e: E2 <:< Edge[N2]): CC[N2, E2]

Creates a new graph by adding all edges and isolatedNodes omitting duplicates. The new graph is upcasted if any of the arguments is an upcast of N respectively E. Use union to concatenate all nodes and edges of another graph.

Creates a new graph by adding all edges and isolatedNodes omitting duplicates. The new graph is upcasted if any of the arguments is an upcast of N respectively E. Use union to concatenate all nodes and edges of another graph.

Value parameters

edges

to be concatenated.

isolatedNodes

to be concatenated. Nodes that are implicitly defined by any edge in edges will be ignored.

Attributes

Inherited from:
GraphOps
def contains(edge: E): Boolean

Whether the given outer edge is contained in this graph.

Whether the given outer edge is contained in this graph.

Attributes

Inherited from:
GraphOps
def contains(node: N): Boolean

Whether the given outer node is contained in this graph.

Whether the given outer node is contained in this graph.

Attributes

Inherited from:
GraphOps
def filter(nodeP: NodePredicate, edgeP: EdgePredicate): CC[N, E]

Computes a new graph with nodes satisfying nodeP and edges satisfying edgeP. If both nodeP and edgeP have default values the original graph is retained.

Computes a new graph with nodes satisfying nodeP and edges satisfying edgeP. If both nodeP and edgeP have default values the original graph is retained.

Attributes

Inherited from:
GraphOps
def find(edge: E): Option[EdgeT]

Searches this graph for an inner edge that wraps an outer edge equalling to the given outer edge.

Searches this graph for an inner edge that wraps an outer edge equalling to the given outer edge.

Attributes

Inherited from:
GraphOps
def find(node: N): Option[NodeT]

Searches this graph for an inner node that wraps an outer node equalling to the given outer node.

Searches this graph for an inner node that wraps an outer node equalling to the given outer node.

Attributes

Inherited from:
GraphOps
def flatMap[NN, EC <: (Edge)](fNode: NodeT => Seq[NN], fEdge: (EdgeT, Seq[NN], Seq[NN]) => Seq[EC[NN]])(implicit w: E <:< AnyEdge[N]): CC[NN, EC[NN]]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is generic. Otherwise see flatMapBound.

Type parameters

EC

The higher kind of the generic edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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. Call outer to get the outer edge of type E.

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 type N of the node.

Attributes

Returns

A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).

Inherited from:
GraphOps
def flatMap[NN, EC <: (Edge)](fNode: NodeT => Seq[NN])(implicit w1: E <:< GenericMapper, w2: EC[N] =:= E, t: ClassTag[EC[NN]]): CC[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.

Type parameters

EC

The higher kind of the generic edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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 type N of the node. If fNode 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.

Attributes

Returns

A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).

Inherited from:
GraphOps
def flatMapBound[NN, EC <: Edge[NN]](fNode: NodeT => Seq[NN], fEdge: (EdgeT, Seq[NN], Seq[NN]) => Seq[EC])(implicit w: E <:< AnyEdge[N]): CC[NN, EC]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is typed. Otherwise see flatMap.

Type parameters

EC

The edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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. Call outer to get the outer edge of type E.

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 type N of the node.

Attributes

Returns

A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).

Inherited from:
GraphOps
def flatMapBound(fNode: NodeT => Seq[N])(implicit w1: E <:< PartialMapper): CC[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.

Value parameters

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 type N of the node. If fNode 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.

Attributes

Inherited from:
GraphOps
def flatMapDiHyper[NN, EC <: (Edge)](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]): CC[NN, EC[NN]]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is generic. Otherwise see flatMapDiHyperBound.

Type parameters

EC

The higher kind of the generic edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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. Call outer 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.

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 type N of the node.

Attributes

Returns

A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).

Inherited from:
GraphOps
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]): CC[NN, EC]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is typed. Otherwise see flatMapDiHyper.

Type parameters

EC

The edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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. Call outer 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.

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 type N of the node.

Attributes

Returns

A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).

Inherited from:
GraphOps
def flatMapHyper[NN, EC <: (Edge)](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]): CC[NN, EC[NN]]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is generic. Otherwise see flatMapHyperBound.

Type parameters

EC

The higher kind of the generic edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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 supplying Some 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.

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. Call outer to get the outer hyperedge of type E.

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 type N of the node.

Attributes

Returns

A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).

Inherited from:
GraphOps
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]): CC[NN, EC]

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

Creates a new graph with nodes and edges returned by fNode respectively fEdge.

You can call this flavor only if this graph's edge type is typed. Otherwise see flatMapHyper.

Type parameters

EC

The edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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 supplying Some 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.

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. Call outer to get the outer hyperedge of type E.

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 type N of the node.

Attributes

Returns

A new graph of possibly changed node and edge types and of any new structure depending on your edge mapper(s).

Inherited from:
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. First opNode is called for all nodes than opEdge for all edges.

Applies a node-specific and an edge-specific binary operator to a cumulated value. First opNode is called for all nodes than opEdge for all edges.

Type parameters

B

the result type of the binary operator.

Value parameters

opEdge

the binary operator that is passed the cumulated value and an inner edge.

opNode

the binary operator that is passed the cumulated value and an inner node.

z

the start value that is passed to opNode the first time.

Attributes

Returns

the cumulated value.

Inherited from:
GraphOps
def get(edge: E): EdgeT

Short for find(edge).get.

Short for find(edge).get.

Attributes

Throws
NoSuchElementException

if the edge is not found.

Inherited from:
GraphOps
def get(node: N): NodeT

Short for find(node).get.

Short for find(node).get.

Attributes

Throws
NoSuchElementException

if the node is not found.

Inherited from:
GraphOps

Whether all edges of this graph are directed.

Whether all edges of this graph are directed.

Attributes

Inherited from:
GraphOps

Whether this graph contains at least one hyperedge.

Whether this graph contains at least one hyperedge.

Attributes

Inherited from:
GraphOps

Whether this graph contains at least one directed and one undirected edge.

Whether this graph contains at least one directed and one undirected edge.

Attributes

Inherited from:
GraphOps

Whether this graph contains at least one multi-edge. We defnie multi-edges by a. two or more directed edges having the same source and target a. two or more undirected edges connecting the same nodes a. two or more (directed) hyperedges that, after being decomposed into (directed) edges, yield any multy-edge as stipulated above.

Whether this graph contains at least one multi-edge. We defnie multi-edges by a. two or more directed edges having the same source and target a. two or more undirected edges connecting the same nodes a. two or more (directed) hyperedges that, after being decomposed into (directed) edges, yield any multy-edge as stipulated above.

Attributes

Inherited from:
GraphOps

Iterator over all inner nodes and edges.

Iterator over all inner nodes and edges.

Attributes

Inherited from:
GraphOps
def map[NN, EC <: (Edge)](fNode: NodeT => NN, fEdge: (EdgeT, NN, NN) => EC[NN])(implicit w: E <:< AnyEdge[N]): CC[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.

Type parameters

EC

The higher kind of the generic edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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. Call outer to get the outer edge of type E.

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 type N of the node.

Attributes

Returns

The mapped graph with possibly changed node and edge type parameters.

Inherited from:
GraphOps
def map[NN, EC <: (Edge)](fNode: NodeT => NN)(implicit w1: E <:< GenericMapper, w2: EC[N] =:= E, t: ClassTag[EC[NN]]): CC[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.

Type parameters

EC

The higher kind of the generic edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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 type N of the node.

Attributes

Returns

The mapped graph with possibly changed node and edge type parameters.

Inherited from:
GraphOps
def mapBound[NN, EC <: Edge[NN]](fNode: NodeT => NN, fEdge: (EdgeT, NN, NN) => EC)(implicit w: E <:< AnyEdge[N]): CC[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.

Type parameters

EC

The edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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. Call outer to get the outer edge of type E.

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 type N of the node.

Attributes

Returns

The mapped graph with possibly changed node and edge type parameters.

Inherited from:
GraphOps
def mapBound(fNode: NodeT => N)(implicit w1: E <:< PartialMapper): CC[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.

Value parameters

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 type N of the node.

Attributes

Returns

The mapped graph with possibly changed node and edge type parameters.

Inherited from:
GraphOps
def mapDiHyper[NN, EC <: (Edge)](fNode: NodeT => NN, fDiHyperEdge: (EdgeT, OneOrMore[NN], OneOrMore[NN]) => EC[NN], fEdge: Option[(EdgeT, NN, NN) => EC[NN]])(implicit w: E <:< AnyDiHyperEdge[N]): CC[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.

Type parameters

EC

The higher kind of the generic edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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. Call outer 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.

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 type N of the node.

Attributes

Returns

The mapped graph with possibly changed node and edge type parameters.

Inherited from:
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]): CC[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.

Type parameters

EC

The edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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. Call outer 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.

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 type N of the node.

Attributes

Returns

The mapped graph with possibly changed node and edge type parameters.

Inherited from:
GraphOps
def mapHyper[NN, EC <: (Edge)](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]): CC[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.

Type parameters

EC

The higher kind of the generic edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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 supplying Some 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.

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. Call outer to get the outer hyperedge of type E.

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 type N of the node.

Attributes

Returns

The mapped graph with possibly changed node and edge type parameters.

Inherited from:
GraphOps
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]): CC[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.

Type parameters

EC

The edge type parameter of this graph.

NN

The node type of the resulting graph which may be unchanged or different from this graph's node type.

Value parameters

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 supplying Some 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.

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. Call outer to get the outer hyperedge of type E.

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 type N of the node.

Attributes

Returns

The mapped graph with possibly changed node and edge type parameters.

Inherited from:
GraphOps

Iterator over all inner nodes and edges.

Iterator over all inner nodes and edges.

Attributes

Inherited from:
GraphOps
protected def removedAll(isolatedNodes: IterableOnce[N], edges: IterableOnce[E]): CC[N, E]

Attributes

Inherited from:
GraphOps

Iterable over all nodes and edges.

Iterable over all nodes and edges.

Attributes

Inherited from:
GraphOps

Iterable over all nodes and edges.

Iterable over all nodes and edges.

Attributes

Inherited from:
GraphOps

Concrete fields

final val anyEdge: EdgePredicate

Default edge filter letting path all edges (non-filter).

Default edge filter letting path all edges (non-filter).

Attributes

final val anyNode: NodePredicate

Default node filter letting traverse all nodes (non-filter).

Default node filter letting traverse all nodes (non-filter).

Attributes

final val noEdge: EdgePredicate

Edge predicate always returning false.

Edge predicate always returning false.

Attributes

final val noNode: NodePredicate

Node predicate always returning false.

Node predicate always returning false.

Attributes