Class ModularityComplement<U>

java.lang.Object
es.uam.eps.ir.relison.sna.metrics.communities.graph.ModularityComplement<U>
Type Parameters:
U - The type of the users.
All Implemented Interfaces:
CommunityMetric<U>

public class ModularityComplement<U>
extends java.lang.Object
implements CommunityMetric<U>
Computes the modularity complement of a graph, given the communities.

References:

  1. J. Sanz-Cruzado, P. Castells. Beyond accuracy in link prediction. 3rd Workshop on Social Media for Personalization and Search (SoMePEaS 2019).
  2. J. Sanz-Cruzado, S.M. Pepa, P. Castells. Structural novelty and diversity in link prediction. 0th International Workshop on Modeling Social Media (MSM 2018) at The Web Conference (WWW 2018)
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private Modularity<U> modularity
    Modularity calculator.
  • Constructor Summary

    Constructors 
    Constructor Description
    ModularityComplement()
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    double compute​(Graph<U> graph, Communities<U> comm)
    Computes the value of the metric in the graph.
    private double computeDirected​(DirectedGraph<U> graph, Communities<U> comm, MultiGraph<java.lang.Integer> commGraph)
    Computes the value of the modularity for a directed graph.
    private double computeUndirected​(UndirectedGraph<U> graph, Communities<U> comm, MultiGraph<java.lang.Integer> commGraph)
    Computes the value of the modularity for an undirected graph.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • compute

      public double compute​(Graph<U> graph, Communities<U> comm)
      Description copied from interface: CommunityMetric
      Computes the value of the metric in the graph.
      Specified by:
      compute in interface CommunityMetric<U>
      Parameters:
      graph - Graph.
      comm - Communities of the graph.
      Returns:
      the value of the metric.
    • computeDirected

      private double computeDirected​(DirectedGraph<U> graph, Communities<U> comm, MultiGraph<java.lang.Integer> commGraph)
      Computes the value of the modularity for a directed graph.
      Parameters:
      graph - The directed graph.
      comm - The communities.
      commGraph - The community graph.
      Returns:
      The value of the modularity.
    • computeUndirected

      private double computeUndirected​(UndirectedGraph<U> graph, Communities<U> comm, MultiGraph<java.lang.Integer> commGraph)
      Computes the value of the modularity for an undirected graph.
      Parameters:
      graph - The undirected graph.
      comm - The communities.
      commGraph - The community graph.
      Returns:
      The value of the modularity of the graph.