es.yrbcn.graph.triangles
Class SamplingTrianglesAlgorithm

java.lang.Object
  extended by es.yrbcn.graph.triangles.TrianglesAlgorithm
      extended by es.yrbcn.graph.triangles.SamplingTrianglesAlgorithm

public class SamplingTrianglesAlgorithm
extends TrianglesAlgorithm


Field Summary
static int DEFAULT_SAMPLE_SIZE
           
 int maxDegreeInGraph
           
 int[] sampledDegree
           
 Hashtable<Integer,Integer> sampledHash
           
 int[] sampledNeighbors
           
 int[] sampledNeighborsListStart
           
 int[] sampledNodeid
           
 int[] sampledTriangles
           
 int sampleSize
           
 
Fields inherited from class es.yrbcn.graph.triangles.TrianglesAlgorithm
DEFAULT_WIDTH, done, graph, maxDistance, numNodes, random, triangles
 
Constructor Summary
SamplingTrianglesAlgorithm(ImmutableGraph graph, int seed, short maxDistance)
          Creates a new TrianglesAlgorithm run; the algorithm is a functional ranking in which the operator used is OR
 
Method Summary
 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
 
Methods inherited from class es.yrbcn.graph.triangles.TrianglesAlgorithm
done
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SAMPLE_SIZE

public static final int DEFAULT_SAMPLE_SIZE
See Also:
Constant Field Values

sampledNodeid

public int[] sampledNodeid

sampledTriangles

public int[] sampledTriangles

sampledHash

public Hashtable<Integer,Integer> sampledHash

sampleSize

public int sampleSize

sampledDegree

public int[] sampledDegree

sampledNeighbors

public int[] sampledNeighbors

sampledNeighborsListStart

public int[] sampledNeighborsListStart

maxDegreeInGraph

public int maxDegreeInGraph
Constructor Detail

SamplingTrianglesAlgorithm

public SamplingTrianglesAlgorithm(ImmutableGraph graph,
                                  int seed,
                                  short maxDistance)
Creates a new TrianglesAlgorithm run; the algorithm is a functional ranking in which the operator used is OR

Parameters:
g - the graph.
width - the number of bits to use (32)
seed - the random seed for the random number generator
Method Detail

setSampleSize

public void setSampleSize(int ss)

setDeterministicSampling

public void setDeterministicSampling(int startingPoint)

setRandomSampling

public void setRandomSampling()

init

public void init()
Description copied from class: TrianglesAlgorithm
Initializes one run of the algorithm

Specified by:
init in class TrianglesAlgorithm

step

public void step()
Calculation step; at each step I should have an estimation of the clustering coefficient for that particular step

Specified by:
step in class TrianglesAlgorithm

countTriangles

public void countTriangles()
Specified by:
countTriangles in class TrianglesAlgorithm

dumpSample

public void dumpSample()
Shows sampled elements