.. index:: single: gomory_hu(Dictionary) .. _gomory_hu/1: .. rst-class:: right **object** ``gomory_hu(Dictionary)`` ========================= * ``Dictionary`` - Dictionary object used by the flow network. Gomory-Hu cut trees for networks with symmetric aggregate capacities. Uses n-1 calls to Dinic for n vertices, with no calls for empty networks. Costs and self-loops do not affect cuts. | **Availability:** | ``logtalk_load(flow_networks(loader))`` | **Author:** Paulo Moura | **Version:** 1:0:0 | **Date:** 2026-11-16 | **Compilation flags:** | ``static, context_switching_calls`` | **Uses:** | :ref:`dinic(Dictionary) ` | :ref:`flow_network(Dictionary) ` | :ref:`list ` | :ref:`type ` | **Remarks:** | (none) | **Inherited public predicates:** | (none) .. contents:: :local: :backlinks: top Public predicates ----------------- .. index:: tree/2 .. _gomory_hu/1::tree/2: ``tree/2`` ^^^^^^^^^^ Returns ``tree(Vertices, Edges)`` where each ``edge(Vertex, Parent, Capacity)`` is a weighted tree edge, in vertex order. Requires zero lower bounds and equal total capacity in both directions for every pair of distinct vertices. Parallel multiplicities may differ. Disconnected components are linked by zero-capacity edges. | **Compilation flags:** | ``static`` | **Template:** | ``tree(Network,Tree)`` | **Mode and number of proofs:** | ``tree(+compound,-compound)`` - ``one_or_error`` | **Exceptions:** | A lower bound is non-zero: | ``domain_error(zero_lower_bounds,Network)`` | Aggregate capacities are asymmetric: | ``domain_error(symmetric_capacities,Network)`` ------------ .. index:: min_cut_value/4 .. _gomory_hu/1::min_cut_value/4: ``min_cut_value/4`` ^^^^^^^^^^^^^^^^^^^ Returns the minimum edge capacity on the unique tree path between distinct vertices. Validates the supplied weighted tree. Adjacency construction and traversal take O(V*log(V)) with balanced dictionaries. | **Compilation flags:** | ``static`` | **Template:** | ``min_cut_value(Tree,Source,Sink,Value)`` | **Mode and number of proofs:** | ``min_cut_value(+compound,+ground,+ground,-integer)`` - ``one_or_error`` | **Exceptions:** | An input vertex or the tree is not ground: | ``instantiation_error`` | The tree is malformed: | ``domain_error(gomory_hu_tree,Tree)`` | A terminal is not a tree vertex: | ``existence_error(vertex,Vertex)`` | The terminals are equal: | ``consistency_error(distinct_vertices,Source,Sink)`` ------------ Protected predicates -------------------- (no local declarations; see entity ancestors if any) Private predicates ------------------ (no local declarations; see entity ancestors if any) Operators --------- (none) .. seealso:: :ref:`gomory_hu `, :ref:`dinic(Dictionary) `, :ref:`flow_network(Dictionary) `