Interface IFlow
- Author:
- Barak Ugav
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getFlow
(int edge) Get the amount of flow units going along an edge.default double
Deprecated.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
Deprecated.Please usegetSupply(int)
instead to avoid un/boxing.Methods inherited from interface com.jgalgo.alg.flow.Flow
getSupplySubset, getTotalCost
-
Method Details
-
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.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.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.
-
getFlow(int)
instead to avoid un/boxing.