Package com.jgalgo.alg.span
Class SteinerTreeAlgoAbstract
java.lang.Object
com.jgalgo.alg.span.SteinerTreeAlgoAbstract
- All Implemented Interfaces:
SteinerTreeAlgo
- Direct Known Subclasses:
SteinerTreeMehlhorn
Abstract class for computing Steiner trees in graphs.
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.span.SteinerTreeAlgo
SteinerTreeAlgo.IResult, SteinerTreeAlgo.Result<V,
E> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<V,
E> SteinerTreeAlgo.Result <V, E> computeSteinerTree
(Graph<V, E> g, WeightFunction<E> w, Collection<V> terminals) Compute the minimum Steiner tree of a given graph.
-
Constructor Details
-
SteinerTreeAlgoAbstract
public SteinerTreeAlgoAbstract()Default constructor.
-
-
Method Details
-
computeSteinerTree
public <V,E> SteinerTreeAlgo.Result<V,E> computeSteinerTree(Graph<V, E> g, WeightFunction<E> w, Collection<V> terminals) Description copied from interface:SteinerTreeAlgo
Compute the minimum Steiner tree of a given graph.The algorithm with search for the minimum Steiner tree that spans all the terminals with respect to the given edge weight function. The tree may contain additional vertices that are not terminals.
If
g
is anIntGraph
, aSteinerTreeAlgo.IResult
object will be returned. In that case, its better to pass aIWeightFunction
asw
, andIntCollection
asterminals
to avoid boxing/unboxing.- Specified by:
computeSteinerTree
in interfaceSteinerTreeAlgo
- Type Parameters:
V
- the vertices typeE
- the edges type- Parameters:
g
- a graphw
- an edge weight functionterminals
- a set of terminals vertices- Returns:
- a result object containing all the edges of the computed tree
-