Interface IFlow
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description double
getFlow(int edge)
Get the amount of flow units going along an edge.default double
getFlow(Integer edge)
Deprecated.Please usegetFlow(int)
instead to avoid un/boxing.double
getSupply(int vertex)
Get the sum of flow units going out of a vertex, minus the sum of flow units going into a vertex.default double
getSupply(Integer vertex)
Deprecated.Please usegetSupply(int)
instead to avoid un/boxing.-
Methods inherited from interface com.jgalgo.alg.flow.Flow
getSupplySubset, getTotalCost
-
-
-
-
Method Detail
-
getFlow
double getFlow(int edge)
Get the amount of flow units going along an edge.If the graph is directed, a flow of \(f\) units on
e
, for \(0 \leq f \leq cap(e)\), means a flow of \(f\) units of flow fromedgeSource(e)
toedgeTarget(e)
.If the graph is undirected, a flow of \(+f\) units on
e
, for \(0 \leq f \leq cap(e)\), means a flow of \(f\) units of flow fromedgeSource(e)
toedgeTarget(e)
, while a flow of \(-f\) units one
, for \(-cap(e) \leq -f \leq 0\), means a flow of \(|-f|\) units of flow fromedgeTarget(e)
toedgeSource(e)
(opposite direction).- Parameters:
edge
- an edge in the graph- Returns:
- the amount of flow units going along an edge
- Throws:
NoSuchEdgeException
- ifedge
is not a valid edge
-
getFlow
@Deprecated default double getFlow(Integer edge)
Deprecated.Please usegetFlow(int)
instead to avoid un/boxing.Get the amount of flow units going along an edge.If the graph is directed, a flow of \(f\) units on
e
, for \(0 \leq f \leq cap(e)\), means a flow of \(f\) units of flow fromedgeSource(e)
toedgeTarget(e)
.If the graph is undirected, a flow of \(+f\) units on
e
, for \(0 \leq f \leq cap(e)\), means a flow of \(f\) units of flow fromedgeSource(e)
toedgeTarget(e)
, while a flow of \(-f\) units one
, for \(-cap(e) \leq -f \leq 0\), means a flow of \(|-f|\) units of flow fromedgeTarget(e)
toedgeSource(e)
(opposite direction).
-
getSupply
double getSupply(int vertex)
Get the sum of flow units going out of a vertex, minus the sum of flow units going into a vertex.In the classical maximum flow problem with two terminal nodes
s
andt
, the supply ofs
is the total amount of flow in the network, and it is equal to the negative of the supply oft
. The negative of the supply is sometimes called the demand. For any other vertex, the supply is zero.- Parameters:
vertex
- a vertex in the graph- Returns:
- the sum of flow units going out of a vertex, minus the sum of flow units going into a vertex
-
getSupply
@Deprecated default double getSupply(Integer vertex)
Deprecated.Please usegetSupply(int)
instead to avoid un/boxing.Get the sum of flow units going out of a vertex, minus the sum of flow units going into a vertex.In the classical maximum flow problem with two terminal nodes
s
andt
, the supply ofs
is the total amount of flow in the network, and it is equal to the negative of the supply oft
. The negative of the supply is sometimes called the demand. For any other vertex, the supply is zero.
-
-