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 MaximumFlowProblem
MaximumFlowProblem.MaximumFlowProblemImpl<V,E> -
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from interface MaximumFlowProblem
CAPACITY_INF -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a new super vertex and connects it to all vertices invertices.Returns the capacity function of this problem.getGraph()Returns the network the problem is defined on.getSinks()Returns the sink set of this problem.Returns the source set of this problem.Converts this problem to the canonical form.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MaximumFlowProblem
dumpCapacities, getSink, getSource, isSingleSourceSingleSinkProblem
-
Field Details
-
graph
-
sources
-
sinks
-
capacities
-
-
Constructor Details
-
MaximumFlowProblemImpl
-
-
Method Details
-
getGraph
-
getSources
Returns the source set of this problem.- Specified by:
getSourcesin interfaceMaximumFlowProblem<V,E> - Returns:
- the source set of this problem.
-
getSinks
-
getCapacities
Returns the capacity function of this problem. This function is defined for all edges of the underlying network.- Specified by:
getCapacitiesin 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:
toSingleSourceSingleSinkProblemin interfaceMaximumFlowProblem<V,E> - Returns:
- a problem in the canonical form.
-
convert
Adds a new super vertex and connects it to all vertices invertices. Depending on the value ofsources, the edges are directed from super vertex or to super vertex. New edges are added tonewEdges.- Parameters:
vertices- set of vertices to connect super vertex tonewEdges- container to add new edges tosources-trueif super vertex is super source,falseif it's super sink- Returns:
- 1 element set containing the super vertex
-