Class ComplementaryEmbededness<V>

java.lang.Object
es.uam.eps.ir.relison.sna.metrics.pair.AbstractPairMetric<V>
es.uam.eps.ir.relison.sna.metrics.complementary.pair.ComplementaryEmbededness<V>
Type Parameters:
V - Type of the users in the graph.
All Implemented Interfaces:
PairMetric<V>

public class ComplementaryEmbededness<V>
extends AbstractPairMetric<V>
Computes the embeddedness the edges in the complementary of a graph.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private EdgeOrientation uSel
    Selection of the neighbours of the first node.
    private EdgeOrientation vSel
    Selection of the neighbour of the second node.
  • Constructor Summary

    Constructors 
    Constructor Description
    ComplementaryEmbededness​(EdgeOrientation uSel, EdgeOrientation vSel)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    double averageValue​(Graph<V> graph)
    Computes the average value of the metric
    double averageValue​(Graph<V> graph, java.util.stream.Stream<Pair<V>> edges, int edgeCount)
    Computes the average value of a certain group of pairs.
    java.util.Map<Pair<V>,​java.lang.Double> compute​(Graph<V> graph)
    Computes the value of the metric for all the possible pairs in the graph.
    java.util.Map<Pair<V>,​java.lang.Double> compute​(Graph<V> graph, java.util.stream.Stream<Pair<V>> pairs)
    Computes the value of the metric for a selection of pairs in the graph.
    double compute​(Graph<V> graph, V orig, V dest)
    Computes the value of the metric for a single pair of nodes

    Methods inherited from class es.uam.eps.ir.relison.sna.metrics.pair.AbstractPairMetric

    averageValueOnlyLinks, computeDest, computeOnlyLinks, computeOrig

    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<V> graph, V orig, V dest)
      Description copied from interface: PairMetric
      Computes the value of the metric for a single pair of nodes
      Parameters:
      graph - The full graph.
      orig - The origin node of the edge.
      dest - The destiny node of the edge.
      Returns:
      The value of the metric for that edge.
    • compute

      public java.util.Map<Pair<V>,​java.lang.Double> compute​(Graph<V> graph)
      Description copied from interface: PairMetric
      Computes the value of the metric for all the possible pairs in the graph.
      Specified by:
      compute in interface PairMetric<V>
      Overrides:
      compute in class AbstractPairMetric<V>
      Parameters:
      graph - The full graph.
      Returns:
      A map containing the metrics for each node.
    • compute

      public java.util.Map<Pair<V>,​java.lang.Double> compute​(Graph<V> graph, java.util.stream.Stream<Pair<V>> pairs)
      Description copied from interface: PairMetric
      Computes the value of the metric for a selection of pairs in the graph.
      Specified by:
      compute in interface PairMetric<V>
      Overrides:
      compute in class AbstractPairMetric<V>
      Parameters:
      graph - The full graph.
      pairs - A stream containing the selected pairs.
      Returns:
      A map containing the metrics for each pair in the stream that exists.
    • averageValue

      public double averageValue​(Graph<V> graph)
      Description copied from interface: PairMetric
      Computes the average value of the metric
      Specified by:
      averageValue in interface PairMetric<V>
      Overrides:
      averageValue in class AbstractPairMetric<V>
      Parameters:
      graph - The full graph.
      Returns:
      The average value of the metric
    • averageValue

      public double averageValue​(Graph<V> graph, java.util.stream.Stream<Pair<V>> edges, int edgeCount)
      Description copied from interface: PairMetric
      Computes the average value of a certain group of pairs.
      Specified by:
      averageValue in interface PairMetric<V>
      Overrides:
      averageValue in class AbstractPairMetric<V>
      Parameters:
      graph - the full graph.
      edges - a stream containing the selected pairs.
      edgeCount - the number of pairs in the stream.
      Returns:
      The average value of the metric for those pairs.