Module org.jgrapht.core
Package org.jgrapht.generate.netgen
Class MaximumFlowProblem.MaximumFlowProblemImpl<V,E>
java.lang.Object
org.jgrapht.generate.netgen.MaximumFlowProblem.MaximumFlowProblemImpl<V,E>
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- All Implemented Interfaces:
MaximumFlowProblem<V,
E>
- Enclosing interface:
- MaximumFlowProblem<V,
E>
public static class MaximumFlowProblem.MaximumFlowProblemImpl<V,E>
extends Object
implements MaximumFlowProblem<V,E>
Default implementation of a Maximum Flow Problem.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapht.generate.netgen.MaximumFlowProblem
MaximumFlowProblem.MaximumFlowProblemImpl<V,
E> -
Field Summary
Fields inherited from interface org.jgrapht.generate.netgen.MaximumFlowProblem
CAPACITY_INF
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jgrapht.generate.netgen.MaximumFlowProblem
dumpCapacities, getSink, getSource, isSingleSourceSingleSinkProblem
-
Constructor Details
-
MaximumFlowProblemImpl
public MaximumFlowProblemImpl(Graph<V, E> graph, Set<V> sources, Set<V> sinks, Function<E, Double> capacities) Constructs a new maximum flow problem.- Parameters:
graph
- flow networksources
- set of network sourcessinks
- set of network sinkscapacities
- network capacity function
-
-
Method Details
-
getGraph
Returns the network the problem is defined on.- Specified by:
getGraph
in interfaceMaximumFlowProblem<V,
E> - Returns:
- the network the problem is defined on.
-
getSources
Returns the source set of this problem.- Specified by:
getSources
in interfaceMaximumFlowProblem<V,
E> - Returns:
- the source set of this problem.
-
getSinks
Returns the sink set of this problem.- Specified by:
getSinks
in interfaceMaximumFlowProblem<V,
E> - Returns:
- the sink set of this problem.
-
getCapacities
Returns the capacity function of this problem. This function is defined for all edges of the underlying network.- Specified by:
getCapacities
in interfaceMaximumFlowProblem<V,
E> - Returns:
- the capacity function of this problem.
-
toSingleSourceSingleSinkProblem
Converts this problem to the canonical form. Resulting problem is equivalent to the previous one.- Specified by:
toSingleSourceSingleSinkProblem
in interfaceMaximumFlowProblem<V,
E> - Returns:
- a problem in the canonical form.
-