Interface FlowAlgorithm<V,​E>

Type Parameters:
V - the graph vertex type
E - the graph edge type
All Known Subinterfaces:
MaximumFlowAlgorithm<V,​E>, MinimumCostFlowAlgorithm<V,​E>
All Known Implementing Classes:
BoykovKolmogorovMFImpl, CapacityScalingMinimumCostFlow, DinicMFImpl, EdmondsKarpMFImpl, GusfieldEquivalentFlowTree, GusfieldGomoryHuCutTree, MaximumFlowAlgorithmBase, PushRelabelMFImpl

public interface FlowAlgorithm<V,​E>
Interface for flow algorithms
Author:
Joris Kinable
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static interface  FlowAlgorithm.Flow<E>
    Represents a flow.
    static class  FlowAlgorithm.FlowImpl<E>
    Default implementation of FlowAlgorithm.Flow
  • Method Summary

    Modifier and Type Method Description
    default FlowAlgorithm.Flow<E> getFlow()
    Result object of a flow algorithm
    V getFlowDirection​(E edge)
    For the specified edge $(u, v)$ returns vertex $v$ if the flow goes from $u$ to $v$, or returns vertex $u$ otherwise.
    java.util.Map<E,​java.lang.Double> getFlowMap()
    Returns a read-only mapping from edges to the corresponding flow values.
  • Method Details

    • getFlow

      default FlowAlgorithm.Flow<E> getFlow()
      Result object of a flow algorithm
      Returns:
      flow
    • getFlowMap

      java.util.Map<E,​java.lang.Double> getFlowMap()
      Returns a read-only mapping from edges to the corresponding flow values.
      Returns:
      a read-only mapping from edges to the corresponding flow values.
    • getFlowDirection

      V getFlowDirection​(E edge)
      For the specified edge $(u, v)$ returns vertex $v$ if the flow goes from $u$ to $v$, or returns vertex $u$ otherwise. For directed flow networks the result is always the head of the specified arc.

      Note: not all flow algorithms may support undirected graphs.

      Parameters:
      edge - an edge from the specified flow network
      Returns:
      the direction of the flow on the edge