Flat Word-RAM inputs and parent-list specifications for Chu–Liu/Edmonds #
This module defines the input structures ArborescenceInput and BranchingInput, their
row-major flat Word-RAM encodings (flattenBoolMatrix, flattenSignedMatrix, encode), the
polynomial word-value/address bound wordBound, and the expected parent-list output maps with
optimality characterizations.
Main definitions #
Cslib.Algorithms.WordRAM.Arborescence.wordBound: polynomial bound4 * (n + 1) * M₀ + 32 * (n + 1) ^ 2on word values and workspace addresses.Cslib.Algorithms.WordRAM.Arborescence.flattenBoolMatrix,Cslib.Algorithms.WordRAM.Arborescence.flattenSignedMatrix: row-major flat word-list encodings of Boolean adjacency and signed cost/weight matrices.Cslib.Algorithms.WordRAM.Arborescence.ArborescenceInput,Cslib.Algorithms.WordRAM.Arborescence.BranchingInput: weighted digraph inputs onFin nwith intrinsic magnitude and word-value/address bounds, flat word encodings, and expected parent-list outputs.
Main results #
Cslib.Algorithms.WordRAM.Arborescence.ArborescenceInput.expectedParentList_eq_nil_iff,Cslib.Algorithms.WordRAM.Arborescence.ArborescenceInput.expectedParentList_spec,Cslib.Algorithms.WordRAM.Arborescence.ArborescenceInput.expectedOutParentList_eq_nil_iff,Cslib.Algorithms.WordRAM.Arborescence.ArborescenceInput.expectedOutParentList_spec,Cslib.Algorithms.WordRAM.Arborescence.BranchingInput.expectedParentList_spec: correctness and optimality characterizations of the encoded parent-list outputs.
Word-value and address bound #
Polynomial bound on word values and workspace addresses covering the rooted, reversed min-cost
reduced exit costs up to 4 * (n + 1) * M₀ together with all O(n²) workspace addresses.
The condition Fits w (wordBound n M₀) means wordBound n M₀ < 2 ^ w, so a word width w of
order log(n + 2) + log(M₀ + 2) bits suffices.
Underlying Digraph (Fin I.n) of an ArborescenceInput.
Maximum absolute arc cost max_{u, v} |I.cost u v|.
Intrinsic polynomial word-value/address bound wordBound I.n I.maxAbsCost
(Fits w I.wordBound means I.wordBound < 2 ^ w, so w of order
log(I.n + 2) + log(I.maxAbsCost + 2) bits suffices).
Flat Word-RAM input word list [n, root] ++ flattenBoolMatrix ++ flattenSignedMatrix.
Expected list output for minimum-cost spanning in-arborescence ([] when infeasible, or the
length-n parent list [p(0), …, p(n - 1)] when edmonds I.digraph I.cost I.root = some p).
I.expectedParentList is empty iff I.digraph has no spanning in-arborescence rooted at
I.root.
Whenever I.expectedParentList is nonempty, it encodes the parent map of a minimum-cost
spanning in-arborescence of I.digraph rooted at I.root.
Expected list output for minimum-cost spanning out-arborescence ([] when infeasible, or the
length-n parent list [p(0), …, p(n - 1)] when edmondsOut I.digraph I.cost I.root = some p).
I.expectedOutParentList is empty iff I.digraph has no spanning out-arborescence rooted at
I.root.
Whenever I.expectedOutParentList is nonempty, it encodes the parent map of a minimum-cost
spanning out-arborescence of I.digraph rooted at I.root.
Underlying Digraph (Fin I.n) of a BranchingInput.
Intrinsic polynomial word-value/address bound wordBound (I.n + 1) I.maxAbsWeight
(Fits w I.wordBound means I.wordBound < 2 ^ w, so w of order
log(I.n + 2) + log(I.maxAbsWeight + 2) bits suffices).
Flat Word-RAM input word list [n] ++ flattenBoolMatrix ++ flattenSignedMatrix.
Expected length-n parent list [p(0), …, p(n - 1)] of optimumBranchingParent.
I.expectedParentList encodes optimumBranchingParent I.digraph I.weight, whose branching
digraph optimumBranching I.digraph I.weight is a maximum-weight branching of I.digraph.