Packages

class MGraph[TLabel] extends Graph[TLabel] with Cloneable

The MGraph class stores vertex/edge-labeled multi-directed graphs using an adjacency set 'ch' representation, e.g., 'ch = { {1, 2}, {0}, {1} }' means that the graph has the following edges { (0, 1), (0, 2), (1, 0), (2, 1) }. Optionally, inverse adjacency via the 'pa' array can be stored at the cost of nearly doubling the storage requirements. ----------------------------------------------------------------------------

Linear Supertypes
Graph[TLabel], Cloneable, Cloneable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MGraph
  2. Graph
  3. Cloneable
  4. Cloneable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MGraph(ch: Array[Set[Int]], label: Array[TLabel] = Array.ofDim (0), elabel: Map[Pair, TLabel] = Map (), inverse: Boolean = false, name: String = "g")(implicit arg0: ClassTag[TLabel])

    ch

    the array of child (adjacency) vertex sets (outgoing edges)

    label

    the array of vertex labels

    elabel

    the map of edge labels

    inverse

    whether to store inverse adjacency sets (parents)

    name

    the name of the multi-digraph

Value Members

  1. def addPar(): Unit

    Add the inverse adjacency sets for rapid accesses to parent vertices.

    Add the inverse adjacency sets for rapid accesses to parent vertices.

    Definition Classes
    Graph
  2. def buildLabelMap(label: Array[TLabel]): Map[TLabel, Set[Int]]

    Given an array of labels, return an index from labels to the sets of vertices containing those labels.

    Given an array of labels, return an index from labels to the sets of vertices containing those labels.

    label

    the array of vertex labels of type TLabel

    Definition Classes
    Graph
  3. val ch: Array[Set[Int]]
    Definition Classes
    Graph
  4. def checkEdges: Boolean

    Check whether the end-point vertex id of each edge is within bounds: '0 ..

    Check whether the end-point vertex id of each edge is within bounds: '0 .. maxId'.

    Definition Classes
    Graph
  5. def checkElabels: Boolean

    Check whether the edges in the 'elabel' map correspond to edges in the the adjacency list.

  6. def clone(): MGraph[TLabel]

    Clone (make a deep copy) of 'this' multi-digraph.

    Clone (make a deep copy) of 'this' multi-digraph.

    Definition Classes
    MGraphGraph → AnyRef
  7. val elabel: Map[Pair, TLabel]
  8. def getVerticesWithLabel(l: TLabel): Equals

    Return the set of vertices in 'this' digraph with label 'l'.

    Return the set of vertices in 'this' digraph with label 'l'.

    l

    the label to match

    Definition Classes
    Graph
  9. var inverse: Boolean
    Definition Classes
    Graph
  10. def isConnected: Boolean

    Determine whether 'this' digraph is (weakly) connected.

    Determine whether 'this' digraph is (weakly) connected.

    Definition Classes
    Graph
  11. val label: Array[TLabel]
    Definition Classes
    Graph
  12. val labelMap: Map[TLabel, Set[Int]]

    The map from label to the set of vertices with the label

    The map from label to the set of vertices with the label

    Definition Classes
    Graph
  13. def makeUndirected(): MGraph[TLabel]

    Make this multi-directed graph work like an undirected graph by making sure that for every edge 'u -> v', there is a 'v -> u' edge and that they have same edge label.

    Make this multi-directed graph work like an undirected graph by making sure that for every edge 'u -> v', there is a 'v -> u' edge and that they have same edge label.

    Definition Classes
    MGraphGraph
  14. def nEdges: Int

    Return the number of edges in 'this' digraph.

    Return the number of edges in 'this' digraph.

    Definition Classes
    Graph
  15. def nSelfLoops: Int

    Determine the number of vertices in the digraph that have outgoing edges to themselves.

    Determine the number of vertices in the digraph that have outgoing edges to themselves.

    Definition Classes
    Graph
  16. val name: String
    Definition Classes
    Graph
  17. val pa: Array[Set[Int]]

    The optional array of vertex inverse (parent) adjacency sets (incoming edges)

    The optional array of vertex inverse (parent) adjacency sets (incoming edges)

    Definition Classes
    Graph
  18. def printG(clip: Boolean = true): Unit

    Print 'this' multi-digraph in a deep sense with all the information.

    Print 'this' multi-digraph in a deep sense with all the information.

    clip

    whether to clip out "Set(" and ")"

    Definition Classes
    MGraphGraph
  19. def same(g: Graph[TLabel]): Boolean

    Determine whether 'this' digraph and digraph 'g' have the same vertices and edges.

    Determine whether 'this' digraph and digraph 'g' have the same vertices and edges. Note, this is more strict than graph isomorphism which allows vertices to be renumbered.

    g

    the other digraph

    Definition Classes
    Graph
  20. def size: Int

    Return the number of vertices in 'this' digraph.

    Return the number of vertices in 'this' digraph.

    Definition Classes
    Graph
  21. def toGraphIm(name2: String = name): graphalytics.Graph

    Return the equivalent immutable Graph.

    Return the equivalent immutable Graph. Assumes the default TLabel of type String. For other types (e.g., Double use '_.toDouble' rather than '.toString' in the last line of this method.

    name2

    the name to give the new immutable Graph

    Definition Classes
    Graph
    See also

    scalation.graphalytics.Graph

  22. def toLine(i: Int, clip: Boolean = true): String

    Convert the 'i'th row/line of 'this' multi-digraph to a string.

    Convert the 'i'th row/line of 'this' multi-digraph to a string.

    i

    the 'i'th row/line

    clip

    whether to clip out "Set(" and ")"

    Definition Classes
    MGraphGraph
  23. def toString(): String

    Convert 'this' multi-digraph to a string in a shallow sense.

    Convert 'this' multi-digraph to a string in a shallow sense. Large arrays are not converted. Use 'print' to show all information.

    Definition Classes
    MGraphGraph → AnyRef → Any
  24. def union(g2: Graph[TLabel]): Graph[TLabel]

    Take the union 'this' digraph and 'g2'.

    Take the union 'this' digraph and 'g2'.

    g2

    the other digraph

    Definition Classes
    Graph
  25. val vid: Array[Int]
    Definition Classes
    Graph