Input encoding and workspace layout for Word-RAM odd cycle transversal #
This module collects the pure input encoding (encodeAdjMatrix, encodeInput) and linear
workspace address offsets shared across the OddCycleTransversal Word-RAM implementation,
including the (2n + 2)-vertex split-network node indices inIdx and outIdx.
Main definitions #
Cslib.Algorithms.WordRAM.OddCycleTransversal.encodeAdjMatrix,Cslib.Algorithms.WordRAM.OddCycleTransversal.encodeInput: row-major adjacency matrix encoding and prefixed input listn :: k :: encodeAdjMatrix G.Cslib.Algorithms.WordRAM.OddCycleTransversal.sepAddr,Cslib.Algorithms.WordRAM.OddCycleTransversal.colAddr,Cslib.Algorithms.WordRAM.OddCycleTransversal.octWorkspace: output transversal/colouring addresses and total workspace frontier5 * n ^ 2 + 21 * n + 11.Cslib.Algorithms.WordRAM.OddCycleTransversal.inIdx,Cslib.Algorithms.WordRAM.OddCycleTransversal.outIdx: split-network in/out vertex indices.
Main results #
Cslib.Algorithms.WordRAM.OddCycleTransversal.length_encodeAdjMatrix,Cslib.Algorithms.WordRAM.OddCycleTransversal.length_encodeInput,Cslib.Algorithms.WordRAM.OddCycleTransversal.getElem_encodeAdjMatrix: length and entry characterizations of the adjacency-matrix encoding.Cslib.Algorithms.WordRAM.OddCycleTransversal.inIdx_injective: injectivity ofinIdx.
Input encoding and workspace layout #
Row-major n * n-word 0/1 adjacency matrix of G : SimpleGraph (Fin n).
Word-RAM input word list n :: k :: encodeAdjMatrix G.
Number of vertices n + n + 2 in the vertex-split network of an n-vertex graph.
Output address storing the 0/1 transversal indicator of vertex v (3 + n * n + v).
Output address storing the 0/1 proper colouring bit of vertex v
(3 + n * n + n + v).
Base address of the 0/1 transversal indicator slice.
Base address of the 0/1 proper colouring slice.
Base address of the candidate-set W indicator slice.
Base address of the compacted vertex list W.
Base address of the base-3 odometer digits for W.
Base address of the unpacked guess-role slice.
Base address of the keep-terminal indicator slice.
Base address of the flip-terminal indicator slice.
Base address of the flattened split-network flow matrix.
Base address of the BFS distance array.
Base address of the BFS parent array.
Base address of the extracted separator indicator array.
Total scratch words allocated past 3 + n * n.
Total memory frontier 5 * (n * n) + 21 * n + 11 (= 3 + n * n + octScratch n) used by the
Word-RAM odd-cycle-transversal solver.
3 + n * n + octScratch n = octWorkspace n.
In-vertex index v + 2 inside the (2n + 2)-vertex split network.
Out-vertex index v + n + 2 inside the (2n + 2)-vertex split network.
inIdx is injective.