- 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
Modifier and TypeInterfaceDescriptionstatic interface
A maximum flowstatic class
Default 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 fromsource
tosink
.default double
getMaximumFlowValue
(V source, V sink) Sets current source tosource
, current sink tosink
, then calculates maximum flow fromsource
tosink
.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 fromsource
tosink
. 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 fromsource
tosink
. Note, thatsource
andsink
must be vertices of thenetwork
passed to the constructor, and they must be different.- Parameters:
source
- source vertexsink
- sink vertex- Returns:
- the value of the maximum flow
-