Package com.jgalgo.alg.cycle
Class MinimumMeanCycleAbstract
java.lang.Object
com.jgalgo.alg.cycle.MinimumMeanCycleAbstract
- All Implemented Interfaces:
MinimumMeanCycle
- Direct Known Subclasses:
MinimumMeanCycleDasdanGupta
,MinimumMeanCycleHoward
Abstract class for computing the cycle with minimum mean weight in a graph.
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<V,
E> Path <V, E> computeMinimumMeanCycle
(Graph<V, E> g, WeightFunction<E> w) Compute the minimum mean cycle in a graph.
-
Constructor Details
-
MinimumMeanCycleAbstract
public MinimumMeanCycleAbstract()Default constructor.
-
-
Method Details
-
computeMinimumMeanCycle
Description copied from interface:MinimumMeanCycle
Compute the minimum mean cycle in a graph.If
g
is anIntGraph
, aIPath
object will be returned. In that case, its better to pass aIWeightFunction
asw
to avoid boxing/unboxing.- Specified by:
computeMinimumMeanCycle
in interfaceMinimumMeanCycle
- Type Parameters:
V
- the vertices typeE
- the edges type- Parameters:
g
- a graphw
- an edge weight function- Returns:
- the cycle with the minimum mean weight in the graph, or
null
if no cycles were found
-