public class GraphDataSet
extends java.lang.Object
implements java.lang.Iterable<dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate>>
fromCPQ(int, int, int)
Modifier and Type | Field and Description |
---|---|
private java.util.List<dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate>> |
data
The graphs for this data set.
|
Constructor and Description |
---|
GraphDataSet(java.util.List<dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate>> data)
Constructs a new data set with the given data.
|
Modifier and Type | Method and Description |
---|---|
static GraphDataSet |
fromCPQ(int n,
int rules,
int labels)
Generates a data set consisting of CPQ query graphs using
CPQ.generateRandomCPQ(int, int) . |
double |
getEdgesAverage()
Gets the average number of edges in the graphs for this data set.
|
double |
getEdgesStdDev()
Gets the sample standard deviation of the number of edges in the graphs for this data set.
|
double |
getNodesAverage()
Gets the average number of nodes in the graphs for this data set.
|
double |
getNodesStdDev()
Gets the sample standard deviation of the number of nodes in the graphs for this data set.
|
java.util.Iterator<dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate>> |
iterator() |
void |
print()
Prints some general statistics about this data set, namely the data set
size and average number of nodes and edges together with their standard deviation.
|
void |
print(java.io.PrintStream out)
Prints some general statistics about this data set, namely the data set
size and average number of nodes and edges together with their standard deviation.
|
private double |
stdDev(java.util.function.ToIntFunction<dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate>> field)
Computes the sample standard deviation of the given field in the data set.
|
private java.util.List<dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate>> data
public GraphDataSet(java.util.List<dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate>> data)
data
- The data for this data set.public double getNodesAverage()
public double getNodesStdDev()
public double getEdgesAverage()
public double getEdgesStdDev()
private double stdDev(java.util.function.ToIntFunction<dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate>> field)
field
- The field to compute the standard deviation of.public void print()
public void print(java.io.PrintStream out)
out
- The stream to write to.public java.util.Iterator<dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate>> iterator()
iterator
in interface java.lang.Iterable<dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate>>
public static GraphDataSet fromCPQ(int n, int rules, int labels)
CPQ.generateRandomCPQ(int, int)
.n
- The number of CPQ query graphs to generate.rules
- The maximum number of rule applications
when generating CPQs (influences the size of the CPQ).labels
- The maximum number of distinct labels to use
when generating a CPQ.CPQ.generateRandomCPQ(int, int)