# Solver Notes

## Formula Notes

The train files are DLTM influence/target-set CNFs. The first `N` variables are seed decisions, followed by equal-size activation blocks for diffusion time steps. The prefix contains equivalence clauses between the seed block and the first activation block. Per-node transition clauses encode activation as `seed(v) OR threshold(predecessors active at previous step)`, with the threshold implemented either directly for threshold 1 or through sorting/cardinality auxiliaries. Later cardinality networks encode the seed budget and the required final spread.

The detector and analysis scripts under `tools/` recover `N`, predecessor sets, and thresholds from clause structure only. They do not depend on comments or filenames. The high-level problem is target-set selection for deterministic linear threshold diffusion.

## Techniques Used

The submitted executable is currently conservative and SAT-only. It recovers the threshold graph, seed budget, and spread target, then searches seed sets in the recovered diffusion model. Search combines deterministic greedy construction, exact one-swap improvement, randomized restricted-candidate greedy restarts, and simulated annealing over seed swaps. Before printing `SATISFIABLE`, it completes the full CNF assignment by propagation and independently checks every original clause.

A partial from-scratch CDCL/RUP prototype remains in `solver.cpp` after the active return path, but it is not used for submitted answers because proof logging and conflict analysis are not yet trusted on this family. The active solver never prints `UNSATISFIABLE`.

## Remaining Things To Try

Build the real specialized target-set solver from the recovered thresholds. Promising directions are exact branch-and-bound over stalled inactive sets, reverse activation-order search, and stronger lower bounds from residual threshold cores. For UNSAT, a VeriPB proof plan is still needed; possible routes include RUP proofs from a trusted CDCL core or PB derivations for target-set lower bounds.

## Known Limitations

This version still returns `UNKNOWN` for unsupported structures and for instances where no satisfying seed set is found before the internal deadline. It never prints `UNSATISFIABLE`; lower-bound proofs for below-threshold instances remain future work.

## Changelog

- Initial scaffold replaced with C++ solver source and build path.
- Added `tools/analyze_fvs.py`, `tools/recover_thresholds.py`, and `tools/search_tss.py` for structural recovery experiments.
- Recovered seed/activation block layout and per-node threshold transition structure.
- Added a conservative SAT-only stochastic local search engine with final model validation.
- Updated metadata and README for broker submission.
- Replaced the full-CNF local-search submission with a structural Python solver. It now recovers `N`, seed budget, final activation target, and threshold predecessors, searches over seed sets, then completes and validates the full CNF assignment by unit propagation.
- Important correction: the final positive unit asserts a cardinality output, not full activation of all graph vertices. For example, `twitter405_71_12` requires 56 final activations, not 71.
- Improved search so high-level target candidates are validated inside the annealing loop instead of restarting from the same deterministic stream. This fixed `twitter454_70_12` locally.
- Reduced the internal deadline to leave broker margin and avoid worker timeouts on unsupported UNSAT/unknown cases.
- Added `tools/fast_recover.py` for faster structural inspection of stripped DLTM instances.
- Replaced the single annealing loop with greedy construction, one-swap local improvement, randomized greedy restarts, and shorter annealing phases over the recovered diffusion model. Locally this preserves the previous SAT cases and adds `twitter634_77_14` and `twitter774_83_17`.
