Class UniformInOut<V,E>

java.lang.Object
edu.uci.ics.jung.algorithms.scoring.util.UniformInOut<V,E>
All Implemented Interfaces:
com.google.common.base.Function<VEPair<V,E>,Double>, Function<VEPair<V,E>,Double>

public class UniformInOut<V,E> extends Object implements com.google.common.base.Function<VEPair<V,E>,Double>
Assigns weights to directed edges (the edge of the vertex/edge pair) depending on whether the vertex is the edge's source or its destination. If the vertex v is the edge's source, assigns 1/outdegree(v). Otherwise, assigns 1/indegree(w). Throws IllegalArgumentException if the edge is not directed.
  • Field Details

    • graph

      protected Graph<V,E> graph
      The graph for which the edge weights are defined.
  • Constructor Details

    • UniformInOut

      public UniformInOut(Graph<V,E> graph)
      Creates an instance for the specified graph.
      Parameters:
      graph - the graph for which the edge weights will be defined
  • Method Details

    • apply

      public Double apply(VEPair<V,E> ve_pair)
      Specified by:
      apply in interface com.google.common.base.Function<V,E>
      Specified by:
      apply in interface Function<V,E>