java.lang.Object
es.uam.eps.ir.relison.sna.metrics.vertex.HITS<U>
Type Parameters:
U - Type of the users.
All Implemented Interfaces:
VertexMetric<U>

public class HITS<U>
extends java.lang.Object
implements VertexMetric<U>
Computes the HITS values of the different nodes in a graph.

Reference: J.M. Kleinberg. Authoritative sources in a hyperlink environment. Journal of the ACM 46(5), PP. 604-632 (1999)

  • Field Summary

    Fields 
    Modifier and Type Field Description
    private boolean authorities
    Indicates if we want to return authorities or hubs.
    private java.util.Map<U,​java.lang.Double> auths
    Authorities values.
    private boolean computed
    True if already computed, false if not.
    private java.util.Map<U,​java.lang.Double> hubs
    Hubs values.
    private int MAXITER
    Maximum number of iterations.
    private Graph<U> oldGraph
    Last graph which computed the resolution.
  • Constructor Summary

    Constructors 
    Constructor Description
    HITS​(boolean authorities)
    Constructor for not personalized PageRank.
  • Method Summary

    Modifier and Type Method Description
    java.util.Map<U,​java.lang.Double> compute​(Graph<U> graph)
    Computes the value of the metric for all the users in the graph.
    double compute​(Graph<U> graph, U user)
    Computes the value of the metric for a single user.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface es.uam.eps.ir.relison.sna.metrics.VertexMetric

    averageValue, averageValue, compute
  • Field Details

    • MAXITER

      private final int MAXITER
      Maximum number of iterations.
      See Also:
      Constant Field Values
    • authorities

      private final boolean authorities
      Indicates if we want to return authorities or hubs.
    • oldGraph

      private Graph<U> oldGraph
      Last graph which computed the resolution.
    • computed

      private boolean computed
      True if already computed, false if not.
    • auths

      private java.util.Map<U,​java.lang.Double> auths
      Authorities values.
    • hubs

      private java.util.Map<U,​java.lang.Double> hubs
      Hubs values.
  • Constructor Details

    • HITS

      public HITS​(boolean authorities)
      Constructor for not personalized PageRank.
      Parameters:
      authorities - true if we want to compute the authorities, false if not.
  • Method Details

    • compute

      public double compute​(Graph<U> graph, U user)
      Description copied from interface: VertexMetric
      Computes the value of the metric for a single user.
      Specified by:
      compute in interface VertexMetric<U>
      Parameters:
      graph - The graph.
      user - The user to compute.
      Returns:
      the value of the metric.
    • compute

      public java.util.Map<U,​java.lang.Double> compute​(Graph<U> graph)
      Description copied from interface: VertexMetric
      Computes the value of the metric for all the users in the graph.
      Specified by:
      compute in interface VertexMetric<U>
      Parameters:
      graph - The graph.
      Returns:
      A map relating the users with the values of the metric.