Interface DistanceCalculator<U>

Type Parameters:
U - type of the users.
All Known Implementing Classes:
CompleteDistanceCalculator, FastDistanceCalculator

public interface DistanceCalculator<U>
Interface that defines methods for computing distance-based metrics for a network and retrieving them.
  • Method Summary

    Modifier and Type Method Description
    boolean computeDistances​(Graph<U> graph)
    Computes the distances between nodes in a network.
    double getASL()
    Obtains the average shortest path length, averaged over all the finite distance paths.
    java.util.Map<U,​java.util.Map<U,​java.lang.Double>> getDistances()
    Returns all the distances between different pairs.
    double getDistances​(U orig, U dest)
    Returns the distance between two nodes.
    java.util.Map<U,​java.lang.Double> getDistancesFrom​(U node)
    Return the distances between a node and the rest of nodes in the network.
    java.util.Map<U,​java.lang.Double> getDistancesTo​(U node)
    Returns the distance between the network and an specific node.
    java.util.Map<U,​java.util.Map<U,​java.lang.Double>> getEdgeBetweenness()
    Gets all the values of the edge betweenness.
    java.util.Map<U,​java.lang.Double> getEdgeBetweenness​(U node)
    Returns the edge betweenness of all the adjacent edges to a given node.
    double getEdgeBetweenness​(U orig, U dest)
    Returns the edge betweenness of a single edge.
    java.util.Map<U,​java.util.Map<U,​java.lang.Double>> getGeodesics()
    Returns the number of geodesic paths between different pairs.
    java.util.Map<U,​java.lang.Double> getGeodesics​(U node)
    Return the number of geodesic paths between a node and the rest of nodes in the network.
    double getGeodesics​(U orig, U dest)
    Returns the number of geodesic paths between two nodes.
    double getInfiniteDistances()
    Obtains the number of infinite length pairs.
    java.util.Map<U,​java.lang.Double> getNodeBetweenness()
    Returns the node betweenness for each node in the network.
    double getNodeBetweenness​(U node)
    Gets the value of node betweenness for a single node.
    Communities<U> getSCC()
    Obtains the strongly connected components of the graph.
  • Method Details

    • computeDistances

      boolean computeDistances​(Graph<U> graph)
      Computes the distances between nodes in a network.
      Parameters:
      graph - the graph.
      Returns:
      true if everything went OK, false otherwise.
    • getNodeBetweenness

      java.util.Map<U,​java.lang.Double> getNodeBetweenness()
      Returns the node betweenness for each node in the network.
      Returns:
      a map containing the node betweenness for each node.
    • getNodeBetweenness

      double getNodeBetweenness​(U node)
      Gets the value of node betweenness for a single node.
      Parameters:
      node - the value for the node.
      Returns:
      the node betweenness for that node.
    • getEdgeBetweenness

      java.util.Map<U,​java.util.Map<U,​java.lang.Double>> getEdgeBetweenness()
      Gets all the values of the edge betweenness.
      Returns:
      the edge betweenness value for each edge.
    • getEdgeBetweenness

      java.util.Map<U,​java.lang.Double> getEdgeBetweenness​(U node)
      Returns the edge betweenness of all the adjacent edges to a given node.
      Parameters:
      node - The node.
      Returns:
      a map containing the values of edge betweenness for all the adjacent links to the given node.
    • getEdgeBetweenness

      double getEdgeBetweenness​(U orig, U dest)
      Returns the edge betweenness of a single edge.
      Parameters:
      orig - origin node of the edge.
      dest - destination node of the edge.
      Returns:
      the betweenness if the edge exists, -1.0 if not.
    • getDistances

      java.util.Map<U,​java.util.Map<U,​java.lang.Double>> getDistances()
      Returns all the distances between different pairs.
      Returns:
      the distances between pairs.
    • getDistancesFrom

      java.util.Map<U,​java.lang.Double> getDistancesFrom​(U node)
      Return the distances between a node and the rest of nodes in the network.
      Parameters:
      node - the node.
      Returns:
      a map containing all the distances from the node to the rest of the network.
    • getDistancesTo

      java.util.Map<U,​java.lang.Double> getDistancesTo​(U node)
      Returns the distance between the network and an specific node.
      Parameters:
      node - the node.
      Returns:
      a map containing all the distances from each vertex in the network to the node.
    • getDistances

      double getDistances​(U orig, U dest)
      Returns the distance between two nodes.
      Parameters:
      orig - origin node.
      dest - destination node.
      Returns:
      the distance between both nodes. if there is a path between them, +Infinity if not.
    • getGeodesics

      java.util.Map<U,​java.util.Map<U,​java.lang.Double>> getGeodesics()
      Returns the number of geodesic paths between different pairs.
      Returns:
      the distances between pairs.
    • getGeodesics

      java.util.Map<U,​java.lang.Double> getGeodesics​(U node)
      Return the number of geodesic paths between a node and the rest of nodes in the network.
      Parameters:
      node - the node.
      Returns:
      a map containing the number of geodesic paths from the node to the rest of the network.
    • getGeodesics

      double getGeodesics​(U orig, U dest)
      Returns the number of geodesic paths between two nodes.
      Parameters:
      orig - origin node.
      dest - destination node.
      Returns:
      the number of geodesic paths between both nodes if there is a path between them, 0.0 if not.
    • getSCC

      Communities<U> getSCC()
      Obtains the strongly connected components of the graph.
      Returns:
      the strongly connected components of the graph.
    • getASL

      double getASL()
      Obtains the average shortest path length, averaged over all the finite distance paths.
      Returns:
      the average shortest path length.
    • getInfiniteDistances

      double getInfiniteDistances()
      Obtains the number of infinite length pairs.
      Returns:
      the number of infinite length pairs.