Class TreeMeasurer<V,​E>

java.lang.Object
org.jgrapht.alg.shortestpath.TreeMeasurer<V,​E>
Type Parameters:
V - the graph vertex type
E - the graph edge type

public class TreeMeasurer<V,​E>
extends java.lang.Object
Algorithm class which computes a number of distance related metrics for trees.
Author:
Alexandru Valeanu
  • Constructor Summary

    Constructors 
    Constructor Description
    TreeMeasurer​(Graph<V,​E> graph)
    Constructs a new instance of TreeMeasurer.
  • Method Summary

    Modifier and Type Method Description
    java.util.Set<V> getGraphCenter()
    Compute the graph center.

    Methods inherited from class java.lang.Object

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

    • TreeMeasurer

      public TreeMeasurer​(Graph<V,​E> graph)
      Constructs a new instance of TreeMeasurer.
      Parameters:
      graph - input graph
      Throws:
      java.lang.NullPointerException - if graph is null
  • Method Details

    • getGraphCenter

      public java.util.Set<V> getGraphCenter()
      Compute the graph center. The center of a graph is the set of vertices of graph eccentricity equal to the graph radius.

      Note: The input graph must be undirected.

      Returns:
      the graph center
      Throws:
      java.lang.IllegalArgumentException - if graph is not undirected