public abstract class TrianglesAlgorithm extends Object
Modifier and Type | Field and Description |
---|---|
short |
DEFAULT_WIDTH
Default width
|
boolean |
done
done or not
|
it.unimi.dsi.webgraph.ImmutableGraph |
graph
The graph.
|
short |
maxDistance
The maximum distance for the iterations
|
int |
numNodes
The number of nodes.
|
cern.jet.random.engine.MersenneTwister |
random
Random number generator; all random numbers should be created using this generator
|
double[] |
triangles
Estimation
|
Constructor and Description |
---|
TrianglesAlgorithm() |
TrianglesAlgorithm(it.unimi.dsi.webgraph.ImmutableGraph graph,
int seed,
short maxDistance)
Creates a new TrianglesAlgorithm run; the algorithm
will count how many triangles each element has
|
Modifier and Type | Method and Description |
---|---|
abstract void |
countTriangles() |
boolean |
done() |
protected abstract void |
init()
Initializes one run of the algorithm
|
abstract void |
step()
Does one step of the algorithm; this is called until done()
|
public final short DEFAULT_WIDTH
public short maxDistance
public it.unimi.dsi.webgraph.ImmutableGraph graph
public int numNodes
public boolean done
public double[] triangles
public cern.jet.random.engine.MersenneTwister random
public TrianglesAlgorithm()
public TrianglesAlgorithm(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 generatormaxDistance
- the distance to explorepublic boolean done()
protected abstract void init()
public abstract void step() throws FileNotFoundException, IOException
FileNotFoundException
IOException
public abstract void countTriangles() throws IOException
IOException