Packages

class Graph[N] extends AnyRef

Represents an immutable directed graph where nodes are elements of N: (source node) -> (id of source node, set of neighbors)

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Graph
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Graph(nodeIdNeighbors: Map[N, (Int, Set[N])])(implicit arg0: ClassTag[N])

Value Members

  1. def addEdges(edges: Map[N, Set[N]]): Graph[N]

    Returns a graph with edges added.

    Returns a graph with edges added. All not existing nodes are also added.

  2. def addEdges(nodeSrc: N, nodesDest: Set[N]): Graph[N]

    Returns a graph with a set of edges added from the same node.

    Returns a graph with a set of edges added from the same node. All not existing nodes are also added.

  3. def addNode(node: N): Graph[N]

    Returns a graph with node added.

  4. def info: GraphInfo

    Calculates and returns information about the graph.

  5. def neighbors(node: N): Set[N]

    Returns the set of all neighbors of existing node.

  6. def neighborsId(node: N): Set[Int]

    Returns a set of all neighbors id of existing node.

  7. def nodeById(id: Int): Option[N]

    Returns the node corresponding to id.

  8. def nodeId(node: N): Int

    Returns the id of existing node.

  9. val nodeIdNeighbors: Map[N, (Int, Set[N])]
  10. def nodesArray: Array[N]

    Returns an array of all nodes.

    Returns an array of all nodes. The index of each corresponding to their ids.

  11. def size: Int

    Returns the number of nodes.