Graph

scalation.database.graph_pm.Graph
See theGraph companion object
case class Graph(ch: Array[Set[Int]], label: Array[ValueType], elabel: Map[(Int, Int), ValueType], inverse: Boolean, name: String, schema: Array[String]) extends Cloneable

Value parameters

ch

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

elabel

the map of edge labels: (u, v) -> edge label

inverse

whether to store inverse adjacency sets (parents)

label

the array of vertex labels: v -> vertex label

name

the name of the digraph

schema

optional schema: map from label to label type

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Cloneable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

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.

Attributes

def addVertices(g: Graph, vset: Set[Int], makeMap: Boolean): (Array[ValueType], Map[Int, Int])

Create an array vertices from selected vertices from graph g, those in vset. If makeMap, record the mapping between g's vertices and the new vertices.

Create an array vertices from selected vertices from graph g, those in vset. If makeMap, record the mapping between g's vertices and the new vertices.

Value parameters

g

graph to be used for adding vertex labels

makeMap

whether to make a map from new vertex id's to old vertex id's

vset

selected vertices from graph g

Attributes

def buildIndex(): Unit

Builds index from (start vertex, edge) -> end vertex.

Builds index from (start vertex, edge) -> end vertex.

Attributes

def buildLabelMap(label: Array[ValueType]): Map[ValueType, 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.

Value parameters

label

the array of vertex labels

Attributes

def checkEdges: Boolean

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

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

Attributes

def checkElabels: Boolean

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

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

Attributes

def children(u: Int, elab: ValueType): Set[Int]

Return the children of vertex u that are connected via an edge labeled elab.

Return the children of vertex u that are connected via an edge labeled elab.

Value parameters

elab

the edge label

u

the source vertex

Attributes

override def clone: Graph

Clone (make a deep copy) of this digraph.

Clone (make a deep copy) of this digraph.

Attributes

Definition Classes
Object
override def equals(g2_: Any): Boolean

To check if two graphs are equal.

To check if two graphs are equal.

Value parameters

g2_

the graph to be compared with this graph

Attributes

Definition Classes
Equals -> Any
def indexEdges(): Unit

Build and index from edge -> (Vertex pair).

Build and index from edge -> (Vertex pair).

Attributes

def isConnected: Boolean

Determine whether this digraph is (weakly) connected.

Determine whether this digraph is (weakly) connected.

Attributes

Make this 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 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.

Attributes

def nEdges: Int

Return the number of edges in this digraph.

Return the number of edges in this digraph.

Attributes

def parents(v: Int, elab: ValueType): Set[Int]

Return the parents of vertex v that are connected via an edge labeled elab. Requires the parents pa to be added (@see Graph).

Return the parents of vertex v that are connected via an edge labeled elab. Requires the parents pa to be added (@see Graph).

Value parameters

elab

the edge label

v

the destination vertex

Attributes

def printG(clip: Boolean): Unit

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

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

Value parameters

clip

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

Attributes

def size: Int

Return the size of graph in terms of the number of vertices.

Return the size of graph in terms of the number of vertices.

Attributes

def toLine(i: Int): String

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

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

Value parameters

i

the i'th row/line

Attributes

override def toString: String

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

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

Attributes

Definition Classes
Any

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

val count: Map[(ValueType, ValueType, Int), Int]
val edgeMap: Map[ValueType, Set[(Int, Int)]]
val id: Array[Int]
val indexMap: Map[(ValueType, ValueType), Set[Int]]
val labelMap: Map[ValueType, Set[Int]]
val pa: Array[Set[Int]]