co.teapot.tempest.graph

DirectedGraph

Related Docs: object DirectedGraph | package graph

trait DirectedGraph extends AnyRef

A directed graph where nodes are identified by Int ids. Implementations may or may not allow multiple copies of the same edge (see their documentation). If given an invalid node id, methods call the defaultNeighbors method, which by default throws a NoSuchElementException, but this can be overridden, for example to assume that non-existant nodes simply have no neighbors.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DirectedGraph
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def edgeCount: Long

    The number of edges in this graph.

  2. abstract def existsNode(id: Int): Boolean

  3. abstract def inDegree(id: Int): Int

    Returns the number of in-neighbors of the given id.

  4. abstract def inNeighbors(id: Int): IndexedSeq[Int]

    Returns the in-neighbors of the given id.

  5. abstract def maxNodeId: Int

    The largest node id in this graph (or an upper bound on it).

  6. abstract def nodeCountOption: Option[Int]

    The number of nodes in this graph.

    The number of nodes in this graph. May return None if it is expensive to compute (for example, for the union of two graphs).

  7. abstract def nodeIds: Iterable[Int]

    All nodeIds that exist in the graph.

  8. abstract def outDegree(id: Int): Int

    Returns the number of out-neighbors of the given id.

  9. abstract def outNeighbors(id: Int): IndexedSeq[Int]

    Returns the out-neighbors of the given id.

Concrete 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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def defaultNeighbors(id: Int): IndexedSeq[Int]

    Called by other methods when given an id that doesn't exist in this graph.

    Called by other methods when given an id that doesn't exist in this graph. By default it throws an exception, but implementations can override it to return an IndexedSeq which is the neighbor seq of non-existing nodes (typically an empty IndexedSeq).

  7. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  12. def inDegreeOr0(id: Int): Int

    Returns the in-degree of the given node id, or 0 if the node id does not exist.

  13. def inNeighbor(id: Int, i: Int): Int

    Returns the ith in-neighbor of the node with the given id.

    Returns the ith in-neighbor of the node with the given id. Throws IndexOutOfBoundsException unless 0 <= i < inDegree(id).

  14. def inNeighborList(id: Int): List[Integer]

    Returns the in-neighbors of the given id as a java.util.List.

  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def nodeCount: Int

    Returns the nodeCount if it is defined.

    Returns the nodeCount if it is defined. Otherwise throws an UnsupportedOperationException.

  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def outDegreeOr0(id: Int): Int

    Returns the out-degree of the given node id, or 0 if the node id does not exist.

  21. def outNeighbor(id: Int, i: Int): Int

    Returns the ith out-neighbor of the node with the given id.

    Returns the ith out-neighbor of the node with the given id. Throws IndexOutOfBoundsException unless 0 <= i < outDegree(id).

  22. def outNeighborList(id: Int): List[Integer]

    Returns the out-neighbors of the given id as a java.util.List.

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  24. def toString(): String

    Definition Classes
    DirectedGraph → AnyRef → Any
  25. def transposeView: DirectedGraph

    Returns a view of the transpose of this graph.

  26. def uniformRandomInNeighbor(id: Int, random: Random = Random.self): Int

  27. def uniformRandomOutNeighbor(id: Int, random: Random = Random.self): Int

  28. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def getNodeById(id: Int): Option[NodeWrapper]

    Returns the node with the given id or else None if the given node does not exist in this graph.

    Returns the node with the given id or else None if the given node does not exist in this graph. Deprecated: to decrease the number of objects used, get node neighbors and degrees directly through the graph.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) Rather than using Node objects, use graph method directly

Inherited from AnyRef

Inherited from Any

Ungrouped