Class HITSWithPriors<V,​E>

  • All Implemented Interfaces:
    VertexScorer<V,​HITS.Scores>, IterativeContext
    Direct Known Subclasses:
    HITS

    public class HITSWithPriors<V,​E>
    extends AbstractIterativeScorerWithPriors<V,​E,​HITS.Scores>
    A generalization of HITS that permits non-uniformly-distributed random jumps. The 'vertex_priors' (that is, prior probabilities for each vertex) may be thought of as the fraction of the total 'potential' (hub or authority score) that is assigned to that vertex out of the portion that is assigned according to random jumps.
    See Also:
    "Algorithms for Estimating Relative Importance in Graphs by Scott White and Padhraic Smyth, 2003"
    • Field Detail

      • disappearing_potential

        protected HITS.Scores disappearing_potential
        The sum of the potential, at each step, associated with vertices with no outedges (authority) or no inedges (hub).
    • Constructor Detail

      • HITSWithPriors

        public HITSWithPriors​(Hypergraph<V,​E> g,
                              com.google.common.base.Function<E,​? extends java.lang.Number> edge_weights,
                              com.google.common.base.Function<V,​HITS.Scores> vertex_priors,
                              double alpha)
        Creates an instance for the specified graph, edge weights, vertex prior probabilities, and random jump probability (alpha).
        Parameters:
        g - the input graph
        edge_weights - the edge weights
        vertex_priors - the prior probability for each vertex
        alpha - the probability of a random jump at each step
      • HITSWithPriors

        public HITSWithPriors​(Hypergraph<V,​E> g,
                              com.google.common.base.Function<V,​HITS.Scores> vertex_priors,
                              double alpha)
        Creates an instance for the specified graph, vertex priors, and random jump probability (alpha). The edge weights default to 1.0.
        Parameters:
        g - the input graph
        vertex_priors - the prior probability for each vertex
        alpha - the probability of a random jump at each step
    • Method Detail

      • update

        protected double update​(V v)
        Updates the value for this vertex.
        Specified by:
        update in class AbstractIterativeScorer<V,​E,​HITS.Scores>
        Parameters:
        v - the vertex whose value is to be updated
        Returns:
        the updated value
      • normalizeScores

        protected void normalizeScores()
        Normalizes scores so that sum of their squares = 1. This method may be overridden so as to yield different normalizations.
      • collectDisappearingPotential

        protected void collectDisappearingPotential​(V v)
        Collects the "disappearing potential" associated with vertices that have either no incoming edges, no outgoing edges, or both. Vertices that have no incoming edges do not directly contribute to the hub scores of other vertices; similarly, vertices that have no outgoing edges do not directly contribute to the authority scores of other vertices. These values are collected at each step and then distributed across all vertices as a part of the normalization process. (This process is not required for, and does not affect, the 'sum-of-squares'-style normalization.)
        Overrides:
        collectDisappearingPotential in class AbstractIterativeScorer<V,​E,​HITS.Scores>
        Parameters:
        v - the vertex whose potential is being collected