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
- Serializable
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
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
-
abstract
class
NodeBase extends InnerNode
- Attributes
- protected
- 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 with Serializable
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[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- 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: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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()
-
def
initialize(nodes: Traversable[N], edges: Traversable[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()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
order: Int
The order - commonly referred to as |G| - of this graph equaling to the number of nodes.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def totalWeight: Double
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def →[B](y: B): (GraphBase[N, E], B)
-
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
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
.