Interface VertexMetric<U>

Type Parameters:
U - type of the users
All Known Implementing Classes:
Closeness, ComplementaryDegree, ComplementaryInverseDegree, ComplementaryLocalClusteringCoefficient, ComplementaryPageRank, ComplementaryVertexMetric, Coreness, Degree, Distance2Degree, Eccentricity, EigenvectorCentrality, FreeDiscovery, HarmonicCentrality, HITS, InverseDegree, KatzCentrality, LocalClusteringCoefficient, LocalReciprocityRate, MatrixBasedVertexMetric, NodeBetweenness, PageRank, VertexLength

public interface VertexMetric<U>
Interface for user related metrics of graphs.
  • Method Summary

    Modifier and Type Method Description
    default double averageValue​(Graph<U> graph)
    Computes the average value of the metric in the graph.
    default double averageValue​(Graph<U> graph, java.util.stream.Stream<U> users)
    Computes the average value of the metric for a set of users.
    default java.util.Map<U,​java.lang.Double> compute​(Graph<U> graph)
    Computes the value of the metric for all the users in the graph.
    default 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.
    double compute​(Graph<U> graph, U user)
    Computes the value of the metric for a single user.
  • Method Details

    • compute

      double compute​(Graph<U> graph, U user)
      Computes the value of the metric for a single user.
      Parameters:
      graph - The graph.
      user - The user to compute.
      Returns:
      the value of the metric.
    • compute

      default java.util.Map<U,​java.lang.Double> compute​(Graph<U> graph)
      Computes the value of the metric for all the users in the graph.
      Parameters:
      graph - The graph.
      Returns:
      A map relating the users with the values of the metric.
    • compute

      default 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.
      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

      default double averageValue​(Graph<U> graph)
      Computes the average value of the metric in the graph.
      Parameters:
      graph - The graph.
      Returns:
      the average value of the metric.
    • averageValue

      default double averageValue​(Graph<U> graph, java.util.stream.Stream<U> users)
      Computes the average value of the metric for a set of users.
      Parameters:
      graph - The graph.
      users - A stream of users.
      Returns:
      the average value of the metric for those users.