public class RandomRDF extends Object implements GraphGenerator
| Modifier and Type | Method and Description |
|---|---|
void |
generateGraph(double avgDegree,
int numberOfEdges,
long seed,
GraphBuilder builder)
Generates a graph based on the given parameters using the given
GraphBuilder. |
void |
generateGraph(int numberOfNodes,
double avgDegree,
long seed,
GraphBuilder builder)
Generates a graph based on the given parameters using the given
GraphBuilder. |
protected void |
getBarabasiRDF(int N,
double degree,
long seed,
GraphBuilder builder)
generate a random RDF graph using Barabasi algorithm and
inverting some edges to be sure that the graph is connected (reachable from a single source).
|
protected void |
getBarabasiRDFum(int N,
double degree,
long seed,
GraphBuilder builder) |
protected int |
getInitGraph(int N,
double degree,
long seed,
int[] subj,
int[] obj,
int[] inDeg,
int m) |
(package private) int |
getOneNodeLinks(int node,
int m1,
int indexToEdgeList,
int[] subj,
int[] obj,
int[] inDeg) |
protected int[] |
weightedSampleWithoutReplacement(int n,
int m,
int[] wt)
Samples numbers from 1 to n; m times without replacement using weights in wt
|
protected int[] |
weightedSampleWithoutReplacementbswithawBS(int n,
int m,
int[] wt) |
protected int[] |
weightedSampleWithoutReplacementwithaw(int n,
int m,
int[] wt)
Samples numbers from 1 to n; m times without replacement using weights in wt
|
public RandomRDF(String gname)
protected int[] weightedSampleWithoutReplacementwithaw(int n,
int m,
int[] wt)
n - number of values to choose from.m - number of values to choose.wt - the weights for the values in index from 1 to n (0 is ignored).protected int[] weightedSampleWithoutReplacementbswithawBS(int n,
int m,
int[] wt)
protected int[] weightedSampleWithoutReplacement(int n,
int m,
int[] wt)
n - number of values to choose from.m - number of values to choose.wt - the weights for the values in index from 1 to n (0 is ignored).protected void getBarabasiRDF(int N,
double degree,
long seed,
GraphBuilder builder)
N - the number of nodesdegree - the average degree of the nodes in the graphseed - the random seed to be able to reproduce the results.int getOneNodeLinks(int node,
int m1,
int indexToEdgeList,
int[] subj,
int[] obj,
int[] inDeg)
protected void getBarabasiRDFum(int N,
double degree,
long seed,
GraphBuilder builder)
protected int getInitGraph(int N,
double degree,
long seed,
int[] subj,
int[] obj,
int[] inDeg,
int m)
public void generateGraph(int numberOfNodes,
double avgDegree,
long seed,
GraphBuilder builder)
GraphGeneratorGraphBuilder.generateGraph in interface GraphGeneratornumberOfNodes - the number of nodes the generated graph should haveavgDegree - the average degree the nodes in the graph should haveseed - the seed that should be used to initialize pseudo random processes
to enable reproducibility of graphs.builder - the GraphBuilder that should be used to create the graph.public void generateGraph(double avgDegree,
int numberOfEdges,
long seed,
GraphBuilder builder)
GraphGeneratorGraphBuilder.generateGraph in interface GraphGeneratoravgDegree - the average degree the nodes in the graph should havenumberOfEdges - the number of edges the generated graph should haveseed - the seed that should be used to initialize pseudo random processes
to enable reproducibility of graphs.builder - the GraphBuilder that should be used to create the graph.Copyright © 2019–2020. All rights reserved.