public class SamplingTrianglesAlgorithm extends TrianglesAlgorithm
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_SAMPLE_SIZE |
int |
maxDegreeInGraph |
int[] |
sampledDegree |
Hashtable<Integer,Integer> |
sampledHash |
int[] |
sampledNeighbors |
int[] |
sampledNeighborsListStart |
int[] |
sampledNodeid |
int[] |
sampledTriangles |
int |
sampleSize |
DEFAULT_WIDTH, done, graph, maxDistance, numNodes, random, triangles| Constructor and Description |
|---|
SamplingTrianglesAlgorithm(it.unimi.dsi.webgraph.ImmutableGraph graph,
int seed,
short maxDistance)
Creates a new TrianglesAlgorithm run; the algorithm is a functional
ranking in which the operator used is OR
|
| Modifier and Type | Method and Description |
|---|---|
void |
countTriangles() |
void |
dumpSample()
Shows sampled elements
|
void |
init()
Initializes one run of the algorithm
|
void |
setDeterministicSampling(int startingPoint) |
void |
setRandomSampling() |
void |
setSampleSize(int ss) |
void |
step()
Calculation step; at each step I should have an estimation of the
clustering coefficient for that particular step
|
donepublic static final int DEFAULT_SAMPLE_SIZE
public int[] sampledNodeid
public int[] sampledTriangles
public int sampleSize
public int[] sampledDegree
public int[] sampledNeighbors
public int[] sampledNeighborsListStart
public int maxDegreeInGraph
public SamplingTrianglesAlgorithm(it.unimi.dsi.webgraph.ImmutableGraph graph,
int seed,
short maxDistance)
g - the graph.width - the number of bits to use (32)seed - the random seed for the random number generatorpublic void setSampleSize(int ss)
public void setDeterministicSampling(int startingPoint)
public void setRandomSampling()
public void init()
TrianglesAlgorithminit in class TrianglesAlgorithmpublic void step()
step in class TrianglesAlgorithmpublic void countTriangles()
countTriangles in class TrianglesAlgorithmpublic void dumpSample()