|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.yrbcn.graph.triangles.TrianglesAlgorithm
public abstract class TrianglesAlgorithm
This is an abstract algorithm for counting the number of triangles for the nodes in a graph.
Field Summary | |
---|---|
short |
DEFAULT_WIDTH
Default width |
boolean |
done
done or not |
ImmutableGraph |
graph
The graph. |
short |
maxDistance
The maximum distance for the iterations |
int |
numNodes
The number of nodes. |
MersenneTwister |
random
Random number generator; all random numbers should be created using this generator |
double[] |
triangles
Estimation |
Constructor Summary | |
---|---|
TrianglesAlgorithm()
|
|
TrianglesAlgorithm(ImmutableGraph graph,
int seed,
short maxDistance)
Creates a new TrianglesAlgorithm run; the algorithm will count how many triangles each element has |
Method Summary | |
---|---|
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() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final short DEFAULT_WIDTH
public short maxDistance
public ImmutableGraph graph
public int numNodes
public boolean done
public double[] triangles
public MersenneTwister random
Constructor Detail |
---|
public TrianglesAlgorithm()
public TrianglesAlgorithm(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 exploreMethod Detail |
---|
public boolean done()
protected abstract void init()
public abstract void step() throws FileNotFoundException, IOException
FileNotFoundException
IOException
public abstract void countTriangles() throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |