trait GraphBase[N, E[+X] <: EdgeLikeIn[X]] extends 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.
- N
the user type of the nodes (vertices) in this graph.
- E
the kind of the edges (links) in this graph.
- Self Type
- GraphBase[N, E]
- Alphabetic
- By Inheritance
- GraphBase
- Serializable
- AnyRef
- Any
- by ChainingOps
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Type Members
- trait Edge extends Serializable
- type EdgeFilter = (EdgeT) => Boolean
- sealed trait EdgeOrdering extends Ordering[EdgeT] with ElemOrdering
- trait EdgeSet extends AnySet[EdgeT] with ExtSetMethods[EdgeT] with Serializable
- abstract type EdgeSetT <: EdgeSet
- abstract type EdgeT <: InnerEdgeParam[N, E, NodeT, E] with InnerEdge with Serializable
- sealed trait ElemOrdering extends AnyRef
Base trait for graph
Ordering
s.Base trait for graph
Ordering
s.- Attributes
- protected
- trait InnerEdge extends Iterable[NodeT] with InnerEdgeParam[N, E, NodeT, E] with Edge with InnerElem
- sealed trait InnerElem extends AnyRef
- trait InnerNode extends InnerNodeParam[N] with Node with InnerElem
- trait Node extends Serializable
- type NodeFilter = (NodeT) => Boolean
- sealed trait NodeOrdering extends Ordering[NodeT] with ElemOrdering
Ordering for the path dependent type NodeT.
- trait NodeSet extends AnySet[NodeT] with ExtSetMethods[NodeT]
- abstract type NodeSetT <: NodeSet
- abstract type NodeT <: InnerNode
Abstract Value Members
- abstract def edges: EdgeSetT
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.
- abstract def isDirected: Boolean
Whether all edges of this graph are directed.
- abstract def isHyper: Boolean
Whether this graph contains at least one hyperedges.
- abstract def isMixed: Boolean
Whether this graph contains at least one directed and one undirected edge.
- abstract 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.
- abstract def newEdge(innerEdge: E[NodeT]): EdgeT
- Attributes
- protected
- abstract def newNode(n: N): NodeT
- Attributes
- protected
- abstract def nodes: NodeSetT
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.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (GraphBase[N, E], B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final val anyEdge: EdgeFilter
Default edge filter letting path all edges (non-filter).
- final val anyNode: NodeFilter
Default node filter letting traverse all nodes (non-filter).
- final lazy val anyOrdering: AnyOrdering[N]
- Attributes
- protected
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final lazy val defaultEdgeOrdering: EdgeOrdering
- final lazy val defaultNodeOrdering: NodeOrdering
- implicit final def edgeToEdgeCont(e: E[N]): E[NodeT]
- Attributes
- protected
- def ensuring(cond: (GraphBase[N, E]) => Boolean, msg: => Any): GraphBase[N, E]
- def ensuring(cond: (GraphBase[N, E]) => Boolean): GraphBase[N, E]
- def ensuring(cond: Boolean, msg: => Any): GraphBase[N, E]
- def ensuring(cond: Boolean): GraphBase[N, E]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def graphSize: 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.
Method
size
is reserved for the number of nodes and edges becauseGraph
is alsoSetLike
with set elements being nodes or edges. - def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def initialize(nodes: Iterable[N], edges: Iterable[E[N]]): 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 by
from
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
- final def isCustomEdgeFilter(f: EdgeFilter): Boolean
true
iff
is not equivalent toanyEdge
.true
iff
is not equivalent toanyEdge
.- Annotations
- @inline()
- final def isCustomNodeFilter(f: NodeFilter): Boolean
true
iff
is not equivalent toanyNode
.true
iff
is not equivalent toanyNode
.- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def isTrivial: Boolean
true
if this graph has at most 1 node.true
if this graph has at most 1 node.- Annotations
- @inline()
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final val noNode: NodeFilter
Node predicate always returning
false
. - final def nonTrivial: Boolean
true
if this graph has at least 2 nodes.true
if this graph has at least 2 nodes.- Annotations
- @inline()
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def order: Int
The order - commonly referred to as |G| - of this graph equaling to the number of nodes.
- def pipe[B](f: (GraphBase[N, E]) => B): B
- Implicit
- This member is added by an implicit conversion from GraphBase[N, E] toChainingOps[GraphBase[N, E]] performed by method ChainingOps in scalax.collection.
- Definition Classes
- ChainingOps
- val self: GraphBase[N, E]
- Implicit
- This member is added by an implicit conversion from GraphBase[N, E] toChainingOps[GraphBase[N, E]] performed by method ChainingOps in scalax.collection.
- Definition Classes
- ChainingOps
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tap[U](f: (GraphBase[N, E]) => U): GraphBase[N, E]
- Implicit
- This member is added by an implicit conversion from GraphBase[N, E] toChainingOps[GraphBase[N, E]] performed by method ChainingOps in scalax.collection.
- Definition Classes
- ChainingOps
- def toString(): String
- Definition Classes
- AnyRef → Any
- def totalWeight: Double
- 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])
- object Edge extends Serializable
- Annotations
- @transient()
- object EdgeOrdering extends Serializable
Ordering for the path dependent type EdgeT.
- object EdgeT
- Annotations
- @transient()
- object InnerEdge extends Serializable
- Annotations
- @transient()
- object InnerNode extends Serializable
- object NoOrdering extends ElemOrdering with Serializable
The empty ElemOrdering.
- object Node extends Serializable
- Annotations
- @transient()
- object NodeOrdering extends Serializable
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 GraphBase[N, E] toStringFormat[GraphBase[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): (GraphBase[N, E], B)
- Implicit
- This member is added by an implicit conversion from GraphBase[N, E] toArrowAssoc[GraphBase[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 navigation entry points:
Graph
mutable.Graph
and its inner nodes.GraphEdge
objectedge
packageGraphPredef
object andImplicits
object.GraphTraversal
andTraverserInnerNode
.RandomGraph
.GraphGen
.