- Type Parameters:
V- the graph vertex typeE- the graph edge type
- All Superinterfaces:
FlowAlgorithm<V,E>
- All Known Implementing Classes:
BoykovKolmogorovMFImpl,DinicMFImpl,EdmondsKarpMFImpl,GusfieldEquivalentFlowTree,GusfieldGomoryHuCutTree,MaximumFlowAlgorithmBase,PushRelabelMFImpl
Allows to derive maximum-flow
from the supplied flow network
- Author:
- Alexey Kudinkin, Joris Kinable
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA maximum flowstatic classDefault implementation of the maximum flowNested classes/interfaces inherited from interface org.jgrapht.alg.interfaces.FlowAlgorithm
FlowAlgorithm.Flow<E>, FlowAlgorithm.FlowImpl<E> -
Method Summary
Modifier and TypeMethodDescriptiongetMaximumFlow(V source, V sink) Sets current source tosource, current sink tosink, then calculates maximum flow fromsourcetosink.default doublegetMaximumFlowValue(V source, V sink) Sets current source tosource, current sink tosink, then calculates maximum flow fromsourcetosink.Methods inherited from interface org.jgrapht.alg.interfaces.FlowAlgorithm
getFlow, getFlowDirection, getFlowMap
-
Method Details
-
getMaximumFlow
Sets current source tosource, current sink tosink, then calculates maximum flow fromsourcetosink. Returns an object containing detailed information about the flow.- Parameters:
source- source of the flow inside the networksink- sink of the flow inside the network- Returns:
- maximum flow
-
getMaximumFlowValue
Sets current source tosource, current sink tosink, then calculates maximum flow fromsourcetosink. Note, thatsourceandsinkmust be vertices of thenetworkpassed to the constructor, and they must be different.- Parameters:
source- source vertexsink- sink vertex- Returns:
- the value of the maximum flow
-