Package com.jgalgo
Interface TreePathMaxima.Queries
-
- Enclosing interface:
- TreePathMaxima
public static interface TreePathMaxima.Queries
Queries container forTreePathMaxima
computations.Queries are added one by one to this container, and than the Queries object is passed to a
TreePathMaxima
algorithm usingTreePathMaxima.computeHeaviestEdgeInTreePaths(Graph, WeightFunction, Queries)
.- Author:
- Barak Ugav
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addQuery(int u, int v)
Add a query for the heaviest edge in a tree between two vertices.void
clear()
Clear the container from all existing queries.IntIntPair
getQuery(int idx)
Get a query by index.static TreePathMaxima.Queries
newInstance()
Create an empty queries container.int
size()
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 < 0
oridx >= 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.
-
-