# anjelli/aircraft-crew-recovery architecture

> Architecture diagram of the GitHub repository anjelli/aircraft-crew-recovery, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anjelli/aircraft-crew-recovery
- Repository: https://github.com/anjelli/aircraft-crew-recovery

## Overview

Aircraft Crew Recovery is a research prototype that plans operate/cancel decisions jointly across crew pairings and provisional aircraft routes, then exports assignments, validation reports, and unresolved-data findings. Its principal workflow runs selected time horizons from prepared schedules and candidate pairings through legality checks and joint recovery optimization. Supporting capabilities include effective-dated minimum-ground-time handling, aircraft-line inputs, and independent audits. The README documents the runner’s outputs and limitations; several runner and subsystem implementations were not excerpted, so those workflow links reflect documented behavior rather than inspected call sites.

Main entry points: [`src/crew_recovery/joint_recovery.py`](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/joint_recovery.py) (Joint recovery solver), [`scripts/run_joint_recovery_horizons.py`](https://github.com/anjelli/aircraft-crew-recovery/blob/main/scripts/run_joint_recovery_horizons.py) (Horizon runner), [`src/crew_recovery/pairing_columns.py`](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/pairing_columns.py) (Candidate columns), [`column_generation.py`](https://github.com/anjelli/aircraft-crew-recovery/blob/main/column_generation.py) (Coverage master)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and rules"]
  node_schedule["Prepared schedule<br/>[prep_inputs.py]"]
  node_pairing_data["Pairing report"]
  node_mgt["Effective MGT<br/>[mgt_effective.py]"]
end

subgraph group_crew["Crew pairing"]
  node_pairing_builder["Pairing generation"]
  node_pairing_columns["Candidate columns<br/>[pairing_columns.py]"]
  node_validator["Pairing validator"]
  node_pricing["Pairing pricing"]
  node_master["Coverage master"]
  node_integrated_cg["Integrated column generation"]
end

subgraph group_aircraft["Aircraft recovery"]
  node_inventory["Aircraft inventory"]
  node_rotation["Aircraft routes"]
end

subgraph group_execution["Recovery and reporting"]
  node_joint["Joint recovery solver<br/>[joint_recovery.py]"]
  node_horizon_runner["Horizon runner"]
  node_audit["Independent line audit"]
  node_results["Recovery exports"]
end

node_analyst(("Planner"))

node_analyst -->|"runs horizons"| node_horizon_runner
node_schedule -.->|"provides schedule"| node_horizon_runner
node_pairing_data -.->|"supplies pairing rules"| node_pairing_builder
node_pairing_builder -.->|"builds candidates"| node_pairing_columns
node_pairing_columns -->|"validates candidates"| node_validator
node_pairing_columns -->|"adapts to columns"| node_master
node_pricing -.->|"prices candidates"| node_integrated_cg
node_integrated_cg -->|"solves master"| node_master
node_mgt -.->|"supplies turnaround rules"| node_horizon_runner
node_inventory -.->|"provides resources"| node_joint
node_rotation -->|"supports routing"| node_joint
node_master -.->|"provides pairing model"| node_joint
node_horizon_runner -->|"runs recovery"| node_joint
node_joint -.->|"checks assignments"| node_audit
node_joint -->|"exports decisions"| node_results
node_audit -->|"exports findings"| node_results
node_horizon_runner -->|"writes horizons"| node_results

click node_schedule "https://github.com/anjelli/aircraft-crew-recovery/blob/main/scripts/prep_inputs.py"
click node_pairing_data "https://github.com/anjelli/aircraft-crew-recovery/blob/main/originals/pairings_builder.py"
click node_mgt "https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/mgt_effective.py"
click node_pairing_builder "https://github.com/anjelli/aircraft-crew-recovery/blob/main/originals/pairings_builder.py"
click node_pairing_columns "https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/pairing_columns.py"
click node_validator "https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/independent_validator.py"
click node_pricing "https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/resource_constrained_pricing.py"
click node_master "https://github.com/anjelli/aircraft-crew-recovery/blob/main/column_generation.py"
click node_integrated_cg "https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/integrated_column_generation.py"
click node_inventory "https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/aircraft_line_inputs.py"
click node_rotation "https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/aircraft_rotation.py"
click node_joint "https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/joint_recovery.py"
click node_horizon_runner "https://github.com/anjelli/aircraft-crew-recovery/blob/main/scripts/run_joint_recovery_horizons.py"
click node_audit "https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/aircraft_line_audit.py"
click node_results "https://github.com/anjelli/aircraft-crew-recovery/blob/main/scripts/run_joint_recovery_horizons.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_schedule,node_pairing_data,node_mgt toneBlue
class node_pairing_builder,node_pairing_columns,node_validator,node_pricing,node_master,node_integrated_cg toneAmber
class node_inventory,node_rotation toneMint
class node_joint,node_horizon_runner,node_audit,node_results toneRose
class node_analyst toneIndigo
```

## Components

### Inputs and rules

- [Prepared schedule](https://github.com/anjelli/aircraft-crew-recovery/blob/main/scripts/prep_inputs.py): `scripts/prep_inputs.py`
- [Pairing report](https://github.com/anjelli/aircraft-crew-recovery/blob/main/originals/pairings_builder.py): `originals/pairings_builder.py`
- [Effective MGT](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/mgt_effective.py): `src/crew_recovery/mgt_effective.py`

### Crew pairing

- [Pairing generation](https://github.com/anjelli/aircraft-crew-recovery/blob/main/originals/pairings_builder.py): `originals/pairings_builder.py`
- [Candidate columns](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/pairing_columns.py): `src/crew_recovery/pairing_columns.py`
- [Pairing validator](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/independent_validator.py): `src/crew_recovery/independent_validator.py`
- [Pairing pricing](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/resource_constrained_pricing.py): `src/crew_recovery/resource_constrained_pricing.py`
- [Coverage master](https://github.com/anjelli/aircraft-crew-recovery/blob/main/column_generation.py): `column_generation.py`
- [Integrated column generation](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/integrated_column_generation.py): `src/crew_recovery/integrated_column_generation.py`

### Aircraft recovery

- [Aircraft inventory](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/aircraft_line_inputs.py): `src/crew_recovery/aircraft_line_inputs.py`
- [Aircraft routes](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/aircraft_rotation.py): `src/crew_recovery/aircraft_rotation.py`

### Recovery and reporting

- [Joint recovery solver](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/joint_recovery.py): `src/crew_recovery/joint_recovery.py`
- [Horizon runner](https://github.com/anjelli/aircraft-crew-recovery/blob/main/scripts/run_joint_recovery_horizons.py): `scripts/run_joint_recovery_horizons.py`
- [Independent line audit](https://github.com/anjelli/aircraft-crew-recovery/blob/main/src/crew_recovery/aircraft_line_audit.py): `src/crew_recovery/aircraft_line_audit.py`
- [Recovery exports](https://github.com/anjelli/aircraft-crew-recovery/blob/main/scripts/run_joint_recovery_horizons.py): `scripts/run_joint_recovery_horizons.py`

### Other components

- **Planner**

## Connections

- Planner → Horizon runner: runs horizons (evidence: `README.md`)
- Prepared schedule → Horizon runner: provides schedule
- Pairing report → Pairing generation: supplies pairing rules (evidence: `originals/pairings_builder.py`)
- Pairing generation → Candidate columns: builds candidates
- Candidate columns → Pairing validator: validates candidates (evidence: `src/crew_recovery/pairing_columns.py`)
- Candidate columns → Coverage master: adapts to columns (evidence: `src/crew_recovery/pairing_columns.py`)
- Pairing pricing → Integrated column generation: prices candidates
- Integrated column generation → Coverage master: solves master (evidence: `src/crew_recovery/integrated_column_generation.py`)
- Effective MGT → Horizon runner: supplies turnaround rules
- Aircraft inventory → Joint recovery solver: provides resources
- Aircraft routes → Joint recovery solver: supports routing (evidence: `src/crew_recovery/joint_recovery.py`)
- Coverage master → Joint recovery solver: provides pairing model (evidence: `src/crew_recovery/joint_recovery.py`)
- Horizon runner → Joint recovery solver: runs recovery (evidence: `README.md`)
- Joint recovery solver → Independent line audit: checks assignments
- Joint recovery solver → Recovery exports: exports decisions (evidence: `README.md`)
- Independent line audit → Recovery exports: exports findings (evidence: `README.md`)
- Horizon runner → Recovery exports: writes horizons (evidence: `README.md`)
