Package

com.twitter.cassovary

graph

Permalink

package graph

Visibility
  1. Public
  2. All

Type Members

  1. class AllPathsWalk[+V <: Node] extends DepthTracker with BoundedIterator[V]

    Permalink

    Traverses in FIFO (breadth first) order but without any limit on the number of times every node can be visited.

    Traverses in FIFO (breadth first) order but without any limit on the number of times every node can be visited. Every time the walk visits a node, it adds all its neighbors (along direction dir) to the queue.

  2. class ArrayBasedDirectedGraph extends DirectedGraph[Node]

    Permalink

    This class is an implementation of the directed graph trait that is backed by an array The private constructor takes as its input a list of (@see Node) nodes, then stores nodes in an array.

    This class is an implementation of the directed graph trait that is backed by an array The private constructor takes as its input a list of (@see Node) nodes, then stores nodes in an array. It also builds all edges which are also stored in array.

  3. class ArrayBasedDynamicDirectedGraph extends DynamicDirectedGraph[DynamicNode]

    Permalink

    A dynamic directed graph, implemented using an ArrayBuffer of IntArrayList (from the fastutil library).

    A dynamic directed graph, implemented using an ArrayBuffer of IntArrayList (from the fastutil library). If n nodes are used, O(n) objects are created, independent of the number of edges.

    For efficiency, it's recommended that ids be sequentially numbered, as an internal array is stored which is longer than the maximum id seen.

    This class is not threadsafe. If multiple thread access it simultaneously and at least one mutates it, synchronization should be used. Currently no new threads are created by this class (all operations execute on a single thread).

  4. trait BoundedIterator[+T] extends Iterator[T]

    Permalink

    Bounds an iterator to go no more than a specified maximum number of steps

  5. class BreadthFirstTraverser[+V <: Node] extends DepthTracker with BoundedIterator[V]

    Permalink

    Traverses in BFS order.

    Traverses in BFS order. This implies that first all the neighbors of homeNodeIds are visited, then their neighbors, etc.

  6. class ConcurrentHashMapDynamicGraph extends DynamicDirectedGraphHashMap

    Permalink

    An efficient dynamic graph implementation which supports concurrent reading and writing.

    An efficient dynamic graph implementation which supports concurrent reading and writing. Reads happen without locks or data copying. Nodes are stored in a ConcurrentHashMap, and neighbors of each node are stored in Array[Int]s. Currently, only edge and node addition (not deletion) is supported.

  7. class DepthFirstTraverser[+V <: Node] extends DepthTracker with BoundedIterator[V]

    Permalink

    Traverses in DFS order (every node can be visited only once).

  8. trait DepthTracker extends QueueBasedTraverser[Node]

    Permalink

    A traverser that keeps track of first depth of visiting a given node.

  9. trait DirectedGraph[+V <: Node] extends Graph[V] with Iterable[V]

    Permalink

    The entry point into a model of a directed graph.

    The entry point into a model of a directed graph. Users typically query a known starting node and then traverse the graph using methods on that Node.

  10. class DirectedGraphUtils[+V <: Node] extends GraphUtils[V]

    Permalink

    This class contains some common utilities and convenience functions for directed graphs.

    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)

  11. case class DirectedPath(nodes: Array[Int]) extends Product with Serializable

    Permalink

    Represents a directed path of nodes in a graph.

    Represents a directed path of nodes in a graph. No loop detection is done.

  12. class DirectedPathCollection extends AnyRef

    Permalink

    Represents a collection of directed paths.

    Represents a collection of directed paths. For example, a collection of paths out of the same source node.

  13. trait DiscoveryAndFinishTimeTracker extends DepthFirstTraverser[Node]

    Permalink

    Trait to be mixed in to the BFS/DFS traverser to add discovery and finishing times of a node.

    Trait to be mixed in to the BFS/DFS traverser to add discovery and finishing times of a node.

    Discovery time of a node is time when the node is added to the queue for the first time.

    Finishing time of a node is time just after all dir neighbors of the node became finished (or when it is visited if it has no dir neighbors that should be processed later).

  14. trait DynamicDirectedGraph[+V <: DynamicNode] extends DirectedGraph[V]

    Permalink

    A class support dynamically adds new nodes and dynamically add/delete edges in existing nodes.

    A class support dynamically adds new nodes and dynamically add/delete edges in existing nodes. It currently doesn't support delete nodes

  15. abstract class DynamicDirectedGraphHashMap extends DynamicDirectedGraph[DynamicNode]

    Permalink

    A class supporting dynamic addition of new nodes and addition/deletion of edges in existing nodes.

    A class supporting dynamic addition of new nodes and addition/deletion of edges in existing nodes. It currently doesn't support deletion of nodes.

  16. trait Graph[+V <: Node] extends AnyRef

    Permalink

    The entry point into a model of a graph.

    The entry point into a model of a graph. Users typically query a known starting node and then traverse the graph using methods on that Node.

  17. class GraphUtils[+V <: Node] extends AnyRef

    Permalink

    This class contains some common graph utilities and convenience functions.

  18. class MemoryMappedDirectedGraph extends DirectedGraph[Node]

    Permalink

    A graph which reads edge data from a memory mapped file.

    A graph which reads edge data from a memory mapped file. There is no object overhead per node: the memory used for n nodes and m edges with both in-neighbor and out-neighbor access is exactly 16 + 16*n + 8*m bytes. Also, loading is very fast because no parsing of text is required. Loading time is exactly the time it takes the operating system to map data from disk into memory. Nodes are numbered sequentially from 0 to nodeCount - 1 and must be a range of this form (i.e. nodeCount == maxNodeId + 1).

    When transforming a graph where nodeCount <= maxNodeId to this format, new nodes with no neighbors will be implicitly created. Currently only supports storing both in-neighbors and out-neighbors of nodes (StoredGraphDir.BothInOut). The binary format is currently subject to change. Node objects are created on demand when getNodeById is called.

  19. class NeighborsInArrayNode extends Node

    Permalink

    Constructor for a default node with neighbors stored as Arrays.

  20. class NeighborsInCSeqNode extends Node

    Permalink

    Constructor for a default node with neighbors stored as CSeqs.

  21. trait Node extends AnyRef

    Permalink

    Represents a node in a directed graph.

  22. case class NodeIdEdgesMaxId(id: Int, edges: Array[Int], maxId: Int) extends Product with Serializable

    Permalink

    This case class holds a node's id, all its out edges, and the max id of itself and ids of nodes in its out edges

  23. class PathCounterComparator extends Order[DirectedPath]

    Permalink
  24. trait PathLengthTracker extends DepthFirstTraverser[Node]

    Permalink

    A trait to be mixed in to the DepthFirstTraverser that keeps track of visiting distance from homeNodeIds.

    A trait to be mixed in to the DepthFirstTraverser that keeps track of visiting distance from homeNodeIds.

    Note that DepthTracker for the DFS case returns the depth of first seeing a particular node. It does not have to be the same as the depth at which the node is visited.

  25. trait QueueBasedTraverser[+V <: Node] extends Traverser[V]

    Permalink

    General schema for some Traversers (like BFS, DFS).

    General schema for some Traversers (like BFS, DFS). QueueBasedTraverser keeps nodes to visit next in a queue. It iteratively visits nodes from the front of the queue in order based on the type of traversal and optionally adds new nodes to the queue.

  26. class RandomBoundedTraverser[+V <: Node] extends RandomTraverser[V] with BoundedIterator[V]

    Permalink

    Same as RandomTraverser except that the number of steps taken is bounded by maxSteps

  27. class RandomTraverser[+V <: Node] extends Traverser[V]

    Permalink

    Randomly traverse the graph, going from one node to a random neighbor in direction dir.

  28. class SharedArrayBasedDirectedGraph extends DirectedGraph[Node]

    Permalink

    This class is an implementation of the directed graph trait that is backed by a sharded 2-dimensional edges array.

    This class is an implementation of the directed graph trait that is backed by a sharded 2-dimensional edges array. Each node's edges are stored consecutively in one shard of the edge array. Number of shard is usually much smaller than number of nodes.

  29. case class SharedGraphMetaInfo(maxId: Int, numEdges: Long, numNodes: Int) extends Product with Serializable

    Permalink

    Contains meta-information about a particular graph instance.

    Contains meta-information about a particular graph instance.

    maxId

    the max node id in the graph

    numEdges

    the number of edges in the graph

  30. trait SortedNeighborsNodeOps extends AnyRef

    Permalink

    This trait designed to be mixed in to Node when neighbors of node are sorted Arrays.

  31. class SynchronizedDynamicGraph extends DynamicDirectedGraphHashMap

    Permalink

    A class support dynamically adds new nodes and dynamically add/delete edges in existing nodes.

    A class support dynamically adds new nodes and dynamically add/delete edges in existing nodes. It currently doesn't support delete nodes

  32. case class TestGraph(nodes: Node*) extends DirectedGraph[Node] with Product with Serializable

    Permalink

    A simple implementation of a DirectedGraph

  33. case class TestNode(id: Int, inboundNodesList: List[Int], outboundNodesList: List[Int]) extends Node with Product with Serializable

    Permalink
  34. trait Traverser[+V <: Node] extends Iterator[V]

    Permalink

    A Traverser traverses the graph in a certain order of nodes.

Value Members

  1. object ArrayBasedDirectedGraph

    Permalink
  2. object ConcurrentIntArrayList

    Permalink
  3. object DirectedPath extends Serializable

    Permalink
  4. object GraphDir extends Enumeration

    Permalink

    A representation of the two directions edges point in a directed graph.

  5. object GraphUtils

    Permalink
  6. object MemoryMappedDirectedGraph

    Permalink
  7. object NeighborsSortingStrategy extends Enumeration

    Permalink

    ArrayBasedDirectedGraph can be stored with neighbors sorted or not.

    ArrayBasedDirectedGraph can be stored with neighbors sorted or not. Therefore there are 3 strategies of loading a graph from input: AlreadySorted - creates a graph with sorted neighbors from sorted input SortWhileReading - creates a graph with sorted neighbors sorting them while reading LeaveUnsorted - creates graph with unsorted neighbors (default)

  8. object Node

    Permalink
  9. object NodeIdEdgesMaxId extends Serializable

    Permalink
  10. object NodeUtils

    Permalink

    This class contains common graph node based utilities and convenience functions.

    This class contains common graph node based utilities and convenience functions. In general, only utilities that are local to a node are kept here. Utility methods that touch many nodes are found in GraphUtils.

  11. object SharedArrayBasedDirectedGraph

    Permalink
  12. object StoredGraphDir extends Enumeration

    Permalink
  13. object TestGraphs

    Permalink

    Some sample graphs for quick testing in tests.

  14. object Walk

    Permalink
  15. package bipartite

    Permalink
  16. package distributed

    Permalink
  17. package labels

    Permalink
  18. package node

    Permalink
  19. package tourist

    Permalink

Ungrouped