|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neo4j.graphalgo.impl.centrality.EigenvectorCentralityPower
public class EigenvectorCentralityPower
Computing eigenvector centrality with the "power method". Convergence is dependent of the eigenvalues of the input adjacency matrix (the network). If the two largest eigenvalues are u1 and u2, a small factor u2/u1 will give a faster convergence (i.e. faster computation). NOTE: Currently only works on Doubles.
| Field Summary | |
|---|---|
protected CostEvaluator<Double> |
costEvaluator
|
protected boolean |
doneCalculation
|
protected Set<Node> |
nodeSet
|
protected double |
precision
|
protected Direction |
relationDirection
|
protected Set<Relationship> |
relationshipSet
|
protected int |
totalIterations
|
protected Map<Node,Double> |
values
|
| Constructor Summary | |
|---|---|
EigenvectorCentralityPower(Direction relationDirection,
CostEvaluator<Double> costEvaluator,
Set<Node> nodeSet,
Set<Relationship> relationshipSet,
double precision)
|
|
| Method Summary | |
|---|---|
void |
calculate()
Internal calculate method that will do the calculation. |
Double |
getCentrality(Node node)
This can be used to retrieve the result for every node. |
int |
getMaxIterations()
|
int |
getTotalIterations()
|
protected void |
normalize(Map<Node,Double> vector)
Normalizes a vector represented as a Map. |
protected void |
processRelationship(Map<Node,Double> newValues,
Relationship relationship,
boolean backwards)
Internal method used in the "matrix multiplication" in each iteration. |
void |
reset()
This resets the calculation if we for some reason would like to redo it. |
int |
runIterations(int maxNrIterations)
This runs a number of iterations in the computation and stops when enough precision has been reached. |
void |
setMaxIterations(int maxIterations)
Limit the maximum number of iterations to run. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Direction relationDirection
protected CostEvaluator<Double> costEvaluator
protected Set<Node> nodeSet
protected Set<Relationship> relationshipSet
protected double precision
protected boolean doneCalculation
protected Map<Node,Double> values
protected int totalIterations
| Constructor Detail |
|---|
public EigenvectorCentralityPower(Direction relationDirection,
CostEvaluator<Double> costEvaluator,
Set<Node> nodeSet,
Set<Relationship> relationshipSet,
double precision)
relationDirection - The direction in which the paths should follow the
relationships.costEvaluator - nodeSet - The set of nodes the calculation should be run on.relationshipSet - The set of relationships that should be processed.precision - Precision factor (ex. 0.01 for 1% error). Note that this is
not the error from the correct values, but the amount of
change tolerated in one iteration.CostEvaluator| Method Detail |
|---|
public Double getCentrality(Node node)
reset()
getCentrality in interface EigenvectorCentralitynode -
public void reset()
reset in interface EigenvectorCentralitypublic void calculate()
calculate in interface EigenvectorCentralitypublic int runIterations(int maxNrIterations)
maxNrIterations - The maximum number of iterations to run.
protected void processRelationship(Map<Node,Double> newValues,
Relationship relationship,
boolean backwards)
protected void normalize(Map<Node,Double> vector)
vector - public int getTotalIterations()
public int getMaxIterations()
public void setMaxIterations(int maxIterations)
maxIterations - the maxIterations to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||