trait AbstractGraph[N] extends (N) => IterableOnce[N]
Represents a(n im)mutable (multi-)graph with (un)ordered edges.
- Source
- AbstractGraph.scala
- Alphabetic
- By Inheritance
- AbstractGraph
- Function1
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def apply(s: N): IterableOnce[N]
Returns a given node's successor nodes.
Returns a given node's successor nodes.
- Definition Classes
- AbstractGraph → Function1
- abstract def vertices: IterableOnce[N]
Concrete Value Members
- def andThen[A](g: (IterableOnce[N]) => A): (N) => A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def compose[A](g: (A) => N): (A) => IterableOnce[N]
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def nonEmpty: Boolean
- def rootNodes(ignoreSelfRecursiveDependencies: Boolean = true): Set[N]
Returns the set of nodes with no incoming dependencies; self-dependencies are optionally ignored.
Returns the set of nodes with no incoming dependencies; self-dependencies are optionally ignored.
- ignoreSelfRecursiveDependencies
If true self-dependencies are ignored. This means that nodes that have a self dependency are considered as being root nodes if they have no further incoming dependencies.
- returns
The set of root nodes which can be freely mutated.
scala> val g = org.opalj.graphs.Graph.empty[AnyRef] += ("a" -> "b") += ("b" -> "c") += ("b" -> "d") += ("a" -> "e") += ("f" -> "e") += ("y" -> "y") += ("a" -> "f") g: org.opalj.graphs.Graph[AnyRef] = Graph{ d => {} c => {} a => {f,e,b} b => {d,c} e => {} y => {y} f => {e} } scala> g.rootNodes(ignoreSelfRecursiveDependencies = true) res1: scala.collection.mutable.Set[AnyRef] = Set(a) scala> g.rootNodes(ignoreSelfRecursiveDependencies = false) res2: scala.collection.mutable.Set[AnyRef] = Set(y, a)
Example: - def toDot(dir: String = "forward", ranksep: String = "1.0", rankdir: String = "TB"): String
- def toNodes: Iterable[Node]
- def toString(): String
- Definition Classes
- AbstractGraph → Function1 → AnyRef → Any