Package com.jgalgo.alg.cycle
Class MinimumMeanCycleAbstract
- java.lang.Object
-
- com.jgalgo.alg.cycle.MinimumMeanCycleAbstract
-
- All Implemented Interfaces:
MinimumMeanCycle
- Direct Known Subclasses:
MinimumMeanCycleDasdanGupta
,MinimumMeanCycleHoward
public abstract class MinimumMeanCycleAbstract extends Object implements MinimumMeanCycle
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
Constructors Constructor Description MinimumMeanCycleAbstract()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V,E>
Path<V,E>computeMinimumMeanCycle(Graph<V,E> g, WeightFunction<E> w)
Compute the minimum mean cycle in a graph.
-
-
-
Method Detail
-
computeMinimumMeanCycle
public <V,E> Path<V,E> computeMinimumMeanCycle(Graph<V,E> g, WeightFunction<E> w)
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
-
-