# Solver Notes

## Formula Notes

The train formulas are Ramsey edge-coloring CNFs.  The DIMACS variable count
is triangular, so variable `1..C(n,2)` maps lexicographically to graph edges.
For `ramsey_4_4_n`, every 4-set contributes both a positive 6-clause and a
negative 6-clause, forbidding monochromatic `K4` in either color.

The solver detects this structure from clauses only.  It does not read comment
lines, filenames, hashes, or instance names.

## Techniques Used

Current solved target: `R(4,4,n)` for `n >= 18`.

The proof uses VeriPB cutting planes and redundancy-based symmetry breaking:

- Add lexicographic ordering constraints for the colors of edges from vertex
  `0` to vertices `1..17`, using vertex-permutation witnesses.
- Add `x(0,9)` using color-complement plus reversal of vertices `1..17`.
  Together these constraints force edges `(0,1)..(0,9)` to be red.
- Under those nine red incident edges, the induced subgraph on vertices
  `1..9` would have no red triangle and no blue `K4`.
- A compact CP proof of `R(3,4)=9` is generated: degree upper/lower
  constraints are derived via `R(3,3)=6`, then summed and divided to get the
  parity contradiction.
- The derived clause `~x(0,1) OR ... OR ~x(0,9)` conflicts with the symmetry
  break, yielding an empty RUP constraint.

Proofs are small for the train `R(4,4)` instances, about 9,900 lines and under
1 MB, and verify locally with `veripb --cnf`.

## Remaining Things To Try

- Extend the same symmetry-breaking and CP style to `R(3,6,18/19)` and
  `R(3,7,23)`.
- For `R(3,k)`, useful known structure: in the blue graph, no triangles and no
  independent set of size `k`; max blue degree is at most `k-1`, and exact
  threshold instances also imply lower degree bounds from smaller Ramsey
  numbers.
- Investigate VeriPB `red` witnesses for stronger vertex-neighborhood
  canonicalization so only one high-level neighborhood type needs a CP proof.

## Known Limitations

- Unsupported Ramsey signatures return `UNKNOWN`.
- `R(3,6)` and `R(3,7)` are currently detected but not solved.
- The solver assumes the normalized lexicographic edge-variable order and
  conservatively verifies the full `R(4,4,n)` clause set before proving UNSAT.

## Changelog

- Initial scaffold replaced.
- Added local profiling tools for Ramsey CNF signatures.
- Added CP proof experiments for `R(3,3)=6`, `R(3,4)=9`, and symmetry-broken
  `R(4,4)=18`.
- Implemented the production Python solver for `R(4,4,n>=18)` with VeriPB
  `red`, `rup`, and `pol` proof generation.
