V
- the graph vertex typeE
- the graph edge typepublic class GnpRandomGraphGenerator<V,E> extends Object implements GraphGenerator<V,E,V>
In the $G(n, p)$ model, a graph is constructed by connecting nodes randomly. Each edge is included in the graph with probability $p$ independent from every other edge. The complexity of the generator is $O(n^2)$ where $n$ is the number of vertices.
For the $G(n, M)$ model please see GnmRandomGraphGenerator
.
GnmRandomGraphGenerator
Constructor and Description |
---|
GnpRandomGraphGenerator(int n,
double p)
Create a new $G(n, p)$ random graph generator.
|
GnpRandomGraphGenerator(int n,
double p,
long seed)
Create a new $G(n, p)$ random graph generator.
|
GnpRandomGraphGenerator(int n,
double p,
long seed,
boolean createLoops)
Create a new $G(n, p)$ random graph generator.
|
GnpRandomGraphGenerator(int n,
double p,
Random rng,
boolean createLoops)
Create a new $G(n, p)$ random graph generator.
|
Modifier and Type | Method and Description |
---|---|
void |
generateGraph(Graph<V,E> target,
Map<String,V> resultMap)
Generates a random graph based on the $G(n, p)$ model.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateGraph, generateGraph, generateGraph
public GnpRandomGraphGenerator(int n, double p)
n
- the number of nodesp
- the edge probabilitypublic GnpRandomGraphGenerator(int n, double p, long seed)
n
- the number of nodesp
- the edge probabilityseed
- seed for the random number generatorpublic GnpRandomGraphGenerator(int n, double p, long seed, boolean createLoops)
n
- the number of nodesp
- the edge probabilityseed
- seed for the random number generatorcreateLoops
- whether the generated graph may create loopspublic GnpRandomGraphGenerator(int n, double p, Random rng, boolean createLoops)
n
- the number of nodesp
- the edge probabilityrng
- the random number generator to usecreateLoops
- whether the generated graph may create loopsCopyright © 2018. All rights reserved.