Class PageRank<U>
java.lang.Object
es.uam.eps.ir.relison.sna.metrics.vertex.PageRank<U>
- Type Parameters:
U- type of the nodes.
- All Implemented Interfaces:
VertexMetric<U>
public class PageRank<U> extends java.lang.Object implements VertexMetric<U>
Computes the PageRank values of the different nodes in the graph.
Reference: S. Brin, L. Page. The anatomy of a large-scale hypertextual web search engine. 7th International Conference on World Wide Web (WWW 1998), Brisbane, Australia, pp. 107-117 (1998)
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description doubleaverageValue(Graph<U> graph)Computes the average value of the metric in the graph.java.util.Map<U,java.lang.Double>compute(Graph<U> graph)Computes the value of the metric for all the users in the graph.java.util.Map<U,java.lang.Double>compute(Graph<U> graph, java.util.stream.Stream<U> users)Computes the value of the metric for a subset of the users in the graph.doublecompute(Graph<U> graph, U user)Computes the value of the metric for a single user.
-
Field Details
-
MAXITER
private final int MAXITERMaximum number of iterations- See Also:
- Constant Field Values
-
THRESHOLD
private final double THRESHOLDThreshold- See Also:
- Constant Field Values
-
r
private final double rTeleport parameter. -
u
Original node (if PageRank is personalized).
-
-
Constructor Details
-
Method Details
-
compute
Description copied from interface:VertexMetricComputes the value of the metric for a single user.- Specified by:
computein interfaceVertexMetric<U>- Parameters:
graph- The graph.user- The user to compute.- Returns:
- the value of the metric.
-
compute
Description copied from interface:VertexMetricComputes the value of the metric for all the users in the graph.- Specified by:
computein interfaceVertexMetric<U>- Parameters:
graph- The graph.- Returns:
- A map relating the users with the values of the metric.
-
compute
public java.util.Map<U,java.lang.Double> compute(Graph<U> graph, java.util.stream.Stream<U> users)Description copied from interface:VertexMetricComputes the value of the metric for a subset of the users in the graph.- Specified by:
computein interfaceVertexMetric<U>- Parameters:
graph- the graph.users- the stream of users.- Returns:
- a map relating users with the values of the metric. Nodes not in the graph will not be included in the map.
-
averageValue
Description copied from interface:VertexMetricComputes the average value of the metric in the graph.- Specified by:
averageValuein interfaceVertexMetric<U>- Parameters:
graph- The graph.- Returns:
- the average value of the metric.
-