com.twitter.cassovary.graph.bipartite

BipartiteGraph

class BipartiteGraph extends Graph

NOTE: this data structure could be memory intensive if the max node ID is much larger than the number of elements in the graph, consider using alternative storage. This class represents an array-based bipartite graph. All its nodes are BipartiteNodes. It maintains two types of ID systems: left node ids (< 0) and right node ids (> 0), id value of 0 is not allowed in a Bipartite Graph. Internally it stores two separate arrays, one for left nodes and one for right nodes. The length of the array is the maxNodeId + 1. When a node is being queries, based on the ID value, it converts the ID value to index in the array * (in case of Right, identical; in case of left, the index is id * -1), and retrieves the node object. Edges in the graph fall into two types: from left to right, or from right to left. For example, an edge E that goes from LeftNode A to RightNode B could indicate membership relation. From A's perspective, this is an out-going edge to B, which means A includes B as a member; and similarly from B's perspective, this is an in-coming edge from A, meaning B is included as a member in A. * Another edge E' that goes from B to A, for example, could carry completely different meaning, e.g. followship. From B's perspective, E' is an out-going edge to A, and means that B follows A, and vice versa from A's perspective. E' is an incoming edge, meaning A is followed by B. If a BipartiteGraph is of direction BipartiteLeftToRight or BipartiteRightToLeft, it carries one semantic meaning between the left and right sides; but if the graph is of direction BipartiteBoth, then it could carry two semantic meanings in one graph (e.g. list-to-user membership and user-to-list followship).

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

Instance Constructors

  1. new BipartiteGraph(leftSide: BipartiteSide, rightSide: BipartiteSide, bipartiteGraphDir: BipartiteGraphDir)

  2. new BipartiteGraph(leftNodes: Array[BipartiteNode], leftNodeCount: Int, leftOutEdgeCount: Long, rightNodes: Array[BipartiteNode], rightNodeCount: Int, rightOutEdgeCount: Long, bipartiteGraphDir: BipartiteGraphDir)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. val bipartiteGraphDir: BipartiteGraphDir

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  11. def existsNodeId(id: Int): Boolean

    Definition Classes
    Graph
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def getBipartiteNodeById(id: Int): Option[BipartiteNode]

    Get the Bipartite node in the graph by a given internal (unique) id

  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def getNodeById(id: Int): Option[Node]

    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.

    Definition Classes
    BipartiteGraphGraph
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. def isDirStored(node: BipartiteNode, dir: GraphDir): Boolean

    Checks for a given node, is a graph direction is stored.

    Checks for a given node, is a graph direction is stored. e.g., if the node being queries is a left node, and the asked for direction is OutDir, then if the graph's stored direction is LeftToRight or Both, then this function returns true, false otherwise.

  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. val leftNodeCount: Int

  20. val leftNodes: Array[BipartiteNode]

  21. val leftOutEdgeCount: Long

  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

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

    Definition Classes
    AnyRef
  25. val rightNodeCount: Int

  26. val rightNodes: Array[BipartiteNode]

  27. val rightOutEdgeCount: Long

  28. val storedGraphDir: StoredGraphDir.Value

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

    Definition Classes
    AnyRef
  30. def toString(): String

    Definition Classes
    AnyRef → Any
  31. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Graph

Inherited from AnyRef

Inherited from Any

Ungrouped