Interface FlowNetwork.Int
-
- All Superinterfaces:
FlowNetwork
- Enclosing interface:
- FlowNetwork
public static interface FlowNetwork.Int extends FlowNetwork
Flow on graph edges, with integer capacities and flows values.Similar to the regular
FlowNetworkinterface, but with integer capacities and flows. Some algorithms that work on flow networks are specifically for integers networks, or may performed faster if the capacities and flows are integers.- Author:
- Barak Ugav
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jgalgo.FlowNetwork
FlowNetwork.Int
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description static FlowNetwork.IntcreateAsEdgeWeight(Graph g)Create an integer flow network by adding edge weights usingGraph.addEdgesWeights(java.lang.Object, java.lang.Class<? super E>).default doublegetCapacity(int edge)Deprecated.intgetCapacityInt(int edge)Get the integer capacity of an edge.default doublegetFlow(int edge)Deprecated.intgetFlowInt(int edge)Get the integer amount of flow units going along an edge.default voidsetCapacity(int edge, double capacity)Deprecated.voidsetCapacity(int edge, int capacity)Set the integer capacity of an edge.default voidsetFlow(int edge, double flow)Deprecated.voidsetFlow(int edge, int flow)Set the integer amount of flow units going along an edge.
-
-
-
Method Detail
-
getCapacityInt
int getCapacityInt(int edge)
Get the integer capacity of an edge.- Parameters:
edge- an edge identifier in the graph- Returns:
- the capacity of the edge
- Throws:
IndexOutOfBoundsException- ifedgeis not a valid edge identifier
-
getCapacity
@Deprecated default double getCapacity(int edge)
Deprecated.Description copied from interface:FlowNetworkGet the capacity of an edge.- Specified by:
getCapacityin interfaceFlowNetwork- Parameters:
edge- an edge identifier in the graph- Returns:
- the capacity of the edge
-
setCapacity
void setCapacity(int edge, int capacity)Set the integer capacity of an edge.- Parameters:
edge- an edge identifier in the graphcapacity- the new capacity of the edge- Throws:
IndexOutOfBoundsException- ifedgeis not a valid edge identifierIllegalArgumentException- ifcapacityis negative
-
setCapacity
@Deprecated default void setCapacity(int edge, double capacity)
Deprecated.Description copied from interface:FlowNetworkSet the capacity of an edge.- Specified by:
setCapacityin interfaceFlowNetwork- Parameters:
edge- an edge identifier in the graphcapacity- the new capacity of the edge
-
getFlowInt
int getFlowInt(int edge)
Get the integer 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 < 0\), means a flow of \(|-f|\) units of flow fromedgeTarget(e)toedgeSource(e)(opposite direction).- Parameters:
edge- an edge identifier in the graph- Returns:
- the amount of flow units going along an edge
- Throws:
IndexOutOfBoundsException- ifedgeis not a valid edge identifier
-
getFlow
@Deprecated default double getFlow(int edge)
Deprecated.Description copied from interface:FlowNetworkGet 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 < 0\), means a flow of \(|-f|\) units of flow fromedgeTarget(e)toedgeSource(e)(opposite direction).- Specified by:
getFlowin interfaceFlowNetwork- Parameters:
edge- an edge identifier in the graph- Returns:
- the amount of flow units going along an edge
-
setFlow
void setFlow(int edge, int flow)Set the integer amount of flow units going along an edge.- Parameters:
edge- an edge identifier in the graphflow- the new flow of the edge- Throws:
IndexOutOfBoundsException- ifedgeis not a valid edge identifier
-
setFlow
@Deprecated default void setFlow(int edge, double flow)
Deprecated.Description copied from interface:FlowNetworkSet the amount of flow units going along an edge.- Specified by:
setFlowin interfaceFlowNetwork- Parameters:
edge- an edge identifier in the graphflow- the new flow of the edge
-
createAsEdgeWeight
static FlowNetwork.Int createAsEdgeWeight(Graph g)
Create an integer flow network by adding edge weights usingGraph.addEdgesWeights(java.lang.Object, java.lang.Class<? super E>).Unless
setCapacity(int, int)orsetFlow(int, int)are used, the capacity and flow of each edge will be zero.- Parameters:
g- a graph- Returns:
- a flow network implemented as edge weights
-
-