Zog.Flow (Zog v0.1.0)
View SourceNative network flow and cut algorithms backed by Zog (Zig) via Zigler.
Summary
Functions
Computes the global minimum cut of an undirected weighted network using the Stoer-Wagner algorithm.
Computes the maximum flow and minimum cut from source to sink in the network using the native Zog backend.
Functions
@spec edmonds_karp_f64( 0..18_446_744_073_709_551_615, [0..4_294_967_295] | <<_::_*32>>, [0..4_294_967_295] | <<_::_*32>>, [float()] | <<_::_*64>>, 0..4_294_967_295, 0..4_294_967_295 ) :: %{ max_flow: float(), residual_cap: [float()], residual_from: [0..4_294_967_295], residual_to: [0..4_294_967_295], sink_side: [0..4_294_967_295], source_side: [0..4_294_967_295] }
@spec global_min_cut(Zog.SoA.t()) :: %{ cut_value: float(), source_side: [Zog.SoA.label()], sink_side: [Zog.SoA.label()] }
Computes the global minimum cut of an undirected weighted network using the Stoer-Wagner algorithm.
@spec max_flow(Zog.SoA.t(), Zog.SoA.label(), Zog.SoA.label(), atom()) :: %{ max_flow: float(), residual_graph: Zog.SoA.t(), source_side: [Zog.SoA.label()], sink_side: [Zog.SoA.label()] }
Computes the maximum flow and minimum cut from source to sink in the network using the native Zog backend.
@spec push_relabel_f64( 0..18_446_744_073_709_551_615, [0..4_294_967_295] | <<_::_*32>>, [0..4_294_967_295] | <<_::_*32>>, [float()] | <<_::_*64>>, 0..4_294_967_295, 0..4_294_967_295 ) :: %{ max_flow: float(), residual_cap: [float()], residual_from: [0..4_294_967_295], residual_to: [0..4_294_967_295], sink_side: [0..4_294_967_295], source_side: [0..4_294_967_295] }