Class MaximumFlowProblem.MaximumFlowProblemImpl<V,​E>

  • Type Parameters:
    V - the graph vertex type
    E - 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.
    • Constructor Detail

      • 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 network
        sources - set of network sources
        sinks - set of network sinks
        capacities - network capacity function
    • Method Detail

      • getGraph

        public Graph<V,​E> getGraph()
        Returns the network the problem is defined on.
        Specified by:
        getGraph in interface MaximumFlowProblem<V,​E>
        Returns:
        the network the problem is defined on.
      • getSources

        public Set<V> getSources()
        Returns the source set of this problem.
        Specified by:
        getSources in interface MaximumFlowProblem<V,​E>
        Returns:
        the source set of this problem.
      • getSinks

        public Set<V> getSinks()
        Returns the sink set of this problem.
        Specified by:
        getSinks in interface MaximumFlowProblem<V,​E>
        Returns:
        the sink set of this problem.
      • getCapacities

        public Function<E,​Double> getCapacities()
        Returns the capacity function of this problem. This function is defined for all edges of the underlying network.
        Specified by:
        getCapacities in interface MaximumFlowProblem<V,​E>
        Returns:
        the capacity function of this problem.