Package com.jgalgo.alg.tree
Class TreePathMaximaAbstract
- java.lang.Object
-
- com.jgalgo.alg.tree.TreePathMaximaAbstract
-
- All Implemented Interfaces:
TreePathMaxima
- Direct Known Subclasses:
TreePathMaximaHagerup
public abstract class TreePathMaximaAbstract extends Object implements TreePathMaxima
Abstract class for TPM computations.The class implements the interface by solving the problem on the index graph and then maps the results back to the original graph. The implementation for index graphs is abstract and left to the subclasses.
- Author:
- Barak Ugav
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jgalgo.alg.tree.TreePathMaxima
TreePathMaxima.IQueries, TreePathMaxima.IResult, TreePathMaxima.Queries<V,E>, TreePathMaxima.Result<V,E>
-
-
Constructor Summary
Constructors Constructor Description TreePathMaximaAbstract()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V,E>
TreePathMaxima.Result<V,E>computeHeaviestEdgeInTreePaths(Graph<V,E> tree, WeightFunction<E> w, TreePathMaxima.Queries<V,E> queries)
Compute the heaviest edge in multiple tree paths.
-
-
-
Method Detail
-
computeHeaviestEdgeInTreePaths
public <V,E> TreePathMaxima.Result<V,E> computeHeaviestEdgeInTreePaths(Graph<V,E> tree, WeightFunction<E> w, TreePathMaxima.Queries<V,E> queries)
Description copied from interface:TreePathMaxima
Compute the heaviest edge in multiple tree paths.The
queries
container contains pairs of vertices, each corresponding to a simple path in the giventree
. For each of these paths, the heaviest edge in the path will be computed.If
g
is anIntGraph
, aTreePathMaxima.IResult
object is returned. In that case, its better to pass aIWeightFunction
asw
, andTreePathMaxima.IQueries
asqueries
to avoid boxing/unboxing.- Specified by:
computeHeaviestEdgeInTreePaths
in interfaceTreePathMaxima
- Type Parameters:
V
- the vertices typeE
- the edges type- Parameters:
tree
- a treew
- an edge weight functionqueries
- a sequence of queries as pairs of vertices, each corresponding to a unique simple path in the tree.- Returns:
- a result object, with a corresponding result edge for each query
-
-