solutions
¶
The solutions
module provides the full infrastructure for solving cadetโAFSC matching problems in the
AFCCP system. It includes a range of algorithms (HR, GA, GUO, etc.), constraint handling logic, Pyomo-based
model construction and solver interfaces, and extensive support for sensitivity analysis and "what-if"
scenarios.
This module is central to the AFCCP ecosystemโit orchestrates the end-to-end optimization workflow: generating initial solutions, building and solving models, evaluating results, and exploring trade-offs through iterative constraints or shifting objectives.
Submodules¶
solutions.algorithms
Implements baseline and advanced matching algorithms including:- Classic and enhanced Hospital/Residents (HR) matching
- GA/GMA: Genetic algorithms with cadetโAFSC crossover, mutation, and selection logic
- Hybrid solutions: Merge utility-based models with HR/GMA results for feasible fallback options
solutions.handling
Provides tools for:- Evaluating objective values: VFT scores, fairness metrics, quota and eligibility violations
- Constraint diagnostics: Identifies which constraints were violated or binding
- Preference reconstruction: Converts
j_array
solutions into readable cadet assignments
solutions.optimization
Contains the core Pyomo model logic and solver interfaces for:- VFT models (exact and approximate)
- GUO (Global Utility Optimization) and goal programming models
- Constraint injection, warm-starting, and solution persistence
- Full compatibility with real-world constraints like AFOCD tiers, base/training thresholds, and USAFA rules
solutions.sensitivity
Tools for constraint iteration, GA initialization, and what-if analysis, including:- Automated constraint relaxation workflows
- PGL capacity adjustment loops and visualizations
- "What If List.csv" batch simulation and delta metric reporting
Typical Workflow¶
- Generate Initial Solution(s)
- Use
algorithms
to run HR or GA on initial cadetโAFSC preferences - Or pre-seed GA populations using VFT/Assignment heuristics from
sensitivity
- Use
- Build and Solve Optimization Model
- Construct VFT or GUO model in
optimization
- Add constraints based on cadet thresholds, base/training requirements, or fairness tiers
- Construct VFT or GUO model in
- Evaluate Solution
- Use
handling
to check feasibility, score each objective, and extract readable results
- Use
- Run Sensitivity Analysis
- Apply
sensitivity
to modify constraints, quotas, or preference structures - Generate what-if metrics and comparative charts
- Apply
See Also¶
-
data.preferences
: Cadet/AFSC eligibility, tier data, and OM-based utility scores -
data.values
: Solver weight configurations for VFT and GUO objectives -
CadetCareerProblem
: Main interface to run all solution workflows via.solve_*()
methods