GraphGen

scalation.database.graph_pm.GraphGen
See theGraphGen companion object
class GraphGen(typeSelector: Char, stream: Int)

The GraphGen class is used to build random graph with various characteristics. Needs to generate vertex labels of various types including Int, Double, String based on the type.

Value parameters

stream

the random number stream to use (0 to 999)

typeSelector

the variable for type matches (work around for generic erasure)

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def genBFSQuery(size: Int, avDegree: Int, g: Graph, inverse: Boolean, name: String): Graph

Given a graph g, performs a breadth first search starting at a random vertex until the breadth first tree contains size vertices. At each junction, it chooses a random number of children to traverse, with that random number averaging to avDegree.

Given a graph g, performs a breadth first search starting at a random vertex until the breadth first tree contains size vertices. At each junction, it chooses a random number of children to traverse, with that random number averaging to avDegree.

Value parameters

avDegree

the average out-degree

g

the data graph to extract from

inverse

whether to create inverse adjacency (parents)

name

the name of the graph

size

the number of vertices to extract

Attributes

def genPowerLawGraph(size: Int, nLabels: Int, eLabels: Int, maxDegree: Int, distPow: Double, inverse: Boolean, name: String): Graph

Generates a graph with power law degree distribution with exponent distPow and uniformly distributed labels.

Generates a graph with power law degree distribution with exponent distPow and uniformly distributed labels.

Value parameters

distPow

the power/exponent (2.1 is used in WWW graph pg 72 of m&m graph data)

eLabels

the number of edge labels (distributed uniformly)

inverse

whether to create inverse adjacency (parents)

maxDegree

the maximum allowed degree for any vertex

nLabels

the number of labels (distributed uniformly)

name

the name of the graph

size

the number of vertices

Attributes

def genPowerLawGraph_PowLabels(size: Int, nLabels: Int, eLabels: Int, maxDegree: Int, distPow: Double, inverse: Boolean, name: String): Graph

Generates a graph with power law degree distribution with exponent distPow and power law distributed labels.

Generates a graph with power law degree distribution with exponent distPow and power law distributed labels.

Value parameters

distPow

the power/exponent (2.1 is used in WWW graph pg 72 of m&m graph data)

eLabels

the number of edge labels (distributed uniformly)

inverse

whether to create inverse adjacency (parents)

maxDegree

the maximum allowed degree for any vertex

nLabels

the number of labels (distributed according to power law)

name

the name of the graph

size

the number of vertices

Attributes

def genRandomConnectedGraph(size: Int, nLabels: Int, eLabels: Int, avDegree: Int, inverse: Boolean, name: String): Graph

Generates a random connected graph by using genRandomGraph and checking whether it is connected.

Generates a random connected graph by using genRandomGraph and checking whether it is connected.

Value parameters

avDegree

the average degree

eLabels

the number of edge labels (distributed uniformly)

inverse

whether to create inverse adjacency (parents)

nLabels

the number of vertex labels (distributed uniformly)

name

the name of the graph

size

the number of vertices to generate

Attributes

def genRandomGraph(size: Int, nLabels: Int, eLabels: Int, avDegree: Int, inverse: Boolean, name: String, locality: Boolean): Graph

Generates a random graph with the specified size (number of vertices), average degree and labels evenly distributed across vertices from 0 to nLabels - 1. Not necessarily a connected graph.

Generates a random graph with the specified size (number of vertices), average degree and labels evenly distributed across vertices from 0 to nLabels - 1. Not necessarily a connected graph.

Value parameters

avDegree

the average degree

eLabels

the number of edge labels (distributed uniformly)

inverse

whether to create inverse adjacency (parents)

locality

whether to select children from anywhere in graph or locally

nLabels

the number of vertex labels (distributed uniformly)

name

the name of the graph

size

the number of vertices to generate

Attributes

def genRandomGraph_PowLabels(size: Int, nLabels: Int, eLabels: Int, avDegree: Int, distPow: Double, inverse: Boolean, name: String): Graph

Generates a random graph with labels distributed based on a power law distribution (currently with the magic number 2.1 for the power law exponent).

Generates a random graph with labels distributed based on a power law distribution (currently with the magic number 2.1 for the power law exponent).

Value parameters

avDegree

the average out-degree

distPow

the power/exponent (2.1 is used in WWW graph pg 72 of m&m graph data)

eLabels

the number of edge labels (distributed uniformly)

inverse

whether to create inverse adjacency (parents)

nLabels

the number of labels (distributed according to power law)

name

the name of the graph

size

the number of vertices to generate

Attributes

def setVariate(nLabs: Int): Unit

Set the Random Variate Generator, using the one based on the type.

Set the Random Variate Generator, using the one based on the type.

Value parameters

nLabs

the number of labels to generate

Attributes