V
- the graph vertex typeE
- the graph edge typepublic class PlantedPartitionGraphGenerator<V,E> extends Object implements GraphGenerator<V,E,V>
The $l$-planted partition model is a special case of the Stochastic Block Model. If the probability matrix is a constant, in the sense that $P_{ij}=p$ for all $i,j$, then the result is the Erdős–Rényi model $\mathcal G(n,p)$. This case is degenerate—the partition into communities becomes irrelevant— but it illustrates a close relationship to the Erdős–Rényi model. For more information on planted graphs, refer to:
Constructor and Description |
---|
PlantedPartitionGraphGenerator(int l,
int k,
double p,
double q)
Construct a new PlantedPartitionGraphGenerator.
|
PlantedPartitionGraphGenerator(int l,
int k,
double p,
double q,
boolean selfLoops)
Construct a new PlantedPartitionGraphGenerator.
|
PlantedPartitionGraphGenerator(int l,
int k,
double p,
double q,
long seed)
Construct a new PlantedPartitionGraphGenerator.
|
PlantedPartitionGraphGenerator(int l,
int k,
double p,
double q,
long seed,
boolean selfLoops)
Construct a new PlantedPartitionGraphGenerator.
|
PlantedPartitionGraphGenerator(int l,
int k,
double p,
double q,
Random rng,
boolean selfLoops)
Construct a new PlantedPartitionGraphGenerator.
|
Modifier and Type | Method and Description |
---|---|
void |
generateGraph(Graph<V,E> target,
Map<String,V> resultMap)
Generate an $l$-planted partition graph.
|
List<Set<V>> |
getCommunities()
Get the community structure of the graph.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateGraph, generateGraph, generateGraph
public PlantedPartitionGraphGenerator(int l, int k, double p, double q)
l
- number of groupsk
- number of nodes in each groupp
- probability of connecting vertices within a groupq
- probability of connecting vertices between groupsIllegalArgumentException
- if number of groups is negativeIllegalArgumentException
- if number of nodes in each group is negativeIllegalArgumentException
- if p is not in [0,1]IllegalArgumentException
- if q is not in [0,1]public PlantedPartitionGraphGenerator(int l, int k, double p, double q, boolean selfLoops)
l
- number of groupsk
- number of nodes in each groupp
- probability of connecting vertices within a groupq
- probability of connecting vertices between groupsselfLoops
- true if the graph allows self loopsIllegalArgumentException
- if number of groups is negativeIllegalArgumentException
- if number of nodes in each group is negativeIllegalArgumentException
- if p is not in [0,1]IllegalArgumentException
- if q is not in [0,1]public PlantedPartitionGraphGenerator(int l, int k, double p, double q, long seed)
l
- number of groupsk
- number of nodes in each groupp
- probability of connecting vertices within a groupq
- probability of connecting vertices between groupsseed
- seed for the random number generatorIllegalArgumentException
- if number of groups is negativeIllegalArgumentException
- if number of nodes in each group is negativeIllegalArgumentException
- if p is not in [0,1]IllegalArgumentException
- if q is not in [0,1]public PlantedPartitionGraphGenerator(int l, int k, double p, double q, long seed, boolean selfLoops)
l
- number of groupsk
- number of nodes in each groupp
- probability of connecting vertices within a groupq
- probability of connecting vertices between groupsseed
- seed for the random number generatorselfLoops
- true if the graph allows self loopsIllegalArgumentException
- if number of groups is negativeIllegalArgumentException
- if number of nodes in each group is negativeIllegalArgumentException
- if p is not in [0,1]IllegalArgumentException
- if q is not in [0,1]public PlantedPartitionGraphGenerator(int l, int k, double p, double q, Random rng, boolean selfLoops)
l
- number of groupsk
- number of nodes in each groupp
- probability of connecting vertices within a groupq
- probability of connecting vertices between groupsrng
- random number generatorselfLoops
- true if the graph allows self loopsIllegalArgumentException
- if number of groups is negativeIllegalArgumentException
- if number of nodes in each group is negativeIllegalArgumentException
- if p is not in [0,1]IllegalArgumentException
- if q is not in [0,1]public void generateGraph(Graph<V,E> target, Map<String,V> resultMap)
generateGraph
in interface GraphGenerator<V,E,V>
target
- target graphresultMap
- result mapIllegalArgumentException
- if target is directedIllegalArgumentException
- if self loops are requested but target does not allow themIllegalStateException
- if generateGraph() is called more than oncepublic List<Set<V>> getCommunities()
IllegalStateException
- if getCommunities() is called before generating the graphCopyright © 2018. All rights reserved.