edu.stanford.math.plex4.graph.random
public class ClusteredERGraph extends GraphInstanceGenerator
GraphInstanceGenerator.ImplementationType
graphImplementation, implementationType
Constructor and Description |
---|
ClusteredERGraph(int clusterCount) |
Modifier and Type | Method and Description |
---|---|
void |
defineCluster(int index,
int size,
double param)
Warning: No input validation is performed.
|
java.lang.String |
explain() |
AbstractUndirectedGraph |
generate() |
protected int |
getRandomIntInRange(int x0,
int x1) |
void |
linkClusters(int srcIndex,
int destIndex,
int edgeCount)
Warning: No input validation is performed.
|
protected void |
linkClustersInPlace(AbstractUndirectedGraph graph,
int srcStart,
int srcEnd,
int dstStart,
int dstEnd,
int edgeCount) |
protected void |
makeClusterInPlace(AbstractUndirectedGraph graph,
int startNode,
int endNode,
double p) |
java.lang.String |
toString() |
initializeGraph, setImplementationType
public void defineCluster(int index, int size, double param)
index
- size
- param
- public void linkClusters(int srcIndex, int destIndex, int edgeCount)
srcIndex
- destIndex
- param
- public AbstractUndirectedGraph generate()
generate
in class GraphInstanceGenerator
protected void linkClustersInPlace(AbstractUndirectedGraph graph, int srcStart, int srcEnd, int dstStart, int dstEnd, int edgeCount)
graph
- graph to add edges tosrcStart
- Start of the source cluster range (inclusive)srcEnd
- End of the source cluster range (exlusive)dstStart
- Start of the dest cluster range (inclusive)dstEnd
- End of the dest cluster range (exlusive)edgeCount
- number of edges to randomly makeprotected int getRandomIntInRange(int x0, int x1)
x0
- start of range (inclusive)x1
- end of range (exclusive)protected void makeClusterInPlace(AbstractUndirectedGraph graph, int startNode, int endNode, double p)
graph
- the graph to add edges tostartNode
- the first node in the cluster (inclusive)endNode
- one greater than the last node in the clusterp
- edge probabilitypublic java.lang.String explain()
public java.lang.String toString()
toString
in class java.lang.Object