com.twitter.cassovary.graph

DirectedGraphUtils

class DirectedGraphUtils extends GraphUtils

This class contains some common utilities and convenience functions for directed graphs. It differs from GraphUtils because it works on a directed graph (which provides some other things, such as an iterator on top of the underlying Graph)

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

Instance Constructors

  1. new DirectedGraphUtils(directedGraph: DirectedGraph)

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. def allPathsWalk(dir: GraphDir, startNodeId: Int, numTopPathsPerNode: Int, walkLimits: Limits): (VisitsCounter, PrevNbrCounter)

    This is a breadth-first all paths walk with possible multiple visits to a node along the direction specified by dir.

    This is a breadth-first all paths walk with possible multiple visits to a node along the direction specified by dir.

    All paths walk is a queue based walk, where each node adds all her neighbors to the queue and each node can be visited multiple times.

    numTopPathsPerNode

    number of paths per node to keep track of

    walkLimits

    walk limits

    returns

    a pair of elements

    1. Counter tracking a visited node's id V and the number of visits to that node. 2. Counter tracking a visited node's id V and a set of neighbors. The neighbors are sorted in decreasing order by occurrence.
    Definition Classes
    GraphUtils
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def bfsWalk(startNodeId: Int, dir: GraphDir, walkLimits: Limits): Seq[(Int, Int)]

    This is a breadth-first walk along the direction specified by dir.

    This is a breadth-first walk along the direction specified by dir.

    startNodeId

    node to start the random walk from. These must exist in the graph.

    walkLimits

    walk limits

    returns

    a sequence of visited nodes and depths of the visit (or empty sequence if startNodeId was not found in the graph)

    Definition Classes
    GraphUtils
  9. def calculateAllPathsWalk(startNodeId: Int, dir: GraphDir, numTopPathsPerNode: Int, walkLimits: Limits): (Map[Int, Int], Map[Int, Int2IntMap])

    Does a breadth-first-walk starting from startNodeId using the walk parameters specified in walkParams.

    Does a breadth-first-walk starting from startNodeId using the walk parameters specified in walkParams. Returns a 2-tuple: 1. List of (node's id, the number of visits made to the node) sorted in decreasing order of the number of visits, and 2. A mapping for a visited node with id V to the top paths leading to V in the form of (P as a DirectedPath, frequency of walking P).

    Definition Classes
    GraphUtils
  10. def calculatePersonalizedReputation(startNodeId: Int, walkParams: RandomWalkParams): (Map[Int, Int], Option[Map[Int, Object2IntMap[DirectedPath]]])

    Definition Classes
    GraphUtils
  11. def calculatePersonalizedReputation(startNodeIds: Seq[Int], walkParams: RandomWalkParams): (Map[Int, Int], Option[Map[Int, Object2IntMap[DirectedPath]]])

    Calculates the reputation of graph nodes personalized to a given node based on a random walk.

    Calculates the reputation of graph nodes personalized to a given node based on a random walk.

    startNodeIds

    the ids of the node to get personalized reputations for

    walkParams

    the RandomWalkParams random walk parameters

    returns

    a 2-tuple:

    1. List of (node's id, the number of visits made to the node) sorted in decreasing order of the number of visits, and 2. A mapping, for a visited node with id V to the top paths leading to V in the form of (P as a DirectedPath, frequency of walking P).
    Definition Classes
    GraphUtils
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. val directedGraph: DirectedGraph

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

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

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

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

    Definition Classes
    AnyRef → Any
  18. def getNumMutualEdges: Long

    * Returns the number of mutual edges in the graph (i.

    * Returns the number of mutual edges in the graph (i.e., edges of type a->b and b->a both exist) Warning: creates a copy of all edges, so it is memory inefficient. Better would be to spill edges to disk intelligently and do an external sort.

    returns

    number of mutual edges

  19. def getNumMutualEdgesBothDirs(node: Node): Long

    Assuming that the node stores both directions of edges, calculate the number of mutual edges incident on this node

    Assuming that the node stores both directions of edges, calculate the number of mutual edges incident on this node

    returns

    number of neighbors of node that have an edge to and from this node

    Definition Classes
    GraphUtils
  20. val graph: Graph

    Definition Classes
    GraphUtils
  21. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  22. final def isInstanceOf[T0]: Boolean

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

    Definition Classes
    AnyRef
  24. def neighborCount(id: Int, dir: GraphDir): Int

    id

    the id of the node to count neighbors of

    dir

    the direction of interest

    returns

    number of neighbors (i.e., number of nodes 1 hop away) in dir. Warning: Lossy: Returns 0 if id is not found.

    Definition Classes
    GraphUtils
  25. final def notify(): Unit

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

    Definition Classes
    AnyRef
  27. def randomWalk(dir: GraphDir, startNodeIds: Seq[Int], walkParams: RandomWalkParams)(): (VisitsCounter, Option[PathsCounter])

    Do a random walk starting from the set of nodes with ids startNodeIds.

    Do a random walk starting from the set of nodes with ids startNodeIds. The walk maintains a count of the number of times that nodes have been visited during the walk.

    startNodeIds

    nodes to start the random walk from

    walkParams

    the RandomWalkParams random walk parameters

    returns

    a tuple of two elements. The first is a counter tracking a visited node's id to the number of visits to that node. The second is a counter tracking a visited node's id to the paths visited while hitting that node. The paths are sorted in decreasing order by occurrence Each path is kept as a DirectedPath.

    Definition Classes
    GraphUtils
  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from GraphUtils

Inherited from AnyRef

Inherited from Any

Ungrouped