-
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- All Known Subinterfaces:
MaximumFlowAlgorithm<V,E>
,MinimumCostFlowAlgorithm<V,E>
- All Known Implementing Classes:
BoykovKolmogorovMFImpl
,CapacityScalingMinimumCostFlow
,DinicMFImpl
,EdmondsKarpMFImpl
,GusfieldEquivalentFlowTree
,GusfieldGomoryHuCutTree
,MaximumFlowAlgorithmBase
,PushRelabelMFImpl
public interface FlowAlgorithm<V,E>
Interface for flow algorithms- Author:
- Joris Kinable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
FlowAlgorithm.Flow<E>
Represents a flow.static class
FlowAlgorithm.FlowImpl<E>
Default implementation ofFlowAlgorithm.Flow
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default FlowAlgorithm.Flow<E>
getFlow()
Result object of a flow algorithmV
getFlowDirection(E edge)
For the specifiededge
$(u, v)$ returns vertex $v$ if the flow goes from $u$ to $v$, or returns vertex $u$ otherwise.Map<E,Double>
getFlowMap()
Returns a read-only mapping from edges to the corresponding flow values.
-
-
-
Method Detail
-
getFlow
default FlowAlgorithm.Flow<E> getFlow()
Result object of a flow algorithm- Returns:
- flow
-
getFlowMap
Map<E,Double> getFlowMap()
Returns a read-only mapping from edges to the corresponding flow values.- Returns:
- a read-only mapping from edges to the corresponding flow values.
-
getFlowDirection
V getFlowDirection(E edge)
For the specifiededge
$(u, v)$ returns vertex $v$ if the flow goes from $u$ to $v$, or returns vertex $u$ otherwise. For directed flow networks the result is always the head of the specified arc.Note: not all flow algorithms may support undirected graphs.
- Parameters:
edge
- an edge from the specified flow network- Returns:
- the direction of the flow on the
edge
-
-