class DirectedGraph[T] extends Serializable

Provides useful graph operations for a directed graph.

The node connection in the graph has direction. This class stores a source node. Note that it doesn't maintain the topology. The topology of the graph is stored in the connection of the nodes.

T

Node element type

Annotations
@SerialVersionUID()
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DirectedGraph
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DirectedGraph(source: Node[T], reverse: Boolean = false)

    source

    source node of the directed graph

    reverse

    use the original direction or the reversed direction

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def BFS: Iterator[Node[T]]

    Breadth first search on the graph.

    Breadth first search on the graph. Note that this is a directed BFS. Although eachs node contains both previous and next nodes, only one direction is used.

    returns

    An iterator to go through nodes in the graph in a BFS order

  5. def DFS: Iterator[Node[T]]

    Depth first search on the graph.

    Depth first search on the graph. Note that this is a directed DFS. Although eachs node contains both previous and next nodes, only one direction is used.

    returns

    An iterator to go through nodes in the graph in a DFS order

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  8. def cloneGraph(reverseEdge: Boolean = false): DirectedGraph[T]

    Clone the graph structure, will not clone the node element

    Clone the graph structure, will not clone the node element

    reverseEdge

    if reverse the edge in the nodes

  9. def edges: Int

    How many edges in the graph

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. val reverse: Boolean
  20. def size: Int

    How many nodes in the graph

  21. val source: Node[T]
  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. def topologySort: Array[Node[T]]

    Topology sort.

    Topology sort.

    returns

    A sequence of sorted graph nodes

  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped