org.jgrapht.alg
Class TarjanLowestCommonAncestor<V,E>

java.lang.Object
  extended by org.jgrapht.alg.TarjanLowestCommonAncestor<V,E>

public class TarjanLowestCommonAncestor<V,E>
extends Object

Used to calculate Tarjan's Lowest Common Ancestors Algorithm

Author:
Leo Crawford

Nested Class Summary
static class TarjanLowestCommonAncestor.LcaRequestResponse<V>
           
 
Method Summary
 List<V> calculate(V start, List<TarjanLowestCommonAncestor.LcaRequestResponse<V>> lrr)
          Calculate the LCMs between a set of pairs (a and b) treating start as the root we want to search from, and setting the LCA of each pair in its LCA field
 V calculate(V start, V a, V b)
          Calculate the LCM between a and b treating start as the root we want to search from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

calculate

public V calculate(V start,
                   V a,
                   V b)
Calculate the LCM between a and b treating start as the root we want to search from.


calculate

public List<V> calculate(V start,
                         List<TarjanLowestCommonAncestor.LcaRequestResponse<V>> lrr)
Calculate the LCMs between a set of pairs (a and b) treating start as the root we want to search from, and setting the LCA of each pair in its LCA field



Copyright © 2013. All rights reserved.