GraphOps

scalax.collection.GraphOps
trait GraphOps[N, E <: Edge[N], +CC[X, Y <: Edge[X]]] extends OuterElems[N, E]

Operations common to mutable and immutable graphs.

Attributes

Graph
Supertypes
trait OuterElems[N, E]
class Object
trait Matchable
class Any
Known subtypes
trait GraphBase[N, E, CC]
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

Members list

Type members

Classlikes

object InnerEdge

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
InnerEdge.type
trait InnerEdge extends InnerElem

Attributes

Companion
object
Supertypes
trait InnerElem
class Object
trait Matchable
class Any
Known subtypes
sealed trait InnerElem

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object InnerNode

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
InnerNode.type
trait InnerNode extends InnerElem

Attributes

Companion
object
Supertypes
trait InnerElem
class Object
trait Matchable
class Any
Known subtypes

Inherited classlikes

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 EdgeT <: InnerEdge
type NodeT <: InnerNode

Value members

Abstract methods

Edge predicate with constant true.

Edge predicate with constant true.

Attributes

Node predicate with constant true.

Node predicate with constant true.

Attributes

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

def get(node: N): NodeT

Short for find(node).get.

Short for find(node).get.

Attributes

Throws
NoSuchElementException

if the node is not found.

def get(edge: E): EdgeT

Short for find(edge).get.

Short for find(edge).get.

Attributes

Throws
NoSuchElementException

if the edge is not found.

Whether all edges of this graph are directed.

Whether all edges of this graph are directed.

Attributes

Whether this graph contains at least one hyperedge.

Whether this graph contains at least one hyperedge.

Attributes

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

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

Iterator over all inner nodes and edges.

Iterator over all inner nodes and edges.

Attributes

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.

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.

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.

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.

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.

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.

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.

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.

Edge predicate with constant false.

Edge predicate with constant false.

Attributes

Node predicate with constant false.

Node predicate with constant false.

Attributes

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

Iterator over all inner nodes and edges.

Iterator over all inner nodes and edges.

Attributes

protected def removedAll(isolatedNodes: IterableOnce[N], edges: IterableOnce[E]): CC[N, E]
def size: Int

The size, commonly referred to as ||G||, of this graph equaling to the number of edges.

The size, commonly referred to as ||G||, of this graph equaling to the number of edges.

Attributes

Iterable over all nodes and edges.

Iterable over all nodes and edges.

Attributes

Iterable over all nodes and edges.

Iterable over all nodes and edges.

Attributes

The Sum of the weight of all edges.

The Sum of the weight of all edges.

Attributes

Concrete methods

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

Alias for intersect.

Alias for intersect.

Attributes

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

Alias for diff.

Alias for diff.

Attributes

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

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

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

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

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

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

final def elementCount: Int

The number of nodes and edges.

The number of nodes and edges.

Attributes

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

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

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

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

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

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

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

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

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

final def isEmpty: Boolean

Whether this graph contains any node or any edge.

Whether this graph contains any node or any edge.

Attributes

final def isTrivial: Boolean

true if this graph has at most 1 node.

true if this graph has at most 1 node.

Attributes

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

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

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

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

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

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

final def nonTrivial: Boolean

true if this graph has at least 2 nodes.

true if this graph has at least 2 nodes.

Attributes

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

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

Alias for union.

Alias for union.

Attributes