How akavosi/sqep works
SQEP is a reference implementation for choosing queen activations on a shrinking-survivor n-queens board to minimize cumulative conflicts. A user builds board data from an initial placement, then simulates a trajectory using an activation policy; policies include random-admissible, greedy-degree, and ACG. Exact backward induction supplies an optimal value function for validation, while a separate deterministic p=1 MIP solver returns an activation sequence that can be replayed through the simulator for a cross-check. The README and excerpts document these capabilities; no CLI or service layer is present.
Main entry points: sqep_model.py Conflict Logic · sqep_mip.py Deterministic MIP · sqep_algorithms.py ACG Policy
Components 14
Board and Dynamics
- Initial Placement
src/sqep/sqep_model.py - Board Data
src/sqep/sqep_model.py - Conflict Logic
src/sqep/sqep_model.py - Trajectory Simulator
src/sqep/sqep_model.py
Activation Policies
- Random Policy
src/sqep/sqep_model.py - Greedy Degree
src/sqep/sqep_model.py - ACG Policy
src/sqep/sqep_algorithms.py - Closed-form Gain
src/sqep/sqep_algorithms.py
Exact Optimization
- Optimal Values
src/sqep/sqep_algorithms.py - Optimal Action
src/sqep/sqep_algorithms.py - Deterministic MIP
src/sqep/sqep_mip.py - MIP Replay Check
src/sqep/sqep_mip.py
Other components
- Researcher
- PuLP / CBC
Connections 20
- Researcher → Initial Placement: provides positions
README.md - Initial Placement → Board Data: builds data
src/sqep/sqep_model.py - Board Data → Conflict Logic: precomputes attacks
src/sqep/sqep_model.py - Researcher → Trajectory Simulator: runs simulation
README.md - Trajectory Simulator → Conflict Logic: queries neighborhood
src/sqep/sqep_model.py - Trajectory Simulator → Random Policy: dispatches policy
src/sqep/sqep_model.py - Trajectory Simulator → Greedy Degree: dispatches policy
src/sqep/sqep_model.py - Trajectory Simulator → ACG Policy: dispatches policy
README.md - Random Policy → Conflict Logic: gets admissible actions
src/sqep/sqep_model.py - Greedy Degree → Conflict Logic: gets neighborhoods
src/sqep/sqep_model.py - ACG Policy → Closed-form Gain: scores actions
src/sqep/sqep_algorithms.py - Closed-form Gain → Conflict Logic: evaluates conflicts
src/sqep/sqep_algorithms.py - Researcher → Optimal Values: requests values
README.md - Optimal Values → Conflict Logic: evaluates states
src/sqep/sqep_algorithms.py - Optimal Action → Conflict Logic: evaluates actions
src/sqep/sqep_algorithms.py - Researcher → Deterministic MIP: requests solution
README.md - Deterministic MIP → Board Data: uses board data
src/sqep/sqep_mip.py - Deterministic MIP → PuLP / CBC: solves model
src/sqep/sqep_mip.py - Researcher → MIP Replay Check: requests replay
README.md - MIP Replay Check → Conflict Logic: simulates deterministic kills
src/sqep/sqep_mip.py