Package com.jgalgo.alg.tree
Interface TreePathMaxima.Result<V,E>
- Type Parameters:
V- the vertices typeE- the edges type
- All Known Subinterfaces:
TreePathMaxima.IResult
- Enclosing interface:
TreePathMaxima
public static interface TreePathMaxima.Result<V,E>
A result object for
TreePathMaxima algorithm.- Author:
- Barak Ugav
-
Method Summary
Modifier and TypeMethodDescriptiongetHeaviestEdge(int queryIdx) Get the heaviest edge found for a single query.intsize()Get the number queries results this result object hold.
-
Method Details
-
getHeaviestEdge
Get the heaviest edge found for a single query.This result object was obtained by calling
TreePathMaxima.computeHeaviestEdgeInTreePaths(Graph, WeightFunction, Queries), which accept a set of multiple queries using theTreePathMaxima.IQueriesobject. This method return the answer to a single queries among them, by its index.- Parameters:
queryIdx- the index of the query \((u, v)\) in theTreePathMaxima.IQueriesobject passed toTreePathMaxima.computeHeaviestEdgeInTreePaths(Graph, WeightFunction, Queries)- Returns:
- the edge identifier of the heaviest on the path from \(u\) to \(v\) (the query vertices) in
the tree passed to the algorithm, or
-1if no such path exists
-
size
int size()Get the number queries results this result object hold.This number always much the size of the
TreePathMaxima.IQueriescontainer passed to theTreePathMaximaalgorithm.- Returns:
- the number queries results this result object hold
-