class UnidirectionalGraph extends AbstractGraph[Int]
Efficient representation of a mutable graph where the nodes are identified using consecutive int values. This graph in particular supports the case where many nodes do not have successors. Computing the strongly connected components is particular efficient as no transformations are are required.
Thread Safety
This class is not thread-safe!
- Source
- UnidirectionalGraph.scala
val g = new org.opalj.graphs.UnidirectionalGraph(10)() += (3,2) += (4,4) += (4,2) += (2, 4)
- Alphabetic
- By Inheritance
- UnidirectionalGraph
- AbstractGraph
- Function1
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new UnidirectionalGraph(verticesCount: Int)(successors: Array[IntTrieSet] = new Array[IntTrieSet](verticesCount))
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def add(s: Int, t: Int): UnidirectionalGraph.this.type
Adds a new edge between the given vertices.
Adds a new edge between the given vertices.
(If the vertices were not previously added, they will be added.)
- def andThen[A](g: (IterableOnce[Int]) => A): (Int) => A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def apply(s: Int): IterableOnce[Int]
Returns a given node's successor nodes.
Returns a given node's successor nodes.
- Definition Classes
- UnidirectionalGraph → AbstractGraph → Function1
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def compose[A](g: (A) => Int): (A) => IterableOnce[Int]
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def edges: (Int) => IntIterator
- 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() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nonEmpty: Boolean
- Definition Classes
- UnidirectionalGraph → AbstractGraph
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def rootNodes(ignoreSelfRecursiveDependencies: Boolean = true): Set[Int]
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.
- Definition Classes
- AbstractGraph
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 sccs(filterSingletons: Boolean = false): List[List[Int]]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def theSuccessors(s: Int): IntTrieSet
Returns a node's successors.
- def toDot(dir: String = "forward", ranksep: String = "1.0", rankdir: String = "TB"): String
- Definition Classes
- AbstractGraph
- def toNodes: Iterable[Node]
- Definition Classes
- AbstractGraph
- def toString(): String
- Definition Classes
- AbstractGraph → Function1 → AnyRef → Any
- def vertices: Range
- Definition Classes
- UnidirectionalGraph → AbstractGraph
- val verticesCount: Int
- 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])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated