Record Class NetworkFlowUtil.FlowResult<V>

java.lang.Object
java.lang.Record
cloud.opencode.base.graph.algorithm.NetworkFlowUtil.FlowResult<V>
Type Parameters:
V - the vertex type | 顶点类型
Record Components:
maxFlow - the maximum flow value | 最大流值
edgeFlows - flow on each edge | 每条边上的流量
minCut - edges in minimum cut | 最小割中的边
Enclosing class:
NetworkFlowUtil

public static record NetworkFlowUtil.FlowResult<V>(double maxFlow, Map<Edge<V>,Double> edgeFlows, Set<Edge<V>> minCut) extends Record
Flow result containing max flow value, edge flows, and min-cut 包含最大流值、边流量和最小割的流结果
Since:
JDK 25, opencode-base-graph V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Summary

    Constructors
    Constructor
    Description
    FlowResult(double maxFlow, Map<Edge<V>,Double> edgeFlows, Set<Edge<V>> minCut)
    Creates an instance of a FlowResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the edgeFlows record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Check if flow is valid (max flow is positive) 检查流是否有效(最大流为正)
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the maxFlow record component.
    Returns the value of the minCut record component.
    double
    Get the minimum cut capacity (equals max flow) 获取最小割容量(等于最大流)
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FlowResult

      public FlowResult(double maxFlow, Map<Edge<V>,Double> edgeFlows, Set<Edge<V>> minCut)
      Creates an instance of a FlowResult record class.
      Parameters:
      maxFlow - the value for the maxFlow record component
      edgeFlows - the value for the edgeFlows record component
      minCut - the value for the minCut record component
  • Method Details

    • minCutCapacity

      public double minCutCapacity()
      Get the minimum cut capacity (equals max flow) 获取最小割容量(等于最大流)
      Returns:
      min-cut capacity | 最小割容量
    • hasFlow

      public boolean hasFlow()
      Check if flow is valid (max flow is positive) 检查流是否有效(最大流为正)
      Returns:
      true if valid | 如果有效返回true
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • maxFlow

      public double maxFlow()
      Returns the value of the maxFlow record component.
      Returns:
      the value of the maxFlow record component
    • edgeFlows

      public Map<Edge<V>,Double> edgeFlows()
      Returns the value of the edgeFlows record component.
      Returns:
      the value of the edgeFlows record component
    • minCut

      public Set<Edge<V>> minCut()
      Returns the value of the minCut record component.
      Returns:
      the value of the minCut record component