Class/Object

firrtl.graph

DiGraph

Related Docs: object DiGraph | package graph

Permalink

class DiGraph[T] extends DiGraphLike[T]

A class to represent an immutable directed graph with nodes of type T

Linear Supertypes
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DiGraph
  2. DiGraphLike
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DiGraph(edges: Map[T, Set[T]])

    Permalink

    Create a new graph with the provided edge data

    Create a new graph with the provided edge data

    edges

    a Map[T,Set[T]] of edge data For the edge data Map, the value associated with each vertex u in the graph is a Set[T] of nodes where for each node v in the set, the directed edge (u,v) exists in the graph.

Type Members

  1. class CyclicException extends Exception

    Permalink

    An exception that is raised when an assumed DAG has a cycle

  2. class PathNotFoundException extends Exception

    Permalink

    An exception that is raised when attempting to find an unreachable node

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def BFS(root: T): Map[T, T]

    Permalink

    Performs breadth-first search on the directed graph

    Performs breadth-first search on the directed graph

    root

    the start node

    returns

    a Map[T,T] from each visited node to its predecessor in the traversal

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

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

    Permalink

    Check whether the graph contains vertex v

    Check whether the graph contains vertex v

    Definition Classes
    DiGraphDiGraphLike
  8. val edges: Map[T, Set[T]]

    Permalink

    a Map[T,Set[T]] of edge data For the edge data Map, the value associated with each vertex u in the graph is a Set[T] of nodes where for each node v in the set, the directed edge (u,v) exists in the graph.

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def findSCCs: Seq[Seq[T]]

    Permalink

    Finds the strongly connected components in the graph

    Finds the strongly connected components in the graph

    returns

    a Seq of Seq[T], each containing nodes of an SCC in traversable order

  13. def findSinks: Set[T]

    Permalink

    Find all sinks in the graph

    Find all sinks in the graph

    returns

    a Set[T] of sink nodes

  14. def findSources: Set[T]

    Permalink

    Find all sources in the graph

    Find all sources in the graph

    returns

    a Set[T] of source nodes

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. def getEdges(v: T): Set[T]

    Permalink

    Get all edges of a node

    Get all edges of a node

    v

    the specified node

    returns

    a Set[T] of all vertices that v has edges to

    Definition Classes
    DiGraphDiGraphLike
  17. def getVertices: Set[T]

    Permalink

    Get all vertices in the graph

    Get all vertices in the graph

    returns

    a Set[T] of all vertices in the graph

    Definition Classes
    DiGraphDiGraphLike
  18. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  20. def linearize: Seq[T]

    Permalink

    Linearizes (topologically sorts) a DAG

    Linearizes (topologically sorts) a DAG

    returns

    a Map[T,T] from each visited node to its predecessor in the traversal

    Exceptions thrown

    CyclicException if the graph is cyclic

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

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  24. def path(start: T, end: T): Seq[T]

    Permalink

    Finds a path (if one exists) from one node to another

    Finds a path (if one exists) from one node to another

    start

    the start node

    end

    the destination node

    returns

    a Seq[T] of nodes defining an arbitrary valid path

    Exceptions thrown
  25. def pathsInDAG(start: T): Map[T, Seq[Seq[T]]]

    Permalink

    Finds all paths starting at a particular node in a DAG

    Finds all paths starting at a particular node in a DAG

    WARNING: This is an exponential time algorithm (as any algorithm must be for this problem), but is useful for flattening circuit graph hierarchies. Each path is represented by a Seq[T] of nodes in a traversable order.

    start

    the node to start at

    returns

    a Map[T,Seq[Seq[T]]] where the value associated with v is the Seq of all paths from start to v

  26. def reachableFrom(root: T): Set[T]

    Permalink

    Finds the set of nodes reachable from a particular node

    Finds the set of nodes reachable from a particular node

    root

    the start node

    returns

    a Set[T] of nodes reachable from the root

  27. def reverse: DiGraph[T]

    Permalink

    Returns a graph with all edges reversed

  28. def simplify(vprime: Set[T]): DiGraph[T]

    Permalink

    Return a graph with only a subset of the nodes

    Return a graph with only a subset of the nodes

    Any path between two non-deleted nodes (u,v) that traverses only deleted nodes will be transformed into an edge (u,v).

    vprime

    the Set[T] of desired vertices

    returns

    the simplified graph

    Exceptions thrown

    IllegalArgumentException if vprime is not a subset of V

  29. def subgraph(vprime: Set[T]): DiGraph[T]

    Permalink

    Return a graph with only a subset of the nodes

    Return a graph with only a subset of the nodes

    Any edge including a deleted node will be deleted

    vprime

    the Set[T] of desired vertices

    returns

    the subgraph

    Exceptions thrown

    IllegalArgumentException if vprime is not a subset of V

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

    Permalink
    Definition Classes
    AnyRef
  31. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  32. def transformNodes[Q](f: (T) ⇒ Q): DiGraph[Q]

    Permalink

    Return a graph with all the nodes of the current graph transformed by a function.

    Return a graph with all the nodes of the current graph transformed by a function. Edge connectivity will be the same as the current graph.

    f

    A function {(T) => Q} that transforms each node

    returns

    a transformed DiGraph[Q]

  33. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DiGraphLike[T]

Inherited from AnyRef

Inherited from Any

Ungrouped