Result of maximum flow computation (Edmonds-Karp, etc.).
Contains the maximum flow value and the residual graph, which can be used to extract the minimum cut.
Fields
max_flow- The maximum flow value from source to sinkresidual_graph- The residual graph after flow computationsource- The source node IDsink- The sink node IDalgorithm- Name of the algorithm used (optional)metadata- Optional metadata (iterations, time, etc.)
Examples
iex> result = %Yog.Flow.MaxFlowResult{
...> max_flow: 15,
...> residual_graph: graph,
...> source: 1,
...> sink: 4,
...> algorithm: :edmonds_karp
...> }
iex> result.max_flow
15
Summary
Functions
Backward compatibility: convert from legacy map format.
Creates a new max flow result.
Creates a new max flow result with algorithm name.
Get flow value on a specific edge in the residual graph.
Convert to legacy map format.
Types
@type t() :: %Yog.Flow.MaxFlowResult{ algorithm: atom(), max_flow: number(), metadata: map(), residual_graph: Yog.graph(), sink: Yog.Model.node_id(), source: Yog.Model.node_id() }
Functions
Backward compatibility: convert from legacy map format.
@spec new(number(), Yog.graph(), Yog.Model.node_id(), Yog.Model.node_id()) :: t()
Creates a new max flow result.
@spec new(number(), Yog.graph(), Yog.Model.node_id(), Yog.Model.node_id(), atom()) :: t()
Creates a new max flow result with algorithm name.
@spec residual_capacity(t(), Yog.Model.node_id(), Yog.Model.node_id()) :: number()
Get flow value on a specific edge in the residual graph.
Convert to legacy map format.