Package com.jgalgo
Interface TreePathMaxima.Queries
-
- Enclosing interface:
- TreePathMaxima
public static interface TreePathMaxima.QueriesQueries container forTreePathMaximacomputations.Queries are added one by one to this container, and than the Queries object is passed to a
TreePathMaximaalgorithm usingTreePathMaxima.computeHeaviestEdgeInTreePaths(Graph, WeightFunction, Queries).- Author:
- Barak Ugav
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddQuery(int u, int v)Add a query for the heaviest edge in a tree between two vertices.voidclear()Clear the container from all existing queries.IntIntPairgetQuery(int idx)Get a query by index.static TreePathMaxima.QueriesnewInstance()Create an empty queries container.intsize()Get the number of queries in this container.
-
-
-
Method Detail
-
newInstance
static TreePathMaxima.Queries newInstance()
Create an empty queries container.- Returns:
- a new queries container
-
addQuery
void addQuery(int u, int v)Add a query for the heaviest edge in a tree between two vertices.- Parameters:
u- the first vertexv- the second vertex
-
getQuery
IntIntPair getQuery(int idx)
Get a query by index.- Parameters:
idx- index of the query. Must be in range[0, size())- Returns:
- pair with the two vertices of the query
- Throws:
IndexOutOfBoundsException- ifidx < 0oridx >= size()
-
size
int size()
Get the number of queries in this container.- Returns:
- the number of queries in this container
-
clear
void clear()
Clear the container from all existing queries.
-
-