class MGraphGen[TLabel] extends Error
The MGraphGen
object is used to build random graph with various characteristics.
Needs to generate vertex labels of various types including Int
, Double
,
String
, VectorD
based on the TLabel
type.
- Alphabetic
- By Inheritance
- MGraphGen
- Error
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
MGraphGen(typeSelector: TLabel, stream: Int = 0)(implicit arg0: ClassTag[TLabel])
- typeSelector
the variable for type matches (work around for generic erasure)
- stream
the random number stream to use (0 to 999)
Value Members
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
def
genBFSQuery(size: Int, avDegree: Int, g: MGraph[TLabel], inverse: Boolean = false, name: String = "g"): MGraph[TLabel]
Given a graph 'g', performs a breadth first search starting at a random vertex until the breadth first tree contains 'size' vertices.
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'.
- size
the number of vertices to extract
- 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
-
def
genPowerLawGraph(size: Int, nLabels: Int, eLabels: Int, maxDegree: Int, distPow: Double = 2.1, inverse: Boolean = true, name: String = "g"): MGraph[TLabel]
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.
- size
the number of vertices
- nLabels
the number of labels (distributed uniformly)
- eLabels
the number of edge labels (distributed uniformly)
- maxDegree
the maximum allowed degree for any vertex
- distPow
the power/exponent (2.1 is used in WWW graph pg 72 of m&m graph data)
- inverse
whether to create inverse adjacency (parents)
- name
the name of the graph
-
def
genPowerLawGraph_PowLabels(size: Int, nLabels: Int, eLabels: Int, maxDegree: Int, distPow: Double = 2.1, inverse: Boolean = false, name: String = "g"): MGraph[TLabel]
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.
- size
the number of vertices
- nLabels
the number of labels (distributed according to power law)
- eLabels
the number of edge labels (distributed uniformly)
- maxDegree
the maximum allowed degree for any vertex
- distPow
the power/exponent (2.1 is used in WWW graph pg 72 of m&m graph data)
- inverse
whether to create inverse adjacency (parents)
- name
the name of the graph
-
def
genRandomConnectedGraph(size: Int, nLabels: Int, eLabels: Int, avDegree: Int, inverse: Boolean = true, name: String = "g"): MGraph[TLabel]
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.
- size
the number of vertices to generate
- nLabels
the number of vertex labels (distributed uniformly)
- eLabels
the number of edge labels (distributed uniformly)
- avDegree
the average degree
- inverse
whether to create inverse adjacency (parents)
- name
the name of the graph
-
def
genRandomGraph(size: Int, nLabels: Int, eLabels: Int, avDegree: Int, inverse: Boolean = false, name: String = "g", locality: Boolean = true): MGraph[TLabel]
Generates a random graph with the specified size (number of vertices), average degree and labels evenly distributed across vertices from 0 to 'nLabels - 1'.
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.
- size
the number of vertices to generate
- nLabels
the number of vertex labels (distributed uniformly)
- eLabels
the number of edge labels (distributed uniformly)
- avDegree
the average degree
- inverse
whether to create inverse adjacency (parents)
- name
the name of the graph
- locality
whether to select children from anywhere in graph or locally
-
def
genRandomGraph_PowLabels(size: Int, nLabels: Int, eLabels: Int, avDegree: Int, distPow: Double = 2.1, inverse: Boolean = true, name: String = "g"): MGraph[TLabel]
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).
- size
the number of vertices to generate
- nLabels
the number of labels (distributed according to power law)
- eLabels
the number of edge labels (distributed uniformly)
- avDegree
the average out-degree
- distPow
the power/exponent (2.1 is used in WWW graph pg 72 of m&m graph data)
- inverse
whether to create inverse adjacency (parents)
- name
the name of the graph
-
def
setVariate(nLabs: Int): Unit
Set the Random Variate Generator, using the one based on the
TLabel
type.Set the Random Variate Generator, using the one based on the
TLabel
type.- nLabs
the number of labels to generate