Observed since 20 Oct, 20:47 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Fleet-aware airline route-network optimization in Python.
AerOptimPy is an early-stage Python package for fleet-aware airline route-network and flight-frequency optimization.
The package uses the free, open-source HiGHS optimizer by default through
scipy.optimize.milp. Gurobi remains available as an optional backend for users with an
appropriate Gurobi license.
The first model answers this planning question:
Given passenger demand, fares, aircraft capacity, fleet availability, airport slots, aircraft range, and operating costs, which direct routes should an airline operate and how frequently should it fly them?
Full guides for GitHub readers:
pip install aeroptimpy
No solver license is required for the default HiGHS backend.
Optional Gurobi support:
pip install "aeroptimpy[gurobi]"
Optional interactive maps:
pip install "aeroptimpy[viz]"
Requires Python 3.10+.
You supply three ingredients:
Then AerOptimPy returns an optimized frequency plan (which routes, which aircraft, how many flights).
from aeroptimpy import Aircraft, Airport, Demand, RouteNetwork, RouteOptimizer
airports = [
Airport("DTW", 42.2162, -83.3554, slot_limit=40),
Airport("ATL", 33.6407, -84.4277, slot_limit=50),
]
fleet = [
Aircraft(
name="A320",
capacity=180,
count=2,
range_km=6100,
cruise_speed_kmh=830,
cost_per_block_hour=6500,
)
]
demand = [
Demand("DTW", "ATL", passengers=240, average_fare=210),
Demand("ATL", "DTW", passengers=220, average_fare=205),
]
network = RouteNetwork(airports=airports, aircraft=fleet, demand=demand)
optimizer = RouteOptimizer(network) # solver="highs" is the default
result = optimizer.solve(planning_days=1, max_flights_per_leg=5)
print(result.summary())
for route in result.routes:
print(route)
Select Gurobi explicitly when it is installed and licensed:
optimizer = RouteOptimizer(network, solver="gurobi")
from aeroptimpy.viz import plot_routes
fmap = plot_routes(
network,
result,
theme="midnight",
weight_by="flights",
rank_by="contribution", # value ranking, not flight order
animate=True,
)
fmap.save("optimal_routes.html")
On the map:
Run the map example with:
python examples/plot_optimal_routes.py
git clone https://github.com/GodsentIzzy123/aeroptimpy.git
cd aeroptimpy
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev,viz]"
pytest
Run the basic optimizer example:
python examples/basic_route_optimization.py
For airport pair (i, j) and aircraft type k, the model uses:
activate[i,j,k]: binary route-aircraft activation variableflights[i,j,k]: integer number of flightsserved[i,j]: passengers carriedThe objective maximizes passenger revenue minus flight operating cost and an optional carbon-price penalty.
Map rankings by contribution show economic priority, not a single-aircraft itinerary.
If you use AerOptimPy in academic work, please cite it (see CITATION.cff).
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3.1 | 7 Aug 2026 | 9 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 20:47 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:defbd5be021f25d59a429bc9b9597f8fadb2f7fa79f0210dff2ef08397860471