public class PageRank
extends java.lang.Object
Constructor and Description |
---|
PageRank(Grph g,
java.util.Random prng)
Creates an empty page rank for the given graph, using the given random
number generator.
|
Modifier and Type | Method and Description |
---|---|
void |
allSourceRandomWalks(int walksLength,
boolean multithreaded)
Performs random walks of the given length, starting from every vertex in
the graph.
|
void |
compute()
Computes the page rank value for every vertex in the graph.
|
toools.math.Distribution<java.lang.Double> |
getDistribution()
Computes the distribution for this page rank.
|
int |
getNumberOfOccurences(int v)
Retrieves the number of times the given vertex was encountered along the
random walks
|
double |
getRank(int v)
Computes the rank for the given vertex.
|
void |
iterate(int numberOfIterations,
int walksLength)
Performs the given number of random walks of the given length, starting
from every vertex in the graph.
|
void |
randomWalk(int source,
int length)
Performs one single random walk of the given length, starting from the
given source.
|
void |
render()
Graphically renders this page rank on the graph.
|
public PageRank(Grph g, java.util.Random prng)
g
- a graphprng
- a pseudo-random number generatorpublic int getNumberOfOccurences(int v)
v
- public double getRank(int v)
v
- a vertex in the graphpublic void render()
public toools.math.Distribution<java.lang.Double> getDistribution()
public void iterate(int numberOfIterations, int walksLength)
numberOfIterations
- the number of "all source random walks" to do.walksLength
- the length of each random walkpublic void allSourceRandomWalks(int walksLength, boolean multithreaded)
walksLength
- the length of each random walkmultithreaded
- whether the process will be be multi-threaded.public void randomWalk(int source, int length)
source
- a vertex in the graphlength
- the length of the walk.public void compute()