Class

quiver

Graph

Related Doc: package quiver

Permalink

case class Graph[N, A, B](rep: GraphRep[N, A, B]) extends Product with Serializable

An implementation of an inductive graph where nodes of type N are labeled with A, and edges are labeled with B.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Graph
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Graph(rep: GraphRep[N, A, B])

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def &(ctx: Context[N, A, B]): Graph[N, A, B]

    Permalink

    Merge the given context into the graph.

    Merge the given context into the graph. The context consists of a vertex, its label, its successors, and its predecessors.

  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. def addEdge(e: LEdge[N, B]): Graph[N, A, B]

    Permalink

    Add an edge to this graph.

    Add an edge to this graph. Throws an error if the source and target nodes don't exist in the graph.

  6. def addEdges(es: Seq[LEdge[N, B]]): Graph[N, A, B]

    Permalink

    Add multiple edges to this graph

  7. def addNode(n: LNode[N, A]): Graph[N, A, B]

    Permalink

    Add a node to this graph.

    Add a node to this graph. If this node already exists with a different label, its label will be replaced with this new one.

  8. def addNodes(vs: Seq[LNode[N, A]]): Graph[N, A, B]

    Permalink

    Add multiple nodes to this graph

  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def bf(q: Queue[Path[N]]): RTree[N]

    Permalink

    Utility function for breadth-first search tree.

  11. def bfe(v: N): Seq[Edge[N]]

    Permalink

    Breadth-first search remembering predecessor information.

    Breadth-first search remembering predecessor information. Gives transient edges in breadth-first order, starting from the given node.

  12. def bfen(es: Seq[Edge[N]]): Seq[Edge[N]]

    Permalink

    Breadth-first search remembering predecessor information.

    Breadth-first search remembering predecessor information. Gives transient edges starting from the targets of the given edges, in breadth-first order.

  13. def bfenInternal(q: Queue[Edge[N]]): Vector[Edge[N]]

    Permalink

    Breadth-first edges

  14. def bfs(v: N): Seq[N]

    Permalink

    Breadth-first search from the given node.

    Breadth-first search from the given node. The result is ordered by distance from the node v.

  15. def bfsWith[C](f: (Context[N, A, B]) ⇒ C, v: N): Seq[C]

    Permalink

    Breadth-first search from the given node.

    Breadth-first search from the given node. The result is a vector of results of passing the context of each visited to the function f.

  16. def bfsn(vs: Seq[N]): Seq[N]

    Permalink

    Breadth-first search from the given nodes.

    Breadth-first search from the given nodes. The result is the successors of vs, with immediate successors first.

  17. def bfsnInternal[C](f: (Context[N, A, B]) ⇒ C, q: Queue[N]): Vector[C]

    Permalink

    Breadth-first search (nodes ordered by distance)

  18. def bfsnWith[C](f: (Context[N, A, B]) ⇒ C, vs: Seq[N]): Seq[C]

    Permalink

    Breadth-first search from the given nodes.

    Breadth-first search from the given nodes. The result is a vector of results of passing the context of each visited node to the function f.

  19. def bft(v: N): RTree[N]

    Permalink

    Breadth-first search tree.

    Breadth-first search tree. The result is a list of paths through the graph from the given vertex, in breadth-first order.

  20. def bidecomp(first: N, last: N): Option[BiDecomp[N, A, B]]

    Permalink
  21. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. def contains(v: N): Boolean

    Permalink

    Returns true if the given node is in the graph, otherwise false

  23. def context(v: N): Context[N, A, B]

    Permalink

    Find the context for the given node.

    Find the context for the given node. Causes an error if the node is not present in the graph.

  24. def countNodes: Int

    Permalink

    The number of nodes in this graph

  25. def decomp(n: N): Decomp[N, A, B]

    Permalink

    Returns a context focused on the given node, if present, and the graph with that node removed.

  26. def decompAny: GDecomp[N, A, B]

    Permalink

    Decompose this graph into the context for an arbitrarily chosen node and the rest of the graph.

  27. def degree(v: N): Int

    Permalink

    The number of connections to and from the given node

  28. def dff(vs: Seq[N]): Vector[Tree[N]]

    Permalink

    Depth-first forest.

    Depth-first forest. Follows successors of the given nodes. The result is a vector of trees of nodes where each path in each tree is a path through the graph.

  29. def dffWith[C](vs: Seq[N], f: (Context[N, A, B]) ⇒ C): Vector[Tree[C]]

    Permalink

    Depth-first forest.

    Depth-first forest. Follows successors of the given nodes. The result is a vector of trees of results of passing the context of each node to the function f.

  30. def dfs(vs: Seq[N]): Seq[N]

    Permalink

    Forward depth-first search.

  31. def dfsWith[C](vs: Seq[N], f: (Context[N, A, B]) ⇒ C): Seq[C]

    Permalink

    Forward depth-first search.

  32. def edges: Vector[Edge[N]]

    Permalink

    A list of all the edges in the graph

  33. def emap[C](f: (B) ⇒ C): Graph[N, A, C]

    Permalink

    Map a function over the edge labels in the graph

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

    Permalink
    Definition Classes
    AnyRef
  35. def esp(s: N, t: N): Option[Path[N]]

    Permalink

    The shortest path from vertex s to vertex t

  36. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  37. def findEdge(e: Edge[N]): Option[LEdge[N, B]]

    Permalink

    Find an edge between two nodes

  38. def fold[C](u: C)(f: (Context[N, A, B], C) ⇒ C): C

    Permalink

    Fold a function over the graph

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

    Permalink
    Definition Classes
    AnyRef → Any
  40. def gmap[C, D](f: (Context[N, A, B]) ⇒ Context[N, C, D]): Graph[N, C, D]

    Permalink

    Map a function over the graph

  41. def inDegree(v: N): Int

    Permalink

    The number of inbound edges from the given node

  42. def inEdges(v: N): Vector[LEdge[N, B]]

    Permalink

    Find all inbound edges for the given node

  43. def ins(v: N): Adj[N, B]

    Permalink

    All the inbound links of the given node, including self-edges

  44. def isEmpty: Boolean

    Permalink
  45. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  46. def labEdges: Vector[LEdge[N, B]]

    Permalink

    A list of all the edges in the graph and their labels

  47. def labNodes: Vector[LNode[N, A]]

    Permalink

    A list of all the nodes in the graph and their labels

  48. def label(v: N): Option[A]

    Permalink

    Find the label for a node

  49. def lbf(q: Queue[LPath[N, B]]): LRTree[N, B]

    Permalink

    Utility function for labeled breadth-first search tree

  50. def lbft(v: N): LRTree[N, B]

    Permalink

    Breadth-first search tree with labeled paths

  51. def lesp(s: N, t: N): Option[LPath[N, B]]

    Permalink

    Shortest path from vertex s to vertex t, with labels

  52. def level(v: N): Seq[(N, Int)]

    Permalink

    Breadth-first search giving the distance of each node from the node v.

  53. def leveln(vs: Seq[(N, Int)]): Seq[(N, Int)]

    Permalink

    Breadth-first search giving the distance of each node from the search nodes.

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

    Permalink
    Definition Classes
    AnyRef
  55. def neighbors(v: N): Vector[N]

    Permalink

    Find the neighbors of a node

  56. def nmap[C](f: (A) ⇒ C): Graph[N, C, B]

    Permalink

    Map a function over the node labels in the grap

  57. def nodes: Vector[N]

    Permalink

    A list of all the nodes in the graph

  58. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  59. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  60. def outDegree(v: N): Int

    Permalink

    The number of outbound edges from the given node

  61. def outEdges(v: N): Vector[LEdge[N, B]]

    Permalink

    Find all outbound edges for the given node

  62. def outs(v: N): Adj[N, B]

    Permalink

    All the outbound links of the given node, including self-edges

  63. def predecessors(v: N): Vector[N]

    Permalink

    Find all nodes that have a link to the given node

  64. def rdfs(vs: Seq[N]): Seq[N]

    Permalink

    Reverse depth-first search.

    Reverse depth-first search. Follows predecessors.

  65. def reachable(v: N): Vector[N]

    Permalink

    Finds all the reachable nodes from a given node, using DFS

  66. def removeEdge(e: Edge[N]): Graph[N, A, B]

    Permalink

    Remove an edge from this graph

  67. def removeEdges(es: Seq[Edge[N]]): Graph[N, A, B]

    Permalink

    Remove multiple edges from this graph

  68. def removeLEdge(e: LEdge[N, B]): Graph[N, A, B]

    Permalink

    Remove an edge from this graph only if the label matches

  69. def removeNode(v: N): Graph[N, A, B]

    Permalink

    Remove a node from this graph

  70. def removeNodes(vs: Seq[N]): Graph[N, A, B]

    Permalink

    Remove multiple nodes from this graph

  71. val rep: GraphRep[N, A, B]

    Permalink
  72. def reverse: Graph[N, A, B]

    Permalink

    Reverse the direction of all edges

  73. def safeAddEdge(e: LEdge[N, B], failover: ⇒ Graph[N, A, B] = this): Graph[N, A, B]

    Permalink

    Add an edge to this graph.

    Add an edge to this graph. If the source and target nodes don't exist in this graph, return the given failover graph.

  74. def safeAddEdges(es: Seq[LEdge[N, B]]): Graph[N, A, B]

    Permalink

    Add multiple edges to this graph, ignoring edges whose source and target nodes don't already exist in the graph.

  75. def successors(v: N): Vector[N]

    Permalink

    Find all nodes that have a link from the given node

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

    Permalink
    Definition Classes
    AnyRef
  77. def tclose: Graph[N, A, Unit]

    Permalink

    Finds the transitive closure of this graph.

  78. def toString(): String

    Permalink
    Definition Classes
    Graph → AnyRef → Any
  79. def udfs(vs: Seq[N]): Seq[N]

    Permalink

    Undirected depth-first search

  80. def union(g: Graph[N, A, B]): Graph[N, A, B]

    Permalink

    Adds all the nodes and edges from one graph to another.

  81. def updateEdge(e: LEdge[N, B]): Graph[N, A, B]

    Permalink

    Replace an edge with a new one

  82. def updateEdges(es: Seq[LEdge[N, B]]): Graph[N, A, B]

    Permalink

    Update multiple edges

  83. def updateNode(n: LNode[N, A]): Graph[N, A, B]

    Permalink

    Replace a node with a new one

  84. def updateNodes(ns: Seq[LNode[N, A]]): Graph[N, A, B]

    Permalink

    Update multiple nodes

  85. def vmap[M](f: (N) ⇒ M): Graph[M, A, B]

    Permalink

    Map over the unique node identifiers in the graph

  86. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  89. def xdfWith[C](vs: Seq[N], d: (Context[N, A, B]) ⇒ Seq[N], f: (Context[N, A, B]) ⇒ C): (Vector[Tree[C]], Graph[N, A, B])

    Permalink

    Generalized depth-first forest.

    Generalized depth-first forest. Uses the function d to decide which nodes to visit next

  90. def xdffWith[C](vs: Seq[N], d: (Context[N, A, B]) ⇒ Seq[N], f: (Context[N, A, B]) ⇒ C): Vector[Tree[C]]

    Permalink

    Generalized depth-first forest.

    Generalized depth-first forest. Uses the function d to decide which nodes to visit next.

  91. final def xdfsWith[C](vs: Seq[N], d: (Context[N, A, B]) ⇒ Seq[N], f: (Context[N, A, B]) ⇒ C): Vector[C]

    Permalink

    Generalized depth-first search.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped