Input encoding for the moment linear program
Lax263307.NativeMomentLP · concepts/Lax263307/NativeMomentLP.lean · lax-263307
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
The input to the moment-LP constructor records the graph order, the independent-set target, the relaxation level, and the adjacency matrix.
Concept map
Lean source view on GitHub
| 1 | import Lax263307.MomentLP |
| 2 | import Lax808846.Ram |
| 3 | import Lax109476.RationalEncoding |
| 4 | |
| 5 | /-! |
| 6 | --- |
| 7 | title: Input encoding for the moment linear program |
| 8 | type: definition |
| 9 | --- |
| 10 | The input to the moment-LP constructor records the graph order, the |
| 11 | independent-set target, the relaxation level, and the adjacency matrix. |
| 12 | |
| 13 | # Formalization notes |
| 14 | |
| 15 | The first four words are , , , and . They are followed by the |
| 16 | adjacency bits in row-major order. This encoding is used by the concrete |
| 17 | RAM constructor in the proof package. |
| 18 | -/ |
| 19 | |
| 20 | namespace Lax263307.NativeMomentLP |
| 21 | |
| 22 | def encodeInput {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (k r : ℕ) : List ℕ := |
| 23 | n::k::r::(n*n)::(List.ofFn fun u => List.ofFn fun v => if G.Adj u v then 1 else 0).flatten |
| 24 | |
| 25 | end Lax263307.NativeMomentLP |
| 26 |
Formalization notes
The first four words are , , , and . They are followed by the adjacency bits in row-major order. This encoding is used by the concrete RAM constructor in the proof package.
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments