Interface MaximumFlowAlgorithm<V,​E>

    • Method Detail

      • buildMaximumFlow

        @Deprecated
        default MaximumFlowAlgorithm.MaximumFlow<E> buildMaximumFlow​(V source,
                                                                     V sink)
        Deprecated.
        Sets current source to source, current sink to sink, then calculates maximum flow from source to sink. Returns an object containing detailed information about the flow.
        Parameters:
        source - source of the flow inside the network
        sink - sink of the flow inside the network
        Returns:
        maximum flow
      • getMaximumFlow

        MaximumFlowAlgorithm.MaximumFlow<E> getMaximumFlow​(V source,
                                                           V sink)
        Sets current source to source, current sink to sink, then calculates maximum flow from source to sink. Returns an object containing detailed information about the flow.
        Parameters:
        source - source of the flow inside the network
        sink - sink of the flow inside the network
        Returns:
        maximum flow
      • calculateMaximumFlow

        default double calculateMaximumFlow​(V source,
                                            V sink)
        Sets current source to source, current sink to sink, then calculates maximum flow from source to sink. Note, that source and sink must be vertices of the network passed to the constructor, and they must be different.
        Parameters:
        source - source vertex
        sink - sink vertex
        Returns:
        the value of the maximum flow
      • getMaximumFlowValue

        default double getMaximumFlowValue()
        Returns maximum flow value, that was calculated during last calculateMaximumFlow call. NOTE: this function currently has a default implementation to guarantee backwards compatibility. This function should be enforced in the next version.
        Returns:
        maximum flow value
      • getFlowMap

        default java.util.Map<E,​java.lang.Double> getFlowMap()
        Returns maximum flow, that was calculated during last calculateMaximumFlow call, or null, if there was no calculateMaximumFlow calls. NOTE: this function currently has a default implementation to guarantee backwards compatibility. This function should be enforced in the next version.
        Returns:
        read-only mapping from edges to doubles - flow values
      • getFlowDirection

        default V getFlowDirection​(E e)
        Returns the direction of the flow on an edge (u,v). In case (u,v) is a directed edge (arc), this function will always return the edge target v. However, if (u,v) is an edge in an undirected graph, flow may go through the edge in either side. If the flow goes from u to v, we return v, otherwise u. If the flow on an edge equals 0, the returned value has no meaning. NOTE: this function currently has a default implementation to guarantee backwards compatibility. This function should be enforced in the next version.
        Parameters:
        e - edge
        Returns:
        the vertex where the flow leaves the edge