Interface LowestCommonAncestorAlgorithm<V>
- Type Parameters:
V- vertex the graph vertex type
- All Known Implementing Classes:
BinaryLiftingLCAFinder, EulerTourRMQLCAFinder, HeavyPathLCAFinder, NaiveLCAFinder, TarjanLCAFinder
public interface LowestCommonAncestorAlgorithm<V>
Algorithm to compute a lowest
common ancestor in a tree, forest or DAG.
-
Method Summary
Modifier and TypeMethodDescriptiongetBatchLCA(List<Pair<V, V>> queries) Return a list of LCAs for a batch of queriesgetBatchLCASet(List<Pair<V, V>> queries) Return a list of computed sets of LCAs for a batch of queriesReturn the LCA of a and bReturn the computed set of LCAs of a and b
-
Method Details
-
getLCA
-
getBatchLCA
-
getLCASet
Return the computed set of LCAs of a and b- Parameters:
a- the first element to find LCA forb- the other element to find the LCA for- Returns:
- the set LCAs of a and b, or empty set if there is no LCA computed.
- Throws:
UnsupportedOperationException- - if the operation is not supported by the implementing class
-
getBatchLCASet
-