Problem instances and encodings for the Word-RAM Hungarian method #
Defines Instance together with its row-major signed-word encoding (Instance.encode),
word-width envelope (Instance.wordBound), optimal assignment (Instance.assignment), and
minimum matching cost (Instance.encodedMinCost).
Maximum absolute cost max_{u, v} |cost (u, v)| (0 when n = 0).
Sufficient word-value envelope covering all input words, array addresses, shifted potentials, slacks, and accumulated matching costs.
Minimum perfect-matching cost of inst, encoded as an unsigned word via Signed.encode.
The Finset of pairs (u, inst.assignedCol u) equals (hungarian inst.cost).matching.
The induced matching of inst.assignment is a minimum-cost perfect matching of inst.cost.
Summing inst.cost (u, inst.assignedCol u) over all rows equals the minimum matching cost.
Every instance's encoding fits at any word width admitting inst.wordBound.