public class PageRank extends Object implements Statistics, LongTask
Modifier and Type | Field and Description |
---|---|
private double |
epsilon |
private boolean |
isCanceled |
private boolean |
isDirected |
static String |
PAGERANK |
private double[] |
pageranks |
private double |
probability |
private ProgressTicket |
progress |
private boolean |
useEdgeWeight |
Constructor and Description |
---|
PageRank() |
Modifier and Type | Method and Description |
---|---|
(package private) double[] |
calculatePagerank(org.gephi.graph.api.Graph hgraph,
HashMap<org.gephi.graph.api.Node,Integer> indicies,
boolean directed,
boolean useWeights,
double eps,
double prob) |
private double |
calculateR(org.gephi.graph.api.Graph hgraph,
double[] pagerankValues,
HashMap<org.gephi.graph.api.Node,Integer> indicies,
boolean directed,
double prob) |
boolean |
cancel()
Cancel the task.
|
HashMap<org.gephi.graph.api.Node,Integer> |
createIndiciesMap(org.gephi.graph.api.Graph hgraph) |
void |
execute(org.gephi.graph.api.Graph hgraph) |
void |
execute(org.gephi.graph.api.GraphModel graphModel)
Executes the statistics algorithm.
|
boolean |
getDirected() |
double |
getEpsilon() |
double |
getProbability() |
String |
getReport()
Returns an HTML string that displays the statistics result.
|
private org.gephi.graph.api.Column |
initializeAttributeColunms(org.gephi.graph.api.GraphModel graphModel) |
boolean |
isUseEdgeWeight() |
private void |
saveCalculatedValues(org.gephi.graph.api.Graph hgraph,
org.gephi.graph.api.Column attributeColumn,
HashMap<org.gephi.graph.api.Node,Integer> indicies,
double[] nodePagrank) |
void |
setDirected(boolean isDirected) |
void |
setEpsilon(double eps) |
private void |
setInitialValues(org.gephi.graph.api.Graph hgraph,
double[] pagerankValues,
double[] weights,
boolean directed,
boolean useWeights) |
void |
setProbability(double prob) |
void |
setProgressTicket(ProgressTicket progressTicket)
Set the progress ticket for the long task.
|
void |
setUseEdgeWeight(boolean useEdgeWeight) |
private double |
updateValueForNode(org.gephi.graph.api.Graph hgraph,
org.gephi.graph.api.Node s,
double[] pagerankValues,
double[] weights,
HashMap<org.gephi.graph.api.Node,Integer> indicies,
boolean directed,
boolean useWeights,
double r,
double prob) |
public static final String PAGERANK
private ProgressTicket progress
private boolean isCanceled
private double epsilon
private double probability
private boolean useEdgeWeight
private double[] pageranks
private boolean isDirected
public void setDirected(boolean isDirected)
public boolean getDirected()
public void execute(org.gephi.graph.api.GraphModel graphModel)
Statistics
It is preferable to work on visible graphs, to be synchronized with the visualization.
execute
in interface Statistics
graphModel
- The graph modelpublic void execute(org.gephi.graph.api.Graph hgraph)
private org.gephi.graph.api.Column initializeAttributeColunms(org.gephi.graph.api.GraphModel graphModel)
private void saveCalculatedValues(org.gephi.graph.api.Graph hgraph, org.gephi.graph.api.Column attributeColumn, HashMap<org.gephi.graph.api.Node,Integer> indicies, double[] nodePagrank)
private void setInitialValues(org.gephi.graph.api.Graph hgraph, double[] pagerankValues, double[] weights, boolean directed, boolean useWeights)
private double calculateR(org.gephi.graph.api.Graph hgraph, double[] pagerankValues, HashMap<org.gephi.graph.api.Node,Integer> indicies, boolean directed, double prob)
private double updateValueForNode(org.gephi.graph.api.Graph hgraph, org.gephi.graph.api.Node s, double[] pagerankValues, double[] weights, HashMap<org.gephi.graph.api.Node,Integer> indicies, boolean directed, boolean useWeights, double r, double prob)
double[] calculatePagerank(org.gephi.graph.api.Graph hgraph, HashMap<org.gephi.graph.api.Node,Integer> indicies, boolean directed, boolean useWeights, double eps, double prob)
public HashMap<org.gephi.graph.api.Node,Integer> createIndiciesMap(org.gephi.graph.api.Graph hgraph)
public String getReport()
Statistics
getReport
in interface Statistics
public boolean cancel()
LongTask
true
if the task has been sucessfully cancelled, false
otherwise.public void setProgressTicket(ProgressTicket progressTicket)
LongTask
setProgressTicket
in interface LongTask
progressTicket
- public void setProbability(double prob)
prob
- public void setEpsilon(double eps)
eps
- public double getProbability()
public double getEpsilon()
public boolean isUseEdgeWeight()
public void setUseEdgeWeight(boolean useEdgeWeight)
Copyright © 2007–2016 Gephi Consortium. All rights reserved.