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()
- Alphabetic
- By Inheritance
- DirectedGraph
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
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
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
-
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
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
-
def
edges: Int
How many edges in the graph
-
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] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val reverse: Boolean
-
def
size: Int
How many nodes in the graph
- val source: Node[T]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
topologySort: Array[Node[T]]
Topology sort.
Topology sort.
- returns
A sequence of sorted graph nodes
-
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( ... )